Replace Helm lookup functions with FluxCD valuesFrom mechanism for reading cluster and namespace configuration. Changes: - Create Secret cozystack-values in each namespace with values.yaml key containing _cluster and _namespace configuration as nested YAML - Configure HelmReleases to read from this Secret via valuesFrom (valuesKey defaults to values.yaml, so it can be omitted) - Update cozy-lib helpers to access config via .Values._cluster - Add default values for required _cluster keys to ensure all fields exist - Update Go code (cozystack-api and helm reconciler) to use new format This eliminates the need for Helm lookup functions while maintaining the same configuration interface for charts. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
28 lines
832 B
YAML
28 lines
832 B
YAML
{{- $host := index .Values._cluster "root-host" }}
|
|
{{- $exposeServices := splitList "," ((index .Values._cluster "expose-services") | default "") }}
|
|
{{- $exposeIngress := (index .Values._cluster "expose-ingress") | default "tenant-root" }}
|
|
|
|
{{- if and (has "api" $exposeServices) }}
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: Ingress
|
|
metadata:
|
|
annotations:
|
|
nginx.ingress.kubernetes.io/backend-protocol: HTTPS
|
|
nginx.ingress.kubernetes.io/ssl-passthrough: "true"
|
|
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
|
|
name: kubernetes
|
|
namespace: default
|
|
spec:
|
|
ingressClassName: {{ $exposeIngress }}
|
|
rules:
|
|
- host: api.{{ $host }}
|
|
http:
|
|
paths:
|
|
- backend:
|
|
service:
|
|
name: kubernetes
|
|
port:
|
|
number: 443
|
|
path: /
|
|
pathType: Prefix
|
|
{{- end }}
|