| {{- if .Values.networkPolicy.enabled }} |
| kind: NetworkPolicy |
| apiVersion: networking.k8s.io/v1 {{ include "nacos.networkPolicy.apiVersion" . }} |
| metadata: |
| name: {{ include "nacos.fullname" . }} |
| namespace: {{ template "nacos.namespace" . }} |
| labels: {{- include "nacos.labels" . | nindent 4 }} |
| spec: |
| podSelector: |
| matchLabels: {{- include "nacos.matchLabels" . | nindent 6 }} |
| policyTypes: |
| - Ingress |
| ingress: |
| - ports: |
| - port: {{ .Values.service.port }} |
| from: |
| - podSelector: |
| matchLabels: |
| {{ include "nacos.fullname" . }}-client: "true" |
| - podSelector: |
| matchLabels: {{- include "nacos.matchLabels" . | nindent 14 }} |
| - ports: |
| - port: {{ .Values.service.port }} |
| from: |
| - podSelector: |
| matchLabels: {{- include "nacos.matchLabels" . | nindent 14 }} |
| {{- end }} |