2020-11-21 12:24:57 +00:00
|
|
|
{{- if .Values.istio.enabled }}
|
|
|
|
{{- if .Values.istio.ipBlocks }}
|
|
|
|
apiVersion: security.istio.io/v1beta1
|
|
|
|
kind: AuthorizationPolicy
|
|
|
|
metadata:
|
|
|
|
name: {{ .Release.Namespace }}-redis-deny-not-in-ipblocks
|
2020-12-04 14:05:35 +00:00
|
|
|
namespace: {{ .Release.Namespace }}
|
2020-11-21 12:24:57 +00:00
|
|
|
labels:
|
|
|
|
{{ include "kubezero-lib.labels" . | indent 4 }}
|
|
|
|
spec:
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
app: istio-private-ingressgateway
|
|
|
|
action: DENY
|
|
|
|
rules:
|
|
|
|
- from:
|
|
|
|
- source:
|
|
|
|
notIpBlocks:
|
|
|
|
{{- with .Values.istio.ipBlocks }}
|
|
|
|
{{- . | toYaml | nindent 8 }}
|
|
|
|
{{- end }}
|
|
|
|
to:
|
|
|
|
- operation:
|
|
|
|
ports: ["{{ default 6379 .Values.redis.redisPort }}"]
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|