mirror of
https://github.com/outbackdingo/openlan-cgw.git
synced 2026-01-27 02:19:49 +00:00
Merge pull request #150 from miha-jancar-shastacloud/main
Refactor public_env_variables
This commit is contained in:
@@ -2,4 +2,4 @@ apiVersion: v2
|
||||
appVersion: "1.0.0"
|
||||
description: A CGW Helm chart for Kubernetes
|
||||
name: cgw
|
||||
version: 0.4.0
|
||||
version: 0.5.0
|
||||
|
||||
@@ -68,7 +68,6 @@ The following table lists the configurable parameters of the chart and their def
|
||||
| persistence.enabled | boolean | Defines if the Gateway requires Persistent Volume (required for permanent files storage and SQLite DB if enabled) | `True` |
|
||||
| persistence.accessModes | array | Defines PV access modes | |
|
||||
| persistence.size | string | Defines PV size | `'10Gi'` |
|
||||
| podIP_as_grpc_host | boolean | If `true`, `CGW_GRPC_PUBLIC_HOST` environment variable will be populated with PodIP. | `false` |
|
||||
| public\_env\_variables | hash | Defines list of environment variables to be passed to the Gateway via ConfigMaps | |
|
||||
| secret\_env\_variables | hash | Defines list of secret environment variables to be passed to the Gateway via secrets | |
|
||||
| existingEnvSecret | hash | Defines list of secret environment variables to be passed to the Gateway via secrets | |
|
||||
|
||||
@@ -50,15 +50,13 @@ spec:
|
||||
env:
|
||||
- name: KUBERNETES_DEPLOYED
|
||||
value: "{{ now }}"
|
||||
{{- if .Values.podIP_as_grpc_host }}
|
||||
- name: CGW_GRPC_PUBLIC_HOST
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: status.podIP
|
||||
{{- end }}
|
||||
{{- range $key, $value := .Values.public_env_variables }}
|
||||
- name: {{ $key }}
|
||||
value: {{ $value | quote }}
|
||||
{{- range .Values.public_env_variables }}
|
||||
- name: {{ .name }}
|
||||
{{- if .value }}
|
||||
value: {{ .value | quote }}
|
||||
{{- else if .valueFrom }}
|
||||
valueFrom: {{ toYaml .valueFrom | nindent 16 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
envFrom:
|
||||
- secretRef:
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
{{- if and (hasKey .Values.public_env_variables "CGW_DB_TLS") (eq .Values.public_env_variables.CGW_DB_TLS "yes") }}
|
||||
{{- if not (or .Values.db_cert .Values.existingDBCertsSecret) }}
|
||||
{{- fail "Either db_cert or existingDBCertsSecret must be set when CGW_DB_TLS is 'yes'." }}
|
||||
{{- $tlsEnabled := false }}
|
||||
{{- range .Values.public_env_variables }}
|
||||
{{- if and (eq .name "CGW_DB_TLS") (eq .value "yes") }}
|
||||
{{- $tlsEnabled = true }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- if and (not .Values.existingDBCertsSecret) (hasKey .Values.public_env_variables "CGW_DB_TLS") (eq .Values.public_env_variables.CGW_DB_TLS "yes") }}
|
||||
{{- if and $tlsEnabled (not (or .Values.db_cert .Values.existingDBCertsSecret)) }}
|
||||
{{- fail "Either db_cert or existingDBCertsSecret must be set when CGW_DB_TLS is 'yes'." }}
|
||||
{{- end }}
|
||||
|
||||
{{- if and $tlsEnabled (not .Values.existingDBCertsSecret) }}
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
labels:
|
||||
@@ -17,4 +22,4 @@ kind: Secret
|
||||
type: Opaque
|
||||
data:
|
||||
cert.pem: {{ .Values.db_cert | b64enc | quote }}
|
||||
{{- end}}
|
||||
{{- end }}
|
||||
@@ -100,22 +100,30 @@ persistence:
|
||||
|
||||
# Application
|
||||
public_env_variables:
|
||||
CGW_ROOT: /cgw-data
|
||||
CGW_WSS_CAS: "cas.pem"
|
||||
CGW_WSS_CERT: "websocket-cert.pem"
|
||||
CGW_WSS_KEY: "websocket-key.pem"
|
||||
CGW_LOG_LEVEL: "info" # or debug
|
||||
- name: CGW_ROOT
|
||||
value: "/cgw-data"
|
||||
- name: CGW_WSS_CAS
|
||||
value: "cas.pem"
|
||||
- name: CGW_WSS_CERT
|
||||
value: "websocket-cert.pem"
|
||||
- name: CGW_WSS_KEY
|
||||
value: "websocket-key.pem"
|
||||
- name: CGW_LOG_LEVEL
|
||||
value: "info" # or debug
|
||||
# set to (#cpus * 2) - 2
|
||||
DEFAULT_WSS_THREAD_NUM: "6"
|
||||
CGW_GRPC_PUBLIC_HOST: "localhost"
|
||||
CGW_GRPC_PUBLIC_PORT: "15051"
|
||||
- name: DEFAULT_WSS_THREAD_NUM
|
||||
value: "6"
|
||||
- name: CGW_GRPC_PUBLIC_HOST
|
||||
value: "localhost"
|
||||
- name: CGW_GRPC_PUBLIC_PORT
|
||||
value: "15051"
|
||||
# - name: CGW_DB_TLS
|
||||
# value: "yes"
|
||||
# - name: CGW_REDIS_TLS
|
||||
# value: "yes"
|
||||
# - name: CGW_KAFKA_TLS
|
||||
# value: "yes"
|
||||
|
||||
# CGW_DB_TLS: "yes"
|
||||
# CGW_REDIS_TLS: "yes"
|
||||
# CGW_KAFKA_TLS: "yes"
|
||||
|
||||
#Set podIP_as_grpc_host or define CGW_GRPC_PUBLIC_HOST environmental variable
|
||||
podIP_as_grpc_host: false
|
||||
|
||||
#Set secret_env_variables or existingEnvSecret variable
|
||||
secret_env_variables:
|
||||
@@ -159,4 +167,4 @@ existingDBCertsSecret:
|
||||
# .......
|
||||
# -----END CERTIFICATE-----
|
||||
|
||||
existingCgwCertsSecret:
|
||||
existingCgwCertsSecret:
|
||||
Reference in New Issue
Block a user