Skip to main content
skill CX Codex

k8s-networking — Claude Code skill for Kubernetes networking

k8s-networking is a Claude Code skill for managing Kubernetes services, Ingress, endpoints, and network policies. It helps configure routing and investigate connectivity problems.

MIT-0 1 installs ★ 976 updated 2026-10-22

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add rohitg00/kubectl-mcp-server --skill k8s-networking -a claude-code
Open on GitHub

What k8s-networking does

The skill uses kubectl-mcp-server tools to inspect networking resources and apply manifests for services, Ingress, and network policies. For connectivity issues, it guides the agent to check endpoints and service selectors against pod labels, review isolation rules, and test DNS from inside a pod.

The security toolset is required. Start kubectl-mcp-server with --toolsets default,security or set MCP_TOOLSETS=default,security; without it, network policy analysis is unavailable. The skill can apply manifests through kubectl_apply, so review proposed resource changes before they reach the cluster.

What it helps with

  • find services with no endpoints
  • compare service selectors with pod labels
  • inspect Ingress routing rules
  • review network policies that restrict traffic
  • test DNS lookup from inside a pod

Example prompts for the agent

  • Check the endpoints and pod-label selector for my-service in namespace default.
  • Show me the routing rules for Ingress my-ingress.
  • Review network policies in default and diagnose why a pod cannot resolve my-service.

How to install k8s-networking

1Skills CLI (Vercel)

npx skills add rohitg00/kubectl-mcp-server --skill k8s-networking -a claude-code

2Manually: put the files in place

~/.claude/skills/k8s-networking/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/k8s-networking/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about k8s-networking

How do I install k8s-networking in Claude Code?

Run npx skills add rohitg00/kubectl-mcp-server --skill k8s-networking -a claude-code. The skill file is placed at ~/.claude/skills/k8s-networking/SKILL.md.

What does k8s-networking do?

It helps inspect and manage Kubernetes services, Ingress resources, endpoints, and network policies. It also provides a workflow for investigating DNS and connectivity issues.

What is needed to analyze network policies?

Enable the security toolset when starting kubectl-mcp-server, using --toolsets default,security or MCP_TOOLSETS=default,security.

Source text

SKILL.md · MIT-0
---
name: k8s-networking
description: Kubernetes networking management for services, ingresses, endpoints, and network policies. Use when configuring connectivity, load balancing, or network isolation.
license: MIT-0
metadata:
  author: rohitg00
  version: "2.0.0"
  tools: 5
  category: networking
---

# Kubernetes Networking

Manage Kubernetes networking resources using kubectl-mcp-server's networking tools.

> Requires the `security` toolset: start kubectl-mcp-server with `--toolsets default,security` (or `MCP_TOOLSETS=default,security`).

## When to Apply

Use this skill when:
- User mentions: "service", "ingress", "endpoint", "network policy", "load balancer"
- Operations: exposing applications, configuring routing, network isolation
- Keywords: "connectivity", "DNS", "traffic", "port", "firewall"

## Priority Rules

| Priority | Rule | Impact | Tools |
|----------|------|--------|-------|
| 1 | Check endpoints before troubleshooting services | CRITICAL | `kubectl_get` |
| 2 | Verify service selector matches pod labels | HIGH | `kubectl_get`, `kubectl_get` |
| 3 | Review network policies for isolation | HIGH | `analyze_network_policies` |
| 4 | Test DNS resolution from within pods | MEDIUM | `exec_in_pod` |

## Quick Reference

| Task | Tool | Example |
|------|------|---------|
| List services | `kubectl_get` | `kubectl_get(resource_type="services", namespace)` |
| Check backends | `kubectl_get` | `kubectl_get(resource_type="endpoints", namespace)` |
| List ingresses | `kubectl_get` | `kubectl_get(resource_type="ingress", namespace)` |
| Network policies | `analyze_network_policies` | `analyze_network_policies(namespace)` |

## Services

```python
kubectl_get(resource_type="services", namespace="default")

kubectl_describe(resource_type="service", name="my-service", namespace="default")

kubectl_apply(manifest="""
apiVersion: v1
kind: Service
metadata:
  name: my-service
  namespace: default
spec:
  selector:
    app: my-app
  ports:
  - port: 80
    targetPort: 8080
""")

kubectl_apply(manifest="""
apiVersion: v1
kind: Service
metadata:
  name: my-lb
  namespace: default
spec:
  type: LoadBalancer
  selector:
    app: my-app
  ports:
  - port: 443
    targetPort: 8443
""")
```

## Endpoints

```python
kubectl_get(resource_type="endpoints", namespace="default")
```

## Ingress

```python
kubectl_get(resource_type="ingress", namespace="default")

kubectl_describe(resource_type="ingress", name="my-ingress", namespace="default")

kubectl_apply(manifest="""
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: my-ingress
  namespace: default
spec:
  rules:
  - host: app.example.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: my-service
            port:
              number: 80
""")
```

## Network Policies

```python
analyze_network_policies(namespace="default")

kubectl_describe(resource_type="networkpolicy", name="deny-all", namespace="default")

kubectl_apply(manifest="""
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: deny-all
  namespace: default
spec:
  podSelector: {}
  policyTypes:
  - Ingress
  - Egress
""")

kubectl_apply(manifest="""
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: allow-web
  namespace: default
spec:
  podSelector:
    matchLabels:
      app: web
  ingress:
  - from:
    - podSelector:
        matchLabels:
          app: frontend
    ports:
    - port: 80
""")
```

## Troubleshooting Connectivity

```python
kubectl_get(resource_type="endpoints", namespace="default")

analyze_network_policies(namespace="default")

exec_in_pod(
    pod_name="debug-pod",
    namespace="default",
    command="nslookup my-service.default.svc.cluster.local"
)
```

## Related Skills

- [k8s-service-mesh](../k8s-service-mesh/SKILL.md) - Istio traffic management
- [k8s-cilium](../k8s-cilium/SKILL.md) - Cilium network policies

© rohitg00 · MIT-0 · rohitg00/kubectl-mcp-server

Similar skills

All skills for DevOps and infrastructure →

From the same set5

Project sponsors

Companies that keep this analytics open