diff --git a/.github/workflows/operator-integration-test.yml b/.github/workflows/operator-integration-test.yml index 9a23a2013..c76b09c2e 100644 --- a/.github/workflows/operator-integration-test.yml +++ b/.github/workflows/operator-integration-test.yml @@ -283,7 +283,7 @@ jobs: # password_hashed: true # roles: ["developer", "viewer"] - username: "admin" - password: "admin" + password: "" password_hashed: false roles: ["admin"] # Server configuration @@ -591,6 +591,8 @@ jobs: labels: {} controller: + auth: + adminPassword: "admin" image: repository: localhost/gateway-controller tag: test @@ -681,6 +683,9 @@ jobs: replicaCount: 1 volumeMountPath: /app/data extraEnv: [] + extraEnvFrom: + - secretRef: + name: '{{ include "gateway-operator.fullname" . }}-controller-auth' env: xdsServerAddress: "" extraVolumeMounts: [] diff --git a/kubernetes/helm/gateway-helm-chart/templates/gateway/controller/deployment.yaml b/kubernetes/helm/gateway-helm-chart/templates/gateway/controller/deployment.yaml index 6d106d4b8..561dbc793 100644 --- a/kubernetes/helm/gateway-helm-chart/templates/gateway/controller/deployment.yaml +++ b/kubernetes/helm/gateway-helm-chart/templates/gateway/controller/deployment.yaml @@ -92,10 +92,10 @@ spec: {{- range $deployment.extraEnv }} - {{- toYaml . | nindent 14 }} {{- end }} - {{- with $deployment.extraEnvFrom }} + {{- with $deployment.extraEnvFrom }} envFrom: - {{- toYaml . | nindent 12 }} - {{- end }} + {{- tpl (toYaml .) $ | nindent 12 }} + {{- end }} ports: - name: rest containerPort: {{ $controller.service.ports.rest }} diff --git a/kubernetes/helm/gateway-helm-chart/templates/gateway/controller/secret.yaml b/kubernetes/helm/gateway-helm-chart/templates/gateway/controller/secret.yaml new file mode 100644 index 000000000..ed68993cd --- /dev/null +++ b/kubernetes/helm/gateway-helm-chart/templates/gateway/controller/secret.yaml @@ -0,0 +1,11 @@ +{{- if .Values.gateway.controller.auth.adminPassword }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "gateway-operator.fullname" . }}-controller-auth + labels: + {{- include "gateway-operator.componentLabels" (list . "controller" (dict)) | nindent 4 }} +type: Opaque +stringData: + GATEWAY_GATEWAY__CONTROLLER_AUTH_BASIC_USERS_0_PASSWORD: {{ .Values.gateway.controller.auth.adminPassword | quote }} +{{- end }} diff --git a/kubernetes/helm/gateway-helm-chart/values.yaml b/kubernetes/helm/gateway-helm-chart/values.yaml index c7e72d1db..641ff4ea7 100644 --- a/kubernetes/helm/gateway-helm-chart/values.yaml +++ b/kubernetes/helm/gateway-helm-chart/values.yaml @@ -28,7 +28,7 @@ gateway: enabled: true users: - username: "admin" - password: "admin" + password: "" password_hashed: false roles: ["admin"] idp: @@ -310,6 +310,8 @@ gateway: labels: {} controller: + auth: + adminPassword: "admin" image: repository: ghcr.io/wso2/api-platform/gateway-controller tag: "0.2.0" @@ -403,7 +405,9 @@ gateway: # extraEnvFrom: # - secretRef: # name: my-secret - extraEnvFrom: [] + extraEnvFrom: + - secretRef: + name: '{{ include "gateway-operator.fullname" . }}-controller-auth' env: xdsServerAddress: "" extraVolumeMounts: [] diff --git a/kubernetes/helm/operator-helm-chart/values.yaml b/kubernetes/helm/operator-helm-chart/values.yaml index df4c79da2..69ba69d32 100644 --- a/kubernetes/helm/operator-helm-chart/values.yaml +++ b/kubernetes/helm/operator-helm-chart/values.yaml @@ -94,7 +94,7 @@ gateway: enabled: true users: - username: "admin" - password: "admin" + password: "" password_hashed: false roles: ["admin"] # Server configuration @@ -368,6 +368,8 @@ gateway: labels: {} controller: + auth: + adminPassword: "admin" image: repository: ghcr.io/wso2/api-platform/gateway-controller tag: "0.2.0" @@ -458,6 +460,12 @@ gateway: replicaCount: 1 volumeMountPath: /app/data extraEnv: [] + # extraEnvFrom: + # - secretRef: + # name: my-secret + extraEnvFrom: + - secretRef: + name: '{{ include "gateway-operator.fullname" . }}-controller-auth' env: xdsServerAddress: "" extraVolumeMounts: []