Your DevOps study space

Real explanations. Videos with tests. Fresh exams every time. Keep the streak alive and watch the XP stack up.

Services, Ingress & networking · Kubernetes Docs · StackwisePlanDevOps Services, Ingress & networking · Kubernetes Docs · StackwiseCodePython Services, Ingress & networking · Kubernetes Docs · StackwiseBuildDocker Services, Ingress & networking · Kubernetes Docs · StackwiseTestDevOps Services, Ingress & networking · Kubernetes Docs · StackwiseReleaseGit Services, Ingress & networking · Kubernetes Docs · StackwiseDeployKubernetes Services, Ingress & networking · Kubernetes Docs · StackwiseOperateLinux Services, Ingress & networking · Kubernetes Docs · StackwiseMonitorDevOps

Pick a topic

Eight tracks, each with docs, a cheat sheet, videos and tests.

How it works

One loop, repeated until it sticks.

Jump back in

Picked up from where you left off.

Free forever

Your DevOps journey starts with one click.

Sign in with Google or GitHub to open every chapter, video, test and challenge. Your progress is saved wherever you learn.

Services, Ingress & networking

Pods come and go, and every new pod gets a new IP address. Services give a group of pods one stable name and address, Ingress brings outside HTTP traffic in by hostname and path, and NetworkPolicies decide who may talk to whom.

The pod network

Every pod gets its own IP, and every pod can reach every other pod directly, across nodes, without NAT. A CNI plugin (Calico, Cilium, Flannel and others) builds that network. Because pod IPs change whenever a pod is replaced, nothing should ever be hard-coded to one: you talk to a Service instead.

Service types

ClusterIP (the default) gives a virtual IP reachable only inside the cluster. Right for anything internal: APIs, databases, caches.

apiVersion: v1
kind: Service
metadata:
  name: web
spec:
  type: ClusterIP
  selector:
    app: web                  # all ready pods with this label
  ports:
    - name: http
      port: 80                # the Service's port
      targetPort: 3000        # the container's port

NodePort also opens the same port (range 30000-32767) on every node, so http://<any-node-ip>:30080 reaches the pods. Fine for labs, rarely used directly in production.

apiVersion: v1
kind: Service
metadata:
  name: web-nodeport
spec:
  type: NodePort
  selector:
    app: web
  ports:
    - port: 80
      targetPort: 3000
      nodePort: 30080         # omit it and Kubernetes picks one

LoadBalancer asks the cloud provider (EKS, GKE, AKS) for a real external load balancer with a public IP. Locally, minikube tunnel fills that role; on bare metal you need something like MetalLB, otherwise EXTERNAL-IP stays <pending>.

apiVersion: v1
kind: Service
metadata:
  name: web-public
spec:
  type: LoadBalancer
  selector:
    app: web
  ports:
    - port: 80
      targetPort: 3000

port, targetPort, nodePort

outside clientcurl node-ip:30080nodePort 30080on every nodeport 80Service web:8080targetPortanother podhttp://web:80inside the cluster
Read it right to left: the app listens on targetPort, the Service exposes port, and nodePort exists only for traffic from outside.
FieldWhere it listensWho uses it
portOn the Service's ClusterIPOther pods: http://web:80
targetPortOn the pod (the containerPort); can also be a port nameThe Service forwards here. Defaults to port
nodePortOn every node's IP (30000-32767)Clients outside the cluster (NodePort/LoadBalancer only)

Selectors and endpoints

A Service finds its pods purely by label selector, and only pods that pass their readiness probe receive traffic. The list of current pod IPs is kept in EndpointSlices:

$ kubectl describe svc web                       # "Endpoints:" line
$ kubectl get endpointslices -l kubernetes.io/service-name=web
$ kubectl get pods -l app=web --show-labels      # do the labels really match?

A Service with no endpoints is the number one reason for "connection refused": either the selector doesn't match the pod labels (a typo, app: Web vs app: web) or no pod is ready.

Cluster DNS

CoreDNS gives every Service a DNS name of the form <service>.<namespace>.svc.cluster.local (cluster.local is the default cluster domain):

  • from the same namespace: web
  • from another namespace: web.shop
  • fully qualified: web.shop.svc.cluster.local
$ kubectl run tmp --rm -it --image=busybox:1.36 --restart=Never -- \
    nslookup web.shop.svc.cluster.local
$ kubectl run tmp --rm -it --image=busybox:1.36 --restart=Never -- \
    wget -qO- http://web.shop

A ClusterIP is virtual (it's implemented by kube-proxy's forwarding rules), so it usually doesn't answer ping. Test with a real request instead. A headless Service (clusterIP: None) has no virtual IP at all: its DNS name returns the pod IPs directly, which is what StatefulSets use.

