a27dbe77447f283cdf3f9c10b1831087d675ff13.svn-base 951 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: register
  5. labels:
  6. name: register
  7. spec:
  8. selector:
  9. matchLabels:
  10. name: register
  11. replicas: 1
  12. template:
  13. metadata:
  14. name: register
  15. labels:
  16. name: register
  17. app: register
  18. spec:
  19. containers:
  20. - name: register
  21. image: register
  22. ports:
  23. - containerPort: 12312
  24. imagePullPolicy: IfNotPresent
  25. env:
  26. - name: consulAddr
  27. valueFrom:
  28. fieldRef:
  29. fieldPath: spec.nodeName
  30. - name: serviceAddr
  31. valueFrom:
  32. fieldRef:
  33. fieldPath: status.podIP
  34. ---
  35. apiVersion: v1
  36. kind: Service
  37. metadata:
  38. name: register-service
  39. labels:
  40. name: register-service
  41. spec:
  42. selector:
  43. name: register
  44. ports:
  45. - protocol: TCP
  46. port: 12312
  47. targetPort: 12312
  48. name: register-service-http