Hello here! One of the things I am struggling with when I am asked to create ing . . .

Sudi Krishnakumar:
Hello here! One of the things I am struggling with when I am asked to create ingress is that I fail to remember the exact yaml key entries. What is the best way to go about it ?
• I know that it is possible to refer to Kubernetes documentation during the exam, but it can consume time and put unwanted pressure.
• Some other bloggers suggest that we can use the explain command to figure out the keys, but I am really not sure how efficient this approach is
• Hand coding yaml is not a great option as this means that I have to remember each and every entry by heart and also avoid any formatting issues
• Is it possible to create ingress using an imperative command to an extent where I can export it to a yaml using dry-run and -o yaml?
Please could someone suggest how one should go about remembering the yaml entries? Thanks!

Al West:
so you could use kubectl create ingress

Sudi Krishnakumar:
When we use kubectl create ingress it enforces us to specify the host though. In cases where we do not want to specify host, (for e.g. path based routing) how would that command work?

unnivkn:
Hi @Sudi Krishnakumar please try this and remove any unwanted entries from the yaml file. You may try to do a comparison with k8s docs & make sure what is needed as per your requirement. kubectl explain also one of the good approach. You have to practice that well & understand what are the minimal entries needed for you.
fyr: https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#-em-ingress-em-
image.png

unnivkn:
kubectl explain fyr:




Kubectl-Explain-Ing-4.PNG

Sudi Krishnakumar:
This is brilliant! Thanks a ton @unnivkn