deployment.yaml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: appname # Name of the deployment
  5. namespace: namespace # Name of the namespace
  6. labels:
  7. app: appname # Name of your application
  8. spec:
  9. selector:
  10. matchLabels:
  11. app: appname # Name of your application
  12. replicas: 1 # Number of replicas
  13. template:
  14. metadata:
  15. labels:
  16. app: appname # Name of your application
  17. spec:
  18. containers:
  19. # Containers are the individual pieces of your application that you want
  20. # to run.
  21. - name: helloworld # Name of the container
  22. image: helloworld:latest # The image you want to run
  23. # resources:
  24. # limits:
  25. # memory: 512Mi
  26. # cpu: "1"
  27. # requests:
  28. # memory: 256Mi
  29. # cpu: "0.2"
  30. ports:
  31. # Ports are the ports that your application uses.
  32. - containerPort: 8080 # The port that your application uses
  33. volumeMounts:
  34. # VolumeMounts are the volumes that your application uses.
  35. - mountPath: /var/www/html # The path that your application uses
  36. name: vol0 # Name of the volume
  37. volumes:
  38. # Volumes are the persistent storage that your application uses.
  39. - name: vol0 # Name of the volume
  40. persistentVolumeClaim:
  41. claimName: pvc0 # Name of the persistent volume claim