Skip to content

Latest commit

 

History

History
64 lines (45 loc) · 963 Bytes

File metadata and controls

64 lines (45 loc) · 963 Bytes

1

kubectl port-forward pod/nginx-deployment-66b6c48dd5-nqtdg 8080:80
# localhost:8080
kubectl delete deployment nginx-deployment

2

$ kubectl apply -f 2.yaml
$ kubectl get all

$ kubectl expose deployment hello-world --type=LoadBalancer
$ kubectl get service
or 
$ kubectl get svc

$ curl http://<loadbalancer-ingress-ip>:<target-port>

3

$ kubectl delete deployment hello-world
$ kubectl delete svc hello-world

4

The solution of the yaml is here 4.yaml.

$ kubectl apply -f 4.yaml
$ kubectl port-forward services/nginx-service 8080:80
$ kubectl delete -f 4.yaml

5

The solution of the yaml is here 5.yaml.

$ kubectl apply -f 5.yaml
$ kubectl delete -f 5.yaml

6

You can find the solution yaml here 6.yaml.

7

$ kubectl create configmap cm --from-file=7.txt

8

$ kubectl create configmap cm --from-literal=city=London
$ kubectl apply -f 8.yaml