From 6485ab663722b80f0d1ef203461fdf9dcaf97705 Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 12 Nov 2019 21:33:01 +0000 Subject: [PATCH] fix helm env vars (#239) --- dragonchain/job_processor/contract_job.py | 4 +--- dragonchain/test_env.py | 1 - helm/dragonchain-k8s/templates/configmap.yaml | 4 +--- helm/dragonchain-k8s/templates/deployment.yaml | 12 ------------ 4 files changed, 2 insertions(+), 19 deletions(-) diff --git a/dragonchain/job_processor/contract_job.py b/dragonchain/job_processor/contract_job.py index a272c49d..a17d3aa3 100644 --- a/dragonchain/job_processor/contract_job.py +++ b/dragonchain/job_processor/contract_job.py @@ -265,10 +265,8 @@ def build_contract_image(self) -> None: self.model.set_state(state=self.end_error_state, msg="Docker build error") raise exceptions.BadImageError("Docker build error") - _log.info(f"Pushing to ECR {self.faas_image}") + _log.info(f"Pushing to docker registry {self.faas_image}") try: - # For on prem, the auth will need an abstraction layer so the customer can maintain a private registry for their contracts - # For now, we default to using ECR auth. This works in minikube as the localhost:5000 registry is unauthenticated, so auth_config gets ignored. self.docker.images.push(f"{FAAS_REGISTRY}/customer-contracts", tag=self.model.id, auth_config=registry_interface.get_login()) image = self.docker.images.get(self.faas_image) _log.debug(f"Built image attrs: {image.attrs}") diff --git a/dragonchain/test_env.py b/dragonchain/test_env.py index be4854ed..057010e4 100644 --- a/dragonchain/test_env.py +++ b/dragonchain/test_env.py @@ -22,7 +22,6 @@ os.environ["RATE_LIMIT"] = "0" os.environ["AWS_DEFAULT_REGION"] = "test" os.environ["ENCRYPTION"] = "secp256k1" -os.environ["STACK_NAME"] = "" os.environ["DRAGONCHAIN_VERSION"] = "" os.environ["STORAGE_TYPE"] = "s3" os.environ["STORAGE_LOCATION"] = "" diff --git a/helm/dragonchain-k8s/templates/configmap.yaml b/helm/dragonchain-k8s/templates/configmap.yaml index 8abc3008..cf1ca4f1 100644 --- a/helm/dragonchain-k8s/templates/configmap.yaml +++ b/helm/dragonchain-k8s/templates/configmap.yaml @@ -26,7 +26,6 @@ data: FAAS_GATEWAY: "{{ .Values.faas.gateway }}" FAAS_REGISTRY: "{{ .Values.faas.registry }}" NAMESPACE: "{{ .Release.Namespace }}" - STACK_NAME: "d-{{ .Values.global.environment.INTERNAL_ID }}-{{ .Values.global.environment.STAGE }}" DEPLOYMENT_NAME: "{{ .Release.Name }}" ERROR_REPORTING_TYPE: "{{ .Values.dragonchain.reporting_type }}" DRAGONCHAIN_NAME: "{{ .Values.global.environment.DRAGONCHAIN_NAME }}" @@ -40,8 +39,7 @@ data: REGISTRY_USERNAME: "{{ .Values.faas.registry_username }}" {{- end }} STORAGE_TYPE: disk - SECRET_TYPE: env - SECRET_LOCATION: SECRETSTRING + SECRET_LOCATION: "{{ .Values.secret.mountPath }}/{{ .Values.secret.name }}" DRAGONCHAIN_IMAGE: "{{ .Values.dragonchain.image.value }}:{{ .Values.dragonchain.image.version }}" {{ toYaml .Values.global.environment | indent 2 }} --- diff --git a/helm/dragonchain-k8s/templates/deployment.yaml b/helm/dragonchain-k8s/templates/deployment.yaml index 64b140c8..912efde3 100644 --- a/helm/dragonchain-k8s/templates/deployment.yaml +++ b/helm/dragonchain-k8s/templates/deployment.yaml @@ -87,8 +87,6 @@ spec: env: - name: SERVICE value: webserver - - name: SECRET_LOCATION - value: "{{ .Values.secret.mountPath }}/{{ .Values.secret.name }}" volumeMounts: - name: secrets mountPath: {{ .Values.secret.mountPath }} @@ -185,8 +183,6 @@ spec: env: - name: SERVICE value: txprocessor - - name: SECRET_LOCATION - value: "{{ .Values.secret.mountPath }}/{{ .Values.secret.name }}" volumeMounts: - name: secrets mountPath: {{ .Values.secret.mountPath }} @@ -264,8 +260,6 @@ spec: env: - name: SERVICE value: contractInvoker - - name: SECRET_LOCATION - value: "{{ .Values.secret.mountPath }}/{{ .Values.secret.name }}" volumeMounts: - name: secrets mountPath: {{ .Values.secret.mountPath }} @@ -345,8 +339,6 @@ spec: env: - name: SERVICE value: jobprocessor - - name: SECRET_LOCATION - value: "{{ .Values.secret.mountPath }}/{{ .Values.secret.name }}" volumeMounts: - name: secrets mountPath: {{ .Values.secret.mountPath }} @@ -424,8 +416,6 @@ spec: env: - name: SERVICE value: bcprocessor - - name: SECRET_LOCATION - value: "{{ .Values.secret.mountPath }}/{{ .Values.secret.name }}" volumeMounts: - name: secrets mountPath: {{ .Values.secret.mountPath }} @@ -503,8 +493,6 @@ spec: env: - name: SERVICE value: scheduler - - name: SECRET_LOCATION - value: "{{ .Values.secret.mountPath }}/{{ .Values.secret.name }}" volumeMounts: - name: secrets mountPath: {{ .Values.secret.mountPath }}