deployment.yaml 877 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. apiVersion: v1
  2. kind: ConfigMap
  3. metadata:
  4. name: nginx-config
  5. data:
  6. nginx.conf: |
  7. your config
  8. comes here
  9. like this
  10. ---
  11. apiVersion: apps/v1
  12. kind: Deployment
  13. metadata:
  14. name: nginx-deployment
  15. spec:
  16. selector:
  17. matchLabels:
  18. app: nginx
  19. replicas: 1
  20. template:
  21. metadata:
  22. labels:
  23. app: nginx
  24. spec:
  25. containers:
  26. - name: nginx
  27. image: nginx:1.7.9
  28. ports:
  29. - containerPort: 80
  30. volumeMounts:
  31. - name: nginx-config
  32. mountPath: /etc/nginx/nginx.conf
  33. subPath: nginx.conff
  34. volumes:
  35. - name: nginx-config
  36. configMap:
  37. name: nginx-config
  38. ---
  39. apiVersion: v1
  40. kind: Service
  41. metadata:
  42. name: hue-balancer
  43. spec:
  44. type: NodePort
  45. # type: LoadBalancer
  46. selector:
  47. app: nginx
  48. ports:
  49. - protocol: TCP
  50. port: 80
  51. targetPort: 80