kubernetes.yaml 974 Bytes
Newer Older
Jørn Åne de Jong's avatar
Jørn Åne de Jong committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: $CI_ENVIRONMENT_SLUG
  namespace: $KUBE_NAMESPACE
  labels:
    app: $CI_ENVIRONMENT_SLUG
    pipeline_id: "$CI_PIPELINE_ID"
    build_id: "$CI_BUILD_ID"
spec:
  replicas: $REPLICAS
  template:
    metadata:
      labels:
        name: $CI_ENVIRONMENT_SLUG
        app: $CI_ENVIRONMENT_SLUG
    spec:
      containers:
      - name: app
        image: $CI_REGISTRY_IMAGE:$CI_REGISTRY_TAG
        imagePullPolicy: Always
        resources:
          limits:
            memory: 500Mi
          requests:
            memory: 300Mi
        ports:
        - name: web
          containerPort: $HTTP_PORT
        livenessProbe:
          httpGet:
            path: /
            port: $HTTP_PORT
          initialDelaySeconds: 15
          timeoutSeconds: 15
        readinessProbe:
          httpGet:
            path: /
            port: $HTTP_PORT
          initialDelaySeconds: 5
          timeoutSeconds: 15