48 lines
1.2 KiB
YAML
48 lines
1.2 KiB
YAML
{{- 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"
|
|
# Forcer ArgoCD à gérer cette ressource même si elle est normalement exclue
|
|
argocd.argoproj.io/sync-options: "ServerSideApply=true"
|
|
subsets:
|
|
- addresses:
|
|
- ip: {{ $device.ip }}
|
|
ports:
|
|
- port: {{ $device.port }}
|
|
protocol: TCP
|
|
{{- end }}
|
|
{{- end }}
|
|
|