Skip to content

Commit eb8e27a

Browse files
committed
remove unused spaces
1 parent f5d3689 commit eb8e27a

File tree

8 files changed

+240
-8
lines changed

8 files changed

+240
-8
lines changed

charts/sn-platform-slim/templates/bookkeeper/bookkeeper-authorizationpolicy.yaml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,20 @@ metadata:
1010
namespace: {{ template "pulsar.namespace" . }}
1111
spec:
1212
rules:
13-
- to:
13+
- {{- if .Values.bookkeeper.authorizationPolicy.from }}
14+
from:
15+
{{ toYaml .Values.bookkeeper.authorizationPolicy.from | indent 4 }}
16+
{{- end }}
17+
{{- if .Values.bookkeeper.authorizationPolicy.to }}
18+
to:
19+
{{ toYaml .Values.bookkeeper.authorizationPolicy.to | indent 4 }}
20+
{{- else }}
21+
to:
1422
- operation:
1523
ports:
1624
- "3181"
1725
- "8000"
26+
{{- end }}
1827
action: ALLOW
1928
selector:
2029
matchLabels:
@@ -30,10 +39,19 @@ metadata:
3039
namespace: {{ template "pulsar.namespace" . }}
3140
spec:
3241
rules:
33-
- to:
42+
- {{- if .Values.autorecovery.authorizationPolicy.from }}
43+
from:
44+
{{ toYaml .Values.autorecovery.authorizationPolicy.from | indent 4 }}
45+
{{- end }}
46+
{{- if .Values.autorecovery.authorizationPolicy.to }}
47+
to:
48+
{{ toYaml .Values.autorecovery.authorizationPolicy.to | indent 4 }}
49+
{{- else }}
50+
to:
3451
- operation:
3552
ports:
3653
- "{{ .Values.autorecovery.ports.http }}"
54+
{{- end }}
3755
action: ALLOW
3856
selector:
3957
matchLabels:

charts/sn-platform-slim/templates/broker/broker-authorizationpolicy.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,15 @@ metadata:
1010
namespace: {{ template "pulsar.namespace" . }}
1111
spec:
1212
rules:
13-
- to:
13+
- {{- if .Values.broker.authorizationPolicy.from }}
14+
from:
15+
{{ toYaml .Values.broker.authorizationPolicy.from | indent 4 }}
16+
{{- end }}
17+
{{- if .Values.broker.authorizationPolicy.to }}
18+
to:
19+
{{ toYaml .Values.broker.authorizationPolicy.to | indent 4 }}
20+
{{- else }}
21+
to:
1422
- operation:
1523
ports:
1624
- "6650"
@@ -41,6 +49,7 @@ spec:
4149
- "9095"
4250
{{- end }}
4351
{{- end }}
52+
{{- end }}
4453
action: ALLOW
4554
selector:
4655
matchLabels:

charts/sn-platform-slim/templates/zookeeper/zookeeper-authorizationpolicy.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,23 @@ metadata:
1010
namespace: {{ template "pulsar.namespace" . }}
1111
spec:
1212
rules:
13-
- to:
13+
- {{- if .Values.zookeeper.authorizationPolicy.from }}
14+
from:
15+
{{ toYaml .Values.zookeeper.authorizationPolicy.from | indent 4 }}
16+
{{- end }}
17+
{{- if .Values.zookeeper.authorizationPolicy.to }}
18+
to:
19+
{{ toYaml .Values.zookeeper.authorizationPolicy.to | indent 4 }}
20+
{{- else }}
21+
to:
1422
- operation:
1523
ports:
1624
- "2181"
1725
- "9990"
1826
- "2888"
1927
- "3888"
2028
- "{{ .Values.zookeeper.ports.metrics }}"
29+
{{- end }}
2130
action: ALLOW
2231
selector:
2332
matchLabels:

charts/sn-platform-slim/values.yaml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,26 @@ zookeeper:
561561
# The template field can totally change the log config of the component. The value is a string, which is the content of the log config file.
562562
template: {}
563563

