Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. # api version of the kubernetes : apps/v1 -current stable
  2. apiVersion: apps/v1
  3.  
  4.  
  5. # Kind describes the type of the object/resource to be created.
  6. # Supported kind are :
  7. ### componentstatuses
  8. ### configmaps
  9. ### daemonsets
  10. ### deployments
  11. ### events
  12. ### endpoints
  13. ### horizontalpodautoscalers
  14. ### ingress
  15. ### jobs
  16. ### limitranges
  17. ### namespaces
  18. ### nodes
  19. ### pods
  20. ### persistentvolumes
  21. ### persistentvolumeclaims
  22. ### resourcequotas
  23. ### replicasets
  24. ### replicationcontrollers
  25. ### serviceaccounts
  26. ### services
  27. kind: Deployment
  28. # Set of data to uniquely identify K8 objects
  29. # It takes:
  30. # labels
  31. # name
  32. # namespace
  33. # annotations
  34. metadata:
  35. name: nginx-deployment #Name of the deployment created
  36. # Key-value pairs primarily used to group and categorize deployment object.
  37. # It is intended for an object to object grouping and mapping using selectors.
  38. # kubernetes service uses the pod labels in its selectors to send traffic to the right pods.
  39. labels:
  40. app: nginx
  41. # declare the desired state and characteristics of the object we want to have
  42. # Spec has three important subfields:
  43. ## replicas
  44. ## selector
  45. ## template
  46. spec:
  47. # replicas - It will make sure the numbers of pods running all the time for the deployment
  48. replicas: 3
  49. # Selector - It defines the labels that match the pods for the deployments to manage.
  50. selector:
  51. matchLabels:
  52. app: nginx
  53. # Template - It has its own metadata and spec. Spec will have all the container information a pod should have.
  54. # Container image info, port information, ENV variables, command arguments etc.
  55. template:
  56. metadata:
  57. labels:
  58. app: nginx
  59. spec:
  60. containers:
  61. - name: nginx
  62. image: nginx:1.7.9
  63. ports:
  64. - containerPort: 80
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement