{{- if .Values.opa.enabled }} {{- $ctx := . -}} {{ range untilStep 0 ((include "tp.replicas" $ctx) | int) 1 }} --- apiVersion: v1 kind: Service metadata: name: {{ include "common.names.fullname" $ctx }}-opa-tp-{{ . }} labels: {{- include "lib.labels" $ctx | nindent 4 }} per-node: {{ include "common.names.fullname" $ctx }}-{{ . }} component: opa-tp spec: type: ClusterIP clusterIP: None sessionAffinity: ClientIP selector: {{- include "common.labels.matchLabels" $ctx | nindent 4 }} component: opa-tp statefulset.kubernetes.io/pod-name: {{ include "common.names.fullname" $ctx }}-{{ . }} {{- end -}} {{- end }}