564+
# Istio AuthorizationPolicy configuration
565+
# Configure the 'from' and 'to' sections to restrict sources and operations
566+
# If 'to' is not specified, default ports will be used
567+
# Example:
568+
# authorizationPolicy:
569+
# from:
570+
# - source:
571+
# principals: ["cluster.local/ns/default/sa/pulsar-broker"]
572+
# - source:
573+
# namespaces: ["pulsar"]
574+
# to:
575+
# - operation:
576+
# ports: ["2181", "9990"]
577+
# methods: ["GET", "POST"]
578+
# paths: ["/metrics"]
579+
# hosts: ["zookeeper.pulsar.svc.cluster.local"]
580+
authorizationPolicy:
581+
from: []
582+
to: []
583+
564584
# use a component name that matches your grafana configuration
565585
# so the metrics are correctly rendered in grafana dashboard
566586
component: zookeeper
@@ -815,6 +835,26 @@ bookkeeper:
815835
# The template field can totally change the log config of the component. The value is a string, which is the content of the log config file.
816836
template: {}
817837

838+
# Istio AuthorizationPolicy configuration
839+
# Configure the 'from' and 'to' sections to restrict sources and operations
840+
# If 'to' is not specified, default ports will be used
841+
# Example:
842+
# authorizationPolicy:
843+
# from:
844+
# - source:
845+
# principals: ["cluster.local/ns/default/sa/pulsar-broker"]
846+
# - source:
847+
# namespaces: ["pulsar"]
848+
# to:
849+
# - operation:
850+
# ports: ["3181", "8000"]
851+
# methods: ["GET", "POST"]
852+
# paths: ["/metrics"]
853+
# hosts: ["bookie.pulsar.svc.cluster.local"]
854+
authorizationPolicy:
855+
from: []
856+
to: []
857+
818858
# use a component name that matches your grafana configuration
819859
# so the metrics are correctly rendered in grafana dashboard
820860
component: bookie
@@ -980,6 +1020,26 @@ bookkeeper:
9801020
## templates/autorecovery-statefulset.yaml
9811021
##
9821022
autorecovery:
1023+
# Istio AuthorizationPolicy configuration
1024+
# Configure the 'from' and 'to' sections to restrict sources and operations
1025+
# If 'to' is not specified, default ports will be used
1026+
# Example:
1027+
# authorizationPolicy:
1028+
# from:
1029+
# - source:
1030+
# principals: ["cluster.local/ns/default/sa/pulsar-broker"]
1031+
# - source:
1032+
# namespaces: ["pulsar"]
1033+
# to:
1034+
# - operation:
1035+
# ports: ["8000"]
1036+
# methods: ["GET", "POST"]
1037+
# paths: ["/metrics"]
1038+
# hosts: ["recovery.pulsar.svc.cluster.local"]
1039+
authorizationPolicy:
1040+
from: []
1041+
to: []
1042+
9831043
# use a component name that matches your grafana configuration
9841044
# so the metrics are correctly rendered in grafana dashboard
9851045
component: recovery
@@ -1084,6 +1144,26 @@ broker:
10841144
# The template field can totally change the log config of the component. The value is a string, which is the content of the log config file.
10851145
template: {}
10861146

1147+
# Istio AuthorizationPolicy configuration
1148+
# Configure the 'from' and 'to' sections to restrict sources and operations
1149+
# If 'to' is not specified, default ports will be used
1150+
# Example:
1151+
# authorizationPolicy:
1152+
# from:
1153+
# - source:
1154+
# principals: ["cluster.local/ns/default/sa/pulsar-proxy"]
1155+
# - source:
1156+
# namespaces: ["pulsar"]
1157+
# to:
1158+
# - operation:
1159+
# ports: ["6650", "8080"]
1160+
# methods: ["GET", "POST"]
1161+
# paths: ["/metrics"]
1162+
# hosts: ["broker.pulsar.svc.cluster.local"]
1163+
authorizationPolicy:
1164+
from: []
1165+
to: []
1166+
10871167
# use a component name that matches your grafana configuration
10881168
# so the metrics are correctly rendered in grafana dashboard
10891169
component: broker

