charts cleanup: (#1360)
- move authsign secret to signer and make port configurable - rename storages to more general ops-configs - put 'storages.json' path into env var - rename backend secret to backend-auth - cronjobs: don't keep succeeded jobs around, triggers operator update
This commit is contained in:
		
							parent
							
								
									e4660dd010
								
							
						
					
					
						commit
						ff10124d01
					
				| @ -78,7 +78,7 @@ class StorageOps: | |||||||
| 
 | 
 | ||||||
|         self.is_local_minio = is_bool(os.environ.get("IS_LOCAL_MINIO")) |         self.is_local_minio = is_bool(os.environ.get("IS_LOCAL_MINIO")) | ||||||
| 
 | 
 | ||||||
|         with open("/tmp/storages/storages.json", encoding="utf-8") as fh: |         with open(os.environ["STORAGES_JSON"], encoding="utf-8") as fh: | ||||||
|             storage_list = json.loads(fh.read()) |             storage_list = json.loads(fh.read()) | ||||||
| 
 | 
 | ||||||
|         for storage in storage_list: |         for storage in storage_list: | ||||||
|  | |||||||
| @ -8,7 +8,7 @@ metadata: | |||||||
| 
 | 
 | ||||||
| spec: | spec: | ||||||
|   concurrencyPolicy: Forbid |   concurrencyPolicy: Forbid | ||||||
|   successfulJobsHistoryLimit: 2 |   successfulJobsHistoryLimit: 0 | ||||||
|   failedJobsHistoryLimit: 2 |   failedJobsHistoryLimit: 2 | ||||||
| 
 | 
 | ||||||
|   schedule: "{{ schedule }}" |   schedule: "{{ schedule }}" | ||||||
|  | |||||||
| @ -37,9 +37,9 @@ spec: | |||||||
|               - key: config.yaml |               - key: config.yaml | ||||||
|                 path: config.yaml |                 path: config.yaml | ||||||
| 
 | 
 | ||||||
|         - name: storages |         - name: ops-configs | ||||||
|           secret: |           secret: | ||||||
|             secretName: storages |             secretName: ops-configs | ||||||
| 
 | 
 | ||||||
|         - name: app-templates |         - name: app-templates | ||||||
|           configMap: |           configMap: | ||||||
| @ -51,9 +51,9 @@ spec: | |||||||
|           imagePullPolicy: {{ .Values.backend_pull_policy }} |           imagePullPolicy: {{ .Values.backend_pull_policy }} | ||||||
|           envFrom: |           envFrom: | ||||||
|             - configMapRef: |             - configMapRef: | ||||||
|                 name: {{ .Values.name }}-env-config |                 name: backend-env-config | ||||||
|             - secretRef: |             - secretRef: | ||||||
|                 name: auth-secrets |                 name: backend-auth | ||||||
|             - secretRef: |             - secretRef: | ||||||
|                 name: mongo-auth |                 name: mongo-auth | ||||||
| 
 | 
 | ||||||
| @ -62,8 +62,8 @@ spec: | |||||||
|               value: "{{ .Values.backend_workers | default 4 }}" |               value: "{{ .Values.backend_workers | default 4 }}" | ||||||
| 
 | 
 | ||||||
|           volumeMounts: |           volumeMounts: | ||||||
|             - name: storages |             - name: ops-configs | ||||||
|               mountPath: /tmp/storages/ |               mountPath: /ops-configs/ | ||||||
| 
 | 
 | ||||||
|             - name: app-templates |             - name: app-templates | ||||||
|               mountPath: /app/btrixcloud/templates/ |               mountPath: /app/btrixcloud/templates/ | ||||||
| @ -119,9 +119,9 @@ spec: | |||||||
| 
 | 
 | ||||||
|           envFrom: |           envFrom: | ||||||
|             - configMapRef: |             - configMapRef: | ||||||
|                 name: {{ .Values.name }}-env-config |                 name: backend-env-config | ||||||
|             - secretRef: |             - secretRef: | ||||||
|                 name: auth-secrets |                 name: backend-auth | ||||||
|             - secretRef: |             - secretRef: | ||||||
|                 name: mongo-auth |                 name: mongo-auth | ||||||
| 
 | 
 | ||||||
| @ -133,8 +133,8 @@ spec: | |||||||
|             - name: config-volume |             - name: config-volume | ||||||
|               mountPath: /config |               mountPath: /config | ||||||
| 
 | 
 | ||||||
|             - name: storages |             - name: ops-configs | ||||||
|               mountPath: /tmp/storages/ |               mountPath: /ops-configs/ | ||||||
| 
 | 
 | ||||||
|             - name: app-templates |             - name: app-templates | ||||||
|               mountPath: /app/btrixcloud/templates/ |               mountPath: /app/btrixcloud/templates/ | ||||||
|  | |||||||
| @ -2,7 +2,7 @@ | |||||||
| apiVersion: v1 | apiVersion: v1 | ||||||
| kind: ConfigMap | kind: ConfigMap | ||||||
| metadata: | metadata: | ||||||
|   name: {{ .Values.name }}-env-config |   name: backend-env-config | ||||||
|   namespace: {{ .Release.Namespace }} |   namespace: {{ .Release.Namespace }} | ||||||
| 
 | 
 | ||||||
| data: | data: | ||||||
| @ -46,6 +46,8 @@ data: | |||||||
| 
 | 
 | ||||||
|   IS_LOCAL_MINIO: "{{ .Values.minio_local }}" |   IS_LOCAL_MINIO: "{{ .Values.minio_local }}" | ||||||
| 
 | 
 | ||||||
|  |   STORAGES_JSON: "/ops-configs/storages.json" | ||||||
|  | 
 | ||||||
| --- | --- | ||||||
| apiVersion: v1 | apiVersion: v1 | ||||||
| kind: ConfigMap | kind: ConfigMap | ||||||
| @ -110,7 +112,7 @@ data: | |||||||
|     crawler_node_type: "{{ .Values.crawler_node_type }}" |     crawler_node_type: "{{ .Values.crawler_node_type }}" | ||||||
|     redis_node_type: "{{ .Values.redis_node_type }}" |     redis_node_type: "{{ .Values.redis_node_type }}" | ||||||
| 
 | 
 | ||||||
|     signing_secret: {{ .Values.signer.enabled | ternary "signing-secret" "" }} |     signing_secret: {{ and .Values.signer.enabled (not (empty .Values.signer.auth_token)) | ternary "signing-secret" "" }} | ||||||
| 
 | 
 | ||||||
| --- | --- | ||||||
| apiVersion: v1 | apiVersion: v1 | ||||||
|  | |||||||
| @ -2,7 +2,7 @@ | |||||||
| apiVersion: v1 | apiVersion: v1 | ||||||
| kind: Secret | kind: Secret | ||||||
| metadata: | metadata: | ||||||
|   name: auth-secrets |   name: backend-auth | ||||||
|   namespace: {{ .Release.Namespace }} |   namespace: {{ .Release.Namespace }} | ||||||
| 
 | 
 | ||||||
| type: Opaque | type: Opaque | ||||||
| @ -19,11 +19,12 @@ stringData: | |||||||
|   SUPERUSER_EMAIL: "{{ .Values.superuser.email }}" |   SUPERUSER_EMAIL: "{{ .Values.superuser.email }}" | ||||||
|   SUPERUSER_PASSWORD: "{{ .Values.superuser.password }}" |   SUPERUSER_PASSWORD: "{{ .Values.superuser.password }}" | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
| --- | --- | ||||||
| apiVersion: v1 | apiVersion: v1 | ||||||
| kind: Secret | kind: Secret | ||||||
| metadata: | metadata: | ||||||
|   name: storages |   name: ops-configs | ||||||
|   namespace: {{ .Release.Namespace }} |   namespace: {{ .Release.Namespace }} | ||||||
| 
 | 
 | ||||||
| type: Opaque | type: Opaque | ||||||
| @ -31,21 +32,6 @@ data: | |||||||
|   storages.json: {{ .Values.storages | toJson | b64enc | quote }} |   storages.json: {{ .Values.storages | toJson | b64enc | quote }} | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| {{- if $.Values.signer.auth_token }} |  | ||||||
| --- |  | ||||||
| apiVersion: v1 |  | ||||||
| kind: Secret |  | ||||||
| metadata: |  | ||||||
|   name: signing-secret |  | ||||||
|   namespace: {{ $.Values.crawler_namespace }} |  | ||||||
| 
 |  | ||||||
| type: Opaque |  | ||||||
| stringData: |  | ||||||
|   WACZ_SIGN_URL: "http://auth-signer.{{ .Release.Namespace }}:5053/sign" |  | ||||||
|   WACZ_SIGN_TOKEN: "{{ $.Values.signer.auth_token }}" |  | ||||||
| {{- end }} |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| {{- range $storage := .Values.storages }} | {{- range $storage := .Values.storages }} | ||||||
| --- | --- | ||||||
| apiVersion: v1 | apiVersion: v1 | ||||||
|  | |||||||
| @ -1,5 +1,21 @@ | |||||||
| {{- if .Values.signer.enabled }} | {{- if .Values.signer.enabled }} | ||||||
| 
 | 
 | ||||||
|  | {{ $signer_port := default "5053" .Values.signer.port }} | ||||||
|  | 
 | ||||||
|  | {{- if .Values.signer.auth_token }} | ||||||
|  | --- | ||||||
|  | apiVersion: v1 | ||||||
|  | kind: Secret | ||||||
|  | metadata: | ||||||
|  |   name: signing-secret | ||||||
|  |   namespace: {{ .Values.crawler_namespace }} | ||||||
|  | 
 | ||||||
|  | type: Opaque | ||||||
|  | stringData: | ||||||
|  |   WACZ_SIGN_URL: "http://auth-signer.{{ .Release.Namespace }}:{{ $signer_port }}/sign" | ||||||
|  |   WACZ_SIGN_TOKEN: "{{ .Values.signer.auth_token }}" | ||||||
|  | {{- end }} | ||||||
|  | 
 | ||||||
| --- | --- | ||||||
| apiVersion: v1 | apiVersion: v1 | ||||||
| kind: Secret | kind: Secret | ||||||
| @ -95,7 +111,7 @@ spec: | |||||||
|         - name: signer |         - name: signer | ||||||
|           image: {{ .Values.signer.image }} |           image: {{ .Values.signer.image }} | ||||||
|           imagePullPolicy: {{ .Values.signer.image_pull_policy }} |           imagePullPolicy: {{ .Values.signer.image_pull_policy }} | ||||||
|           command: ["uvicorn", "authsign.main:app", "--port", "5053", "--host", "0.0.0.0", "--log-config", "/app/log.json"] |           command: ["uvicorn", "authsign.main:app", "--port", "{{ $signer_port }}", "--host", "0.0.0.0", "--log-config", "/app/log.json"] | ||||||
|           env: |           env: | ||||||
|             - name: CONFIG |             - name: CONFIG | ||||||
|               value: "/app-config/config.yaml" |               value: "/app-config/config.yaml" | ||||||
| @ -141,7 +157,7 @@ spec: | |||||||
|       name: signer-cert |       name: signer-cert | ||||||
| 
 | 
 | ||||||
|     - protocol: TCP |     - protocol: TCP | ||||||
|       port: 5053 |       port: {{ $signer_port }} | ||||||
|       name: signer-api |       name: signer-api | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user