mirror of
https://github.com/minio/minio.git
synced 2025-03-30 17:23:42 -04:00
Helm: add cilium networkpolicy (#18650)
Signed-off-by: QuantumEnigmaa <thibaud@giantswarm.io>
This commit is contained in:
parent
f78d677ab6
commit
82739574b5
@ -112,6 +112,8 @@ the DefaultDeny namespace annotation. Note: this will enforce policy for *all* p
|
|||||||
kubectl annotate namespace default "net.beta.kubernetes.io/network-policy={\"ingress\":{\"isolation\":\"DefaultDeny\"}}"
|
kubectl annotate namespace default "net.beta.kubernetes.io/network-policy={\"ingress\":{\"isolation\":\"DefaultDeny\"}}"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
When using `Cilium` as a CNI in your cluster, please edit the `flavor` field to `cilium`.
|
||||||
|
|
||||||
With NetworkPolicy enabled, traffic will be limited to just port 9000.
|
With NetworkPolicy enabled, traffic will be limited to just port 9000.
|
||||||
|
|
||||||
For more precise policy, set `networkPolicy.allowExternal=true`. This will
|
For more precise policy, set `networkPolicy.allowExternal=true`. This will
|
||||||
|
33
helm/minio/templates/ciliumnetworkpolicy.yaml
Normal file
33
helm/minio/templates/ciliumnetworkpolicy.yaml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
{{- if and (.Values.networkPolicy.enabled) (eq .Values.networkPolicy.flavor "cilium") }}
|
||||||
|
kind: CiliumNetworkPolicy
|
||||||
|
apiVersion: cilium.io/v2
|
||||||
|
metadata:
|
||||||
|
name: {{ template "minio.fullname" . }}
|
||||||
|
labels:
|
||||||
|
app: {{ template "minio.name" . }}
|
||||||
|
chart: {{ template "minio.chart" . }}
|
||||||
|
release: {{ .Release.Name }}
|
||||||
|
heritage: {{ .Release.Service }}
|
||||||
|
spec:
|
||||||
|
endpointSelector:
|
||||||
|
matchLabels:
|
||||||
|
app: {{ template "minio.name" . }}
|
||||||
|
release: {{ .Release.Name }}
|
||||||
|
ingress:
|
||||||
|
- toPorts:
|
||||||
|
- ports:
|
||||||
|
- port: {{ .Values.minioAPIPort }}
|
||||||
|
protocol: TCP
|
||||||
|
- port: {{ .Values.minioConsolePort }}
|
||||||
|
protocol: TCP
|
||||||
|
{{- if not .Values.networkPolicy.allowExternal }}
|
||||||
|
fromEndpoints:
|
||||||
|
- matchLabels:
|
||||||
|
{{ template "minio.name" . }}-client: "true"
|
||||||
|
{{- end }}
|
||||||
|
egress:
|
||||||
|
{{- range $entity := .Values.networkPolicy.egressEntities }}
|
||||||
|
- toEntities:
|
||||||
|
- {{ $entity }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
@ -1,4 +1,4 @@
|
|||||||
{{- if .Values.networkPolicy.enabled }}
|
{{- if and (.Values.networkPolicy.enabled) (eq .Values.networkPolicy.flavor "kubernetes") }}
|
||||||
kind: NetworkPolicy
|
kind: NetworkPolicy
|
||||||
apiVersion: {{ template "minio.networkPolicy.apiVersion" . }}
|
apiVersion: {{ template "minio.networkPolicy.apiVersion" . }}
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -498,7 +498,13 @@ oidc:
|
|||||||
|
|
||||||
networkPolicy:
|
networkPolicy:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
# Specifies whether the policies created will be standard Network Policies (flavor: kubernetes)
|
||||||
|
# or Cilium Network Policies (flavor: cilium)
|
||||||
|
flavor: kubernetes
|
||||||
allowExternal: true
|
allowExternal: true
|
||||||
|
# only when using flavor: cilium
|
||||||
|
egressEntities:
|
||||||
|
- kube-apiserver
|
||||||
|
|
||||||
## PodDisruptionBudget settings
|
## PodDisruptionBudget settings
|
||||||
## ref: https://kubernetes.io/docs/concepts/workloads/pods/disruptions/
|
## ref: https://kubernetes.io/docs/concepts/workloads/pods/disruptions/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user