Welcome to the Linux Foundation Forum!

LFS258 - Install Kubernetes Lab 3.4 -- Deploy Web app

Serious Question why use this command
kubectl get deployments nginx --export -o yaml

when you KNOW its going to spit out a ton of garbage that you are going to have to edit.

One quick google search and I landed over at the Kubernetes docs page and they provided something that looks a WHOLE lot familiar.

  1. apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
  2. kind: Deployment
  3. metadata:
  4. name: nginx-deployment
  5. spec:
  6. selector:
  7. matchLabels:
  8. app: nginx
  9. replicas: 2 # tells deployment to run 2 pods matching the template
  10. template:
  11. metadata:
  12. labels:
  13. app: nginx
  14. spec:
  15. containers:
  16. - name: nginx
  17. image: nginx:1.14.2
  18. ports:
  19. - containerPort: 80

Writing up your own yaml is more up a developer workflow and is the same approach Nigel Poulton uses in his book and his acloudguru class "Kubernetes Deep Dive"

I pretty much threw up my hands in frustration trying to follow the tiny lab text and the instructions that are all over with poor examples of end states and just wrote up a nginx.yaml file that
a) I can read
b) is minimalistic
c) Other people can read

I just want to know the WHY.

Comments

  • Posts: 1,000

    Hello,

    Thank you for your thoughtful response. I will make sure it gets all the attention it deserves.

    Regards,

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training