In this video I want to show you how you can manage your resources in Kubernetes both by imperative and declarative approach. The content and case used in the examples are intended for beginners.
I will create a simple deployment and expose it to outside world first via imperative commands, and later do the same with declarative commands.
If you want to learn more about Kubernetes Object Management check out this article: kubernetes.io/...
The 'trick' I mentioned for generating the yaml files is to 'dry-run' the command, for example
1) This command will create a deployment with nginx image:
$ kubectl create deployment nginx --image nginx
2) This command will only print the yaml on screen, with no execution:
$ kubectl create deployment nginx --image nginx --dry-run=client -o yaml
By the way, there are more and more interactive Kubernetes playgrounds online, just google it :) In my example I used Google Cloud, which is always a good option as well.
Негізгі бет Kubernetes - imperative vs declarative! kubectl for beginners
Пікірлер: 7