deployment.template.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. ---
  2. apiVersion: v1
  3. data:
  4. # AZURE_DOCKER_REGISTRY_CONFIG is base64 of this:
  5. # {"auths":{"parity.azurecr.io":{"username":"parity","password":"<password>","email":"admin@parity.io","auth":"<base64 of user+passwoed>"}}}
  6. .dockerconfigjson: $AZURE_DOCKER_REGISTRY_CONFIG
  7. kind: Secret
  8. metadata:
  9. name: azure-docker-registry-key
  10. type: kubernetes.io/dockerconfigjson
  11. ---
  12. apiVersion: extensions/v1beta1
  13. kind: Deployment
  14. metadata:
  15. name: $CI_ENVIRONMENT_SLUG-backend
  16. spec:
  17. replicas: $REPLICAS
  18. template:
  19. metadata:
  20. labels:
  21. app: $CI_ENVIRONMENT_SLUG
  22. component: backend
  23. spec:
  24. containers:
  25. - name: $CI_ENVIRONMENT_SLUG-backend
  26. image: $DOCKER_IMAGE_FULL_NAME
  27. imagePullPolicy: Always
  28. ports:
  29. - containerPort: 80
  30. imagePullSecrets:
  31. - name: azure-docker-registry-key
  32. ---
  33. apiVersion: v1
  34. kind: Service
  35. metadata:
  36. name: $CI_ENVIRONMENT_SLUG-service
  37. spec:
  38. selector:
  39. app: $CI_ENVIRONMENT_SLUG
  40. ports:
  41. - name: http
  42. port: 80
  43. targetPort: 80
  44. protocol: TCP
  45. ---
  46. apiVersion: extensions/v1beta1
  47. kind: Ingress
  48. metadata:
  49. name: $CI_ENVIRONMENT_SLUG-ingress
  50. annotations:
  51. kubernetes.io/ingress.class: traefik
  52. traefik.frontend.entryPoints: "https,http"
  53. spec:
  54. rules:
  55. - host: $AUTODEVOPS_HOST
  56. http:
  57. paths:
  58. - backend:
  59. serviceName: $CI_ENVIRONMENT_SLUG-service
  60. servicePort: 80