A bash file was created with two kubectl commands


networkandcode@k8s-master:~ ls
README.md  script2.sh

networkandcode@k8s-master:~ cat script2.sh
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/mandatory.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/cloud-generic.yaml

Provide execute permission to the file


networkandcode@k8s-master:~ chmod +x script2.sh

Execute the file


networkandcode@k8s-master:~ ./script2.sh

Verify


networkandcode@k8s-master:~ kubectl get all -n ingress-nginx
NAME                                            READY   STATUS    RESTARTS   AGE
pod/nginx-ingress-controller-79f6884cf6-xk66q   1/1     Running   0          5h48m
NAME                    TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)                      AGE
service/ingress-nginx   LoadBalancer   10.110.235.104        80:30348/TCP,443:31192/TCP   5h48m
NAME                                       READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/nginx-ingress-controller   1/1     1            1           5h48m
NAME                                                  DESIRED   CURRENT   READY   AGE
replicaset.apps/nginx-ingress-controller-79f6884cf6   1         1         1       5h48m

--end-of-post--