About Lesson
Networking Model:
-
Pod-to-Pod Communication:
-
Every Pod gets a unique IP.
-
Pods can communicate with each other directly within the cluster.
-
-
Service Networking:
-
Services provide stable endpoints for accessing Pods.
-
-
DNS:
-
Kubernetes provides an internal DNS service to resolve Service names to their cluster IPs.
-
-
Ingress:
-
Manages external HTTP/S access to Services.
-
Example Ingress YAML manifest:
apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: example-ingress spec: rules: - host: example.com http: paths: - path: / pathType: Prefix backend: service: name: my-service port: number: 80
-
-
Network Policies:
-
Define rules for traffic flow between Pods.
Example NetworkPolicy YAML manifest:
apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: allow-frontend spec: podSelector: matchLabels: app: frontend policyTypes: - Ingress ingress: - from: - podSelector: matchLabels: app: backend
-
Activity:
Deploy a sample Ingress resource to expose a Service externally. Test it by accessing the Service from a web browser or curl command.