{{- range $name, $device := .Values.externalDevices }} {{- if $device.enabled }} --- # Service pour {{ $name }} apiVersion: v1 kind: Service metadata: name: {{ $name }}-backend namespace: {{ $device.namespace | default $.Values.global.namespace }} labels: app: external-device device: {{ $name }} app.kubernetes.io/managed-by: Helm app.kubernetes.io/instance: {{ $.Release.Name }} annotations: argocd.argoproj.io/sync-wave: "-1" spec: type: ClusterIP ports: - port: {{ $device.port }} targetPort: {{ $device.port }} protocol: TCP --- # Endpoints pour {{ $name }} (pointe vers l'IP externe) apiVersion: v1 kind: Endpoints metadata: name: {{ $name }}-backend namespace: {{ $device.namespace | default $.Values.global.namespace }} labels: app: external-device device: {{ $name }} app.kubernetes.io/managed-by: Helm app.kubernetes.io/instance: {{ $.Release.Name }} annotations: argocd.argoproj.io/sync-wave: "0" subsets: - addresses: - ip: {{ $device.ip }} ports: - port: {{ $device.port }} protocol: TCP {{- end }} {{- end }}