Ingress: HTTP routing from outside

Instead of one LoadBalancer per Service, an Ingress routes many hostnames and paths through one entry point. The Ingress object is only a set of rules: an ingress controller (Traefik, HAProxy, F5 NGINX, your cloud's controller...) must be installed to actually carry them out. Without one, the Ingress just sits there with no address.

usersthe internetingress controllershop.example.comTLS ends heresvc: webpath /svc: apipath /apiweb podapi podweb podapi pod//api
One entry point, many apps. The Ingress object only holds the rules; the controller is the program that actually receives the traffic.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: shop
spec:
  ingressClassName: traefik          # must match: kubectl get ingressclass
  tls:
    - hosts:
        - shop.example.com
      secretName: shop-tls           # a kubernetes.io/tls Secret
  rules:
    - host: shop.example.com
      http:
        paths:
          - path: /api
            pathType: Prefix         # /api and /api/..., not /apix
            backend:
              service:
                name: api
                port:
                  number: 80
          - path: /
            pathType: Prefix
            backend:
              service:
                name: web
                port:
                  number: 80
$ kubectl create secret tls shop-tls --cert=tls.crt --key=tls.key
$ kubectl get ingress shop                  # ADDRESS column = controller's IP
$ curl -H "Host: shop.example.com" http://<address>/api/health   # test before DNS exists

The longest matching path wins, so /api/health goes to api and everything else to web. pathType can be Prefix, Exact or ImplementationSpecific.

The widely used community controller ingress-nginx was retired by the Kubernetes project in March 2026: no more releases or security fixes. Existing installs keep working, but new clusters should choose another controller. The newer Gateway API is the long-term successor to Ingress and is worth learning next.

kubectl port-forward

For quick access from your laptop without exposing anything:

$ kubectl port-forward svc/web 8080:80         # localhost:8080 -> Service port 80
$ kubectl port-forward pod/web-7c9d8f6b5-x2kq9 9229:9229   # e.g. a debugger port

It connects to a single pod behind the Service (no load balancing) and stops when you press Ctrl+C. Great for debugging, never for real traffic.

NetworkPolicy: a firewall for pods

By default any pod can reach any other pod. A NetworkPolicy restricts that. Once a pod is selected by a policy for Ingress, everything not explicitly allowed is denied. This lets only the web pods reach the database:

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: db-allow-web
spec:
  podSelector:
    matchLabels:
      app: db                  # the pods being protected
  policyTypes:
    - Ingress
  ingress:
    - from:
        - podSelector:
            matchLabels:
              app: web
      ports:
        - protocol: TCP
          port: 5432

Policies are enforced by the CNI plugin. Calico and Cilium do; plain Flannel doesn't, and there the policy is silently ignored.

Questions

Pick an answer. Get it wrong and you can try again right away, no waiting. 10 questions per topic - pick a filter below, then use Recreate questions for a fresh set on that topic.

Fresh questions every time

Exam

A mixed test across the whole site, shuffled so you never know which topic comes next. When you submit, every mistake comes with the reason and a jump to the exact moment in the video that explains it.

30 questions 6 topics 20 minute limit Up to 70 XP
1–4 answer · ←→ move
History

Essay

0 / 200-250 words
Sample answer
History
0:00 / 0:00
Not started

on YouTube
Subscribe

Topic progress

Activity

Achievements

Settings

Your profile and your account.

Profile details

* Required. Saved in this browser until you sign in.

Letters, numbers, dots, dashes and underscores.
0 / 160

Account

Checking…

App

Install Stackwise on your phone or computer. It opens in its own window from your home screen, and the Docs and cheat sheets you've opened keep working without internet.

Only admins can see this

Dashboard

Sign-ups, activity, messages and reviews in one place.

Prove it

Certificates

Pass a topic's test and get a certificate with its own public page you can share or add to LinkedIn. Each test is 10 questions drawn at random and graded on the server; you need 8 right, you have 15 minutes, and you get one try per topic a day.

From first command to production

Linux for DevOps

A path through Linux the way DevOps engineers use it: ten stages, every command explained with its flags, examples, real output and mistakes, the combinations engineers chain together, and incidents worked through step by step. Practise everything in a safe lab folder.

Before the interview

Interview prep

Questions that come up in real DevOps interviews, with the kind of answer that lands. Say yours out loud first, then compare. Each one links to the chapter that goes deeper.

    Private to you

    My notes

    Everything you wrote down while watching and reading, in one place. Saved to your account, never shown to anyone.