charts/sn-platform/templates/bookkeeper/bookkeeper-authorizationpolicy.yaml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,20 @@ metadata:
1010
namespace: {{ template "pulsar.namespace" . }}
1111
spec:
1212
rules:
13-
- to:
13+
- {{- if .Values.bookkeeper.authorizationPolicy.from }}
14+
from:
15+
{{ toYaml .Values.bookkeeper.authorizationPolicy.from | indent 4 }}
16+
{{- end }}
17+
{{- if .Values.bookkeeper.authorizationPolicy.to }}
18+
to:
19+
{{ toYaml .Values.bookkeeper.authorizationPolicy.to | indent 4 }}
20+
{{- else }}
21+
to:
1422
- operation:
1523
ports:
1624
- "3181"
1725
- "8000"
26+
{{- end }}
1827
action: ALLOW
1928
selector:
2029
matchLabels:
@@ -30,10 +39,19 @@ metadata:
3039
namespace: {{ template "pulsar.namespace" . }}
3140
spec:
3241
rules:
33-
- to:
42+
- {{- if .Values.autorecovery.authorizationPolicy.from }}
43+
from:
44+
{{ toYaml .Values.autorecovery.authorizationPolicy.from | indent 4 }}
45+
{{- end }}
46+
{{- if .Values.autorecovery.authorizationPolicy.to }}
47+
to:
48+
{{ toYaml .Values.autorecovery.authorizationPolicy.to | indent 4 }}
49+
{{- else }}
50+
to:
3451
- operation:
3552
ports:
3653
- "{{ .Values.autorecovery.ports.http }}"
54+
{{- end }}
3755
action: ALLOW
3856
selector:
3957
matchLabels:

charts/sn-platform/templates/broker/broker-authorizationpolicy.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,15 @@ metadata:
1010
namespace: {{ template "pulsar.namespace" . }}
1111
spec:
1212
rules:
13-
- to:
13+
- {{- if .Values.broker.authorizationPolicy.from }}
14+
from:
15+
{{ toYaml .Values.broker.authorizationPolicy.from | indent 4 }}
16+
{{- end }}
17+
{{- if .Values.broker.authorizationPolicy.to }}
18+
to:
19+
{{ toYaml .Values.broker.authorizationPolicy.to | indent 4 }}
20+
{{- else }}
21+
to:
1422
- operation:
1523
ports:
1624
- "6650"
@@ -41,6 +49,7 @@ spec:
4149
- "9095"
4250
{{- end }}
4351
{{- end }}
52+
{{- end }}
4453
action: ALLOW
4554
selector:
4655
matchLabels:

charts/sn-platform/templates/zookeeper/zookeeper-authorizationpolicy.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,23 @@ metadata:
1010
namespace: {{ template "pulsar.namespace" . }}
1111
spec:
1212
rules:
13-
- to:
13+
- {{- if .Values.zookeeper.authorizationPolicy.from }}
14+
from:
15+
{{ toYaml .Values.zookeeper.authorizationPolicy.from | indent 4 }}
16+
{{- end }}
17+
{{- if .Values.zookeeper.authorizationPolicy.to }}
18+
to:
19+
{{ toYaml .Values.zookeeper.authorizationPolicy.to | indent 4 }}
20+
{{- else }}
21+
to:
1422
- operation:
1523
ports:
1624
- "2181"
1725
- "9990"
1826
- "2888"
1927
- "3888"
2028
- "{{ .Values.zookeeper.ports.metrics }}"
29+
{{- end }}
2130
action: ALLOW
2231
selector:
2332
matchLabels:

0 commit comments

Comments
 (0)