mirror of
https://github.com/pgsty/minio.git
synced 2026-09-22 18:59:02 +03:00
67 lines
1.9 KiB
YAML
67 lines
1.9 KiB
YAML
{{- if and (.Values.networkPolicy.enabled) (eq .Values.networkPolicy.flavor "kubernetes") }}
|
|
kind: NetworkPolicy
|
|
apiVersion: {{ template "minio.networkPolicy.apiVersion" . }}
|
|
metadata:
|
|
name: {{ template "minio.fullname" . }}
|
|
labels:
|
|
app: {{ template "minio.name" . }}
|
|
chart: {{ template "minio.chart" . }}
|
|
release: {{ .Release.Name }}
|
|
heritage: {{ .Release.Service }}
|
|
spec:
|
|
podSelector:
|
|
matchLabels:
|
|
app: {{ template "minio.name" . }}
|
|
release: {{ .Release.Name }}
|
|
ingress:
|
|
- ports:
|
|
- port: {{ .Values.minioAPIPort }}
|
|
protocol: TCP
|
|
- port: {{ .Values.minioConsolePort }}
|
|
protocol: TCP
|
|
{{- if not .Values.networkPolicy.allowExternal }}
|
|
from:
|
|
- podSelector:
|
|
matchLabels:
|
|
{{ template "minio.name" . }}-client: "true"
|
|
{{- end }}
|
|
{{- if .Values.networkPolicy.egress.enabled }}
|
|
egress:
|
|
- ports:
|
|
{{ .Values.networkPolicy.egress.ports | toJson }}
|
|
{{- with .Values.networkPolicy.egress.to }}
|
|
to:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- end }}
|
|
---
|
|
kind: NetworkPolicy
|
|
apiVersion: {{ template "minio.networkPolicy.apiVersion" . }}
|
|
metadata:
|
|
name: {{ template "minio.fullname" . }}-post-job
|
|
labels:
|
|
app: {{ template "minio.name" . }}-post-job
|
|
chart: {{ template "minio.chart" . }}
|
|
release: {{ .Release.Name }}
|
|
heritage: {{ .Release.Service }}
|
|
spec:
|
|
podSelector:
|
|
matchLabels:
|
|
app: {{ template "minio.name" . }}-job
|
|
release: {{ .Release.Name }}
|
|
egress:
|
|
- ports:
|
|
- port: {{ .Values.minioAPIPort }}
|
|
protocol: TCP
|
|
- port: {{ .Values.minioConsolePort }}
|
|
protocol: TCP
|
|
{{- if .Values.networkPolicy.egress.enabled }}
|
|
- ports:
|
|
{{ .Values.networkPolicy.egress.ports | toJson }}
|
|
{{- with .Values.networkPolicy.egress.to }}
|
|
to:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|