From 393c43429bd5c7d36982f08fa497a06fb7d17e94 Mon Sep 17 00:00:00 2001 From: Future Outlier Date: Sun, 15 Oct 2023 15:46:43 +0800 Subject: [PATCH] add-agent-default-minio-env Signed-off-by: Future Outlier --- charts/flyteagent/README.md | 2 +- .../templates/agent/deployment.yaml | 32 ++++++++++++++----- charts/flyteagent/values.yaml | 3 ++ .../agent/flyte_agent_helm_generated.yaml | 3 ++ .../manifests/complete-agent.yaml | 7 ++-- .../sandbox-bundled/manifests/complete.yaml | 4 +-- docker/sandbox-bundled/manifests/dev.yaml | 4 +-- 7 files changed, 40 insertions(+), 15 deletions(-) diff --git a/charts/flyteagent/README.md b/charts/flyteagent/README.md index c45f994816..31a0d0e04e 100644 --- a/charts/flyteagent/README.md +++ b/charts/flyteagent/README.md @@ -12,7 +12,7 @@ A Helm chart for Flyte agent | additionalVolumeMounts | list | `[]` | Appends additional volume mounts to the main container's spec. May include template values. | | additionalVolumes | list | `[]` | Appends additional volumes to the deployment spec. May include template values. | | affinity | object | `{}` | affinity for flyteagent deployment | -| agentSecret.secretData | object | `{"data":{"username":"User"}}` | Specify your Secret (with sensitive data) or pseudo-manifest (without sensitive data). | +| agentSecret.secretData | object | `{"data":{"FLYTE_AWS_ACCESS_KEY_ID":"minio","FLYTE_AWS_ENDPOINT":"http://flyte-sandbox-minio.flyte:9000","FLYTE_AWS_SECRET_ACCESS_KEY":"miniostorage","username":"User"}}` | Specify your Secret (with sensitive data) or pseudo-manifest (without sensitive data). | | commonAnnotations | object | `{}` | | | commonLabels | object | `{}` | | | configPath | string | `"/etc/flyteagent/config/*.yaml"` | Default regex string for searching configuration files | diff --git a/charts/flyteagent/templates/agent/deployment.yaml b/charts/flyteagent/templates/agent/deployment.yaml index a8b7a3889e..f82fd0da7d 100644 --- a/charts/flyteagent/templates/agent/deployment.yaml +++ b/charts/flyteagent/templates/agent/deployment.yaml @@ -26,28 +26,44 @@ spec: image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: "{{ .Values.image.pullPolicy }}" name: flyteagent - volumeMounts: {{- include "agentSecret.volumeMount" . | nindent 8 }} ports: - containerPort: {{ .Values.ports.containerPort }} name: {{ .Values.ports.name }} resources: {{- toYaml .Values.resources | nindent 10 }} + env: + - name: FLYTE_AWS_ENDPOINT + valueFrom: + secretKeyRef: + name: {{ template "flyteagent.name" . }} + key: FLYTE_AWS_ENDPOINT + - name: FLYTE_AWS_ACCESS_KEY_ID + valueFrom: + secretKeyRef: + name: {{ template "flyteagent.name" . }} + key: FLYTE_AWS_ACCESS_KEY_ID + - name: FLYTE_AWS_SECRET_ACCESS_KEY + valueFrom: + secretKeyRef: + name: {{ template "flyteagent.name" . }} + key: FLYTE_AWS_SECRET_ACCESS_KEY + volumeMounts: {{- include "agentSecret.volumeMount" . | nindent 10 }} {{- with .Values.additionalVolumeMounts -}} - {{ tpl (toYaml .) $ | nindent 8 }} + {{ tpl (toYaml .) $ | nindent 10 }} {{- end }} {{- with .Values.additionalContainers -}} - {{- tpl (toYaml .) $ | nindent 6}} + {{- tpl (toYaml .) $ | nindent 8}} {{- end }} serviceAccountName: {{ template "flyteagent.name" . }} - volumes: {{- include "agentSecret.volume" . | nindent 6 }} + volumes: {{- include "agentSecret.volume" . | nindent 8 }} {{- with .Values.additionalVolumes -}} - {{ tpl (toYaml .) $ | nindent 6 }} + {{ tpl (toYaml .) $ | nindent 8 }} {{- end }} {{- with .Values.nodeSelector }} - nodeSelector: {{ tpl (toYaml .) $ | nindent 8 }} + nodeSelector: {{ tpl (toYaml .) $ | nindent 10 }} {{- end }} {{- with .Values.affinity }} - affinity: {{ tpl (toYaml .) $ | nindent 8 }} + affinity: {{ tpl (toYaml .) $ | nindent 10 }} {{- end }} {{- with .Values.tolerations }} - tolerations: {{ tpl (toYaml .) $ | nindent 8 }} + tolerations: {{ tpl (toYaml .) $ | nindent 10 }} {{- end }} diff --git a/charts/flyteagent/values.yaml b/charts/flyteagent/values.yaml index 8a40180e45..9379a33c5e 100755 --- a/charts/flyteagent/values.yaml +++ b/charts/flyteagent/values.yaml @@ -16,6 +16,9 @@ agentSecret: secretData: data: username: User + FLYTE_AWS_ENDPOINT: http://flyte-sandbox-minio.flyte:9000 + FLYTE_AWS_ACCESS_KEY_ID: minio + FLYTE_AWS_SECRET_ACCESS_KEY: miniostorage # -- Replicas count for flyteagent deployment replicaCount: 1 diff --git a/deployment/agent/flyte_agent_helm_generated.yaml b/deployment/agent/flyte_agent_helm_generated.yaml index 89f3835892..b7e735fdd4 100644 --- a/deployment/agent/flyte_agent_helm_generated.yaml +++ b/deployment/agent/flyte_agent_helm_generated.yaml @@ -19,6 +19,9 @@ metadata: namespace: flyte type: Opaque data: + FLYTE_AWS_ACCESS_KEY_ID: minio + FLYTE_AWS_ENDPOINT: http://flyte-sandbox-minio.flyte:9000 + FLYTE_AWS_SECRET_ACCESS_KEY: miniostorage username: User --- # Source: flyteagent/templates/agent/service.yaml diff --git a/docker/sandbox-bundled/manifests/complete-agent.yaml b/docker/sandbox-bundled/manifests/complete-agent.yaml index b18c5ac84e..848812bff7 100644 --- a/docker/sandbox-bundled/manifests/complete-agent.yaml +++ b/docker/sandbox-bundled/manifests/complete-agent.yaml @@ -816,7 +816,7 @@ type: Opaque --- apiVersion: v1 data: - haSharedSecret: R2JRWFVRYThnRFVLbHpuSA== + haSharedSecret: Wk9VRzZ1a1BjNDk3MHlteQ== proxyPassword: "" proxyUsername: "" kind: Secret @@ -874,6 +874,9 @@ type: Opaque --- apiVersion: v1 data: + FLYTE_AWS_ACCESS_KEY_ID: minio + FLYTE_AWS_ENDPOINT: http://flyte-sandbox-minio.flyte:9000 + FLYTE_AWS_SECRET_ACCESS_KEY: miniostorage username: User kind: Secret metadata: @@ -1409,7 +1412,7 @@ spec: metadata: annotations: checksum/config: 8f50e768255a87f078ba8b9879a0c174c3e045ffb46ac8723d2eedbe293c8d81 - checksum/secret: 0ee1553aec7c03152a0a44e7b1a82985795774412a779f7b607a57e59f42c8ef + checksum/secret: 4683cf4a765862d5c9e0d509cfbcc2cc90991ddf90bf6a23ef9d81d1fd3f4687 labels: app: docker-registry release: flyte-sandbox diff --git a/docker/sandbox-bundled/manifests/complete.yaml b/docker/sandbox-bundled/manifests/complete.yaml index d7f6e8b0cc..7433ce29e8 100644 --- a/docker/sandbox-bundled/manifests/complete.yaml +++ b/docker/sandbox-bundled/manifests/complete.yaml @@ -805,7 +805,7 @@ type: Opaque --- apiVersion: v1 data: - haSharedSecret: d1l6eWRCOXBJcFhiNEo5QQ== + haSharedSecret: ZWNvaDR4SFpTWEljYmpKdw== proxyPassword: "" proxyUsername: "" kind: Secret @@ -1366,7 +1366,7 @@ spec: metadata: annotations: checksum/config: 8f50e768255a87f078ba8b9879a0c174c3e045ffb46ac8723d2eedbe293c8d81 - checksum/secret: 2f5b6d46fd3276b5b25c8a537298beb6943b13b0b21900db8b2da23e166f0593 + checksum/secret: b309ba8b2b4bd6f3ef7d57302a4273efa0caaf58aef9c292f6a27a9107fbba80 labels: app: docker-registry release: flyte-sandbox diff --git a/docker/sandbox-bundled/manifests/dev.yaml b/docker/sandbox-bundled/manifests/dev.yaml index 4f3f0592e8..2824758cd2 100644 --- a/docker/sandbox-bundled/manifests/dev.yaml +++ b/docker/sandbox-bundled/manifests/dev.yaml @@ -499,7 +499,7 @@ metadata: --- apiVersion: v1 data: - haSharedSecret: UkFsUVRMRndZeTNJUVNFSA== + haSharedSecret: dGpvMnBNMlZ1QnhOS1c0Tg== proxyPassword: "" proxyUsername: "" kind: Secret @@ -933,7 +933,7 @@ spec: metadata: annotations: checksum/config: 8f50e768255a87f078ba8b9879a0c174c3e045ffb46ac8723d2eedbe293c8d81 - checksum/secret: 25a046ef1aaf34ffb59f7b92554e1cfd0015b9a11f7f165ce06bba31e3bced1b + checksum/secret: 0a47ea847e68c844e9b427914d1dc1a2d74e9d8e8716f05365a5ad55d3e95272 labels: app: docker-registry release: flyte-sandbox