diff --git a/.circleci/config.yml b/.circleci/config.yml index 9edd634..06a3705 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,10 +19,10 @@ jobs: - setup_remote_docker: {docker_layer_caching: true} - run: name: Login to the registry - command: echo $REGISTRY_PASSWORD | docker login --username $REGISTRY_USERNAME --password-stdin + command: '[[ -z "${CIRCLE_PR_NUMBER}" ]] && (echo $REGISTRY_PASSWORD | docker login --username $REGISTRY_USERNAME --password-stdin)' - run: name: Build and push the image to the registry with Skaffold - command: skaffold build --profile=production + command: '[[ -z "${CIRCLE_PR_NUMBER}" ]] && skaffold build --profile=production' workflows: version: 2 diff --git a/deploy/skaffold/deployment.yaml b/deploy/skaffold/dev/deployment.yaml similarity index 100% rename from deploy/skaffold/deployment.yaml rename to deploy/skaffold/dev/deployment.yaml diff --git a/deploy/skaffold/production/deployment.yaml b/deploy/skaffold/production/deployment.yaml new file mode 100644 index 0000000..3d41e32 --- /dev/null +++ b/deploy/skaffold/production/deployment.yaml @@ -0,0 +1,48 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: podinfo + labels: + app: podinfo +spec: + replicas: 1 + selector: + matchLabels: + app: podinfo + template: + metadata: + labels: + app: podinfo + annotations: + prometheus.io/scrape: 'true' + spec: + containers: + - name: podinfod + image: stefanprodan/podinfo + command: + - ./podinfo + - -port=9898 + - -debug=true + ports: + - name: http + containerPort: 9898 + protocol: TCP + readinessProbe: + httpGet: + path: /readyz + port: 9898 + initialDelaySeconds: 1 + periodSeconds: 5 + failureThreshold: 1 + livenessProbe: + httpGet: + path: /healthz + port: 9898 + initialDelaySeconds: 1 + periodSeconds: 10 + failureThreshold: 2 + resources: + requests: + memory: "32Mi" + cpu: "10m"