kubectl exec --stdin --tty pod/alpine-linux-5d5f994b84-lslvx -- /bin/sh
kubectl exec learn-pod -it sh
kubectl port-forward pod/.... 8080:80
kubectl port-forward deployment/.... 8080:80
kubectl create deployment nginx --image=nginx:alpine --dry-run=client -o yaml > kubectl-created.yaml
| Content of File | Explanation |
|---|---|
| apiVersion: v1 | k8s API version |
| kind: Service | resource type (Service) |
| metadata: | Metadata about the servcie |
| spec: | |
| type: | Type of service (ClusterIP, NodePort, LoadBalancer) Default to ClusterIP |
| selector: | Select pod template label(s) that service will apply to |
| ports: | Define container target port and the port for the service |