mirror of
https://github.com/pgsty/minio.git
synced 2026-11-25 16:49:09 +03:00
7226aaf3fc
Signed-off-by: Feng Ruohang <rh@vonng.com>
78 lines
2.3 KiB
YAML
78 lines
2.3 KiB
YAML
{{- if and (.Values.networkPolicy.enabled) (eq .Values.networkPolicy.flavor "kubernetes") }}
|
|
kind: NetworkPolicy
|
|
apiVersion: {{ template "silo.networkPolicy.apiVersion" . }}
|
|
metadata:
|
|
name: {{ template "silo.fullname" . }}
|
|
labels:
|
|
app: {{ template "silo.name" . }}
|
|
chart: {{ template "silo.chart" . }}
|
|
release: {{ .Release.Name }}
|
|
heritage: {{ .Release.Service }}
|
|
{{- with .Values.commonLabels }}
|
|
{{- tpl (toYaml .) $ | nindent 4 }}
|
|
{{- end }}
|
|
spec:
|
|
podSelector:
|
|
matchLabels:
|
|
app: {{ template "silo.name" . }}
|
|
release: {{ .Release.Name }}
|
|
ingress:
|
|
- ports:
|
|
- port: {{ .Values.minioAPIPort }}
|
|
protocol: TCP
|
|
- port: {{ .Values.minioConsolePort }}
|
|
protocol: TCP
|
|
{{- if or (not .Values.networkPolicy.allowExternal) .Values.networkPolicy.allowFrom }}
|
|
from:
|
|
{{- if not .Values.networkPolicy.allowExternal }}
|
|
- podSelector:
|
|
matchLabels:
|
|
{{ template "silo.name" . }}-client: "true"
|
|
{{- end }}
|
|
{{- with .Values.networkPolicy.allowFrom }}
|
|
{{- tpl (toYaml .) $ | nindent 8 }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if .Values.networkPolicy.egress.enabled }}
|
|
egress:
|
|
- ports:
|
|
{{ .Values.networkPolicy.egress.ports | toJson }}
|
|
{{- with .Values.networkPolicy.egress.to }}
|
|
to:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if .Values.networkPolicy.egress.enabled }}
|
|
---
|
|
kind: NetworkPolicy
|
|
apiVersion: {{ template "silo.networkPolicy.apiVersion" . }}
|
|
metadata:
|
|
name: {{ template "silo.fullname" . }}-post-job
|
|
labels:
|
|
app: {{ template "silo.name" . }}-post-job
|
|
chart: {{ template "silo.chart" . }}
|
|
release: {{ .Release.Name }}
|
|
heritage: {{ .Release.Service }}
|
|
{{- with .Values.commonLabels }}
|
|
{{- tpl (toYaml .) $ | nindent 4 }}
|
|
{{- end }}
|
|
spec:
|
|
podSelector:
|
|
matchLabels:
|
|
app: {{ template "silo.name" . }}-job
|
|
release: {{ .Release.Name }}
|
|
egress:
|
|
- ports:
|
|
- port: {{ .Values.minioAPIPort }}
|
|
protocol: TCP
|
|
- port: {{ .Values.minioConsolePort }}
|
|
protocol: TCP
|
|
- ports:
|
|
{{ .Values.networkPolicy.egress.ports | toJson }}
|
|
{{- with .Values.networkPolicy.egress.to }}
|
|
to:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|