Fix for missing PSP for bookie initialize and other (#101)
### Motivation When using standard bookkeeper installation on PSP cluster initialization fails because has to be started as root ### Modifications Add same ServiceAccount and SecurityContext for bookkeeper-cluster-initialize as in bookkeeper specyfication. UPDATE: Seems that when using in cluster TLS encryption other components also require RW access to root FS, I added PSP for proxy, zookeepe, broker and toolset ### Verifying this change - [x] Make sure that the change passes the CI checks.
This commit is contained in:
parent
c2f672881e
commit
23ba8ac948
@ -29,6 +29,9 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
template:
|
template:
|
||||||
spec:
|
spec:
|
||||||
|
{{- if and .Values.rbac.enabled .Values.rbac.psp }}
|
||||||
|
serviceAccountName: "{{ template "pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}"
|
||||||
|
{{- end }}
|
||||||
initContainers:
|
initContainers:
|
||||||
- name: wait-zookeeper-ready
|
- name: wait-zookeeper-ready
|
||||||
image: "{{ .Values.images.bookie.repository }}:{{ .Values.images.bookie.tag }}"
|
image: "{{ .Values.images.bookie.repository }}:{{ .Values.images.bookie.tag }}"
|
||||||
@ -66,6 +69,10 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
bin/bookkeeper shell initnewcluster;
|
bin/bookkeeper shell initnewcluster;
|
||||||
fi
|
fi
|
||||||
|
{{- if and .Values.rbac.enabled .Values.rbac.psp }}
|
||||||
|
securityContext:
|
||||||
|
readOnlyRootFilesystem: false
|
||||||
|
{{- end }}
|
||||||
envFrom:
|
envFrom:
|
||||||
- configMapRef:
|
- configMapRef:
|
||||||
name: "{{ template "pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}"
|
name: "{{ template "pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}"
|
||||||
|
|||||||
@ -58,3 +58,70 @@ subjects:
|
|||||||
name: "{{ template "pulsar.fullname" . }}-{{ .Values.functions.component }}"
|
name: "{{ template "pulsar.fullname" . }}-{{ .Values.functions.component }}"
|
||||||
namespace: {{ template "pulsar.namespace" . }}
|
namespace: {{ template "pulsar.namespace" . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
{{- if and .Values.rbac.enabled .Values.rbac.psp }}
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||||
|
kind: Role
|
||||||
|
metadata:
|
||||||
|
name: "{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}-psp"
|
||||||
|
namespace: {{ template "pulsar.namespace" . }}
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- policy
|
||||||
|
resourceNames:
|
||||||
|
- "{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}"
|
||||||
|
resources:
|
||||||
|
- podsecuritypolicies
|
||||||
|
verbs:
|
||||||
|
- use
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||||
|
kind: RoleBinding
|
||||||
|
metadata:
|
||||||
|
name: "{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}-psp"
|
||||||
|
namespace: {{ template "pulsar.namespace" . }}
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: Role
|
||||||
|
name: "{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}-psp"
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: "{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}-acct"
|
||||||
|
namespace: {{ template "pulsar.namespace" . }}
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: policy/v1beta1
|
||||||
|
kind: PodSecurityPolicy
|
||||||
|
metadata:
|
||||||
|
name: "{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}"
|
||||||
|
namespace: {{ template "pulsar.namespace" . }}
|
||||||
|
spec:
|
||||||
|
readOnlyRootFilesystem: false
|
||||||
|
privileged: false
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
|
runAsUser:
|
||||||
|
rule: 'RunAsAny'
|
||||||
|
supplementalGroups:
|
||||||
|
ranges:
|
||||||
|
- max: 65535
|
||||||
|
min: 1
|
||||||
|
rule: MustRunAs
|
||||||
|
fsGroup:
|
||||||
|
rule: 'MustRunAs'
|
||||||
|
ranges:
|
||||||
|
- min: 1
|
||||||
|
max: 65535
|
||||||
|
seLinux:
|
||||||
|
rule: 'RunAsAny'
|
||||||
|
volumes:
|
||||||
|
- configMap
|
||||||
|
- emptyDir
|
||||||
|
- projected
|
||||||
|
- secret
|
||||||
|
- downwardAPI
|
||||||
|
- persistentVolumeClaim
|
||||||
|
{{- end}}
|
||||||
|
|||||||
@ -120,6 +120,10 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
echo "pulsar cluster {{ template "pulsar.cluster.name" . }} isn't initialized yet ... check in 3 seconds ..." && sleep 3;
|
echo "pulsar cluster {{ template "pulsar.cluster.name" . }} isn't initialized yet ... check in 3 seconds ..." && sleep 3;
|
||||||
done;
|
done;
|
||||||
|
{{- if and .Values.rbac.enabled .Values.rbac.psp }}
|
||||||
|
securityContext:
|
||||||
|
readOnlyRootFilesystem: false
|
||||||
|
{{- end }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
{{- include "pulsar.broker.certs.volumeMounts" . | nindent 8 }}
|
{{- include "pulsar.broker.certs.volumeMounts" . | nindent 8 }}
|
||||||
# This init container will wait for bookkeeper to be ready before
|
# This init container will wait for bookkeeper to be ready before
|
||||||
@ -147,6 +151,10 @@ spec:
|
|||||||
envFrom:
|
envFrom:
|
||||||
- configMapRef:
|
- configMapRef:
|
||||||
name: "{{ template "pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}"
|
name: "{{ template "pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}"
|
||||||
|
{{- if and .Values.rbac.enabled .Values.rbac.psp }}
|
||||||
|
securityContext:
|
||||||
|
readOnlyRootFilesystem: false
|
||||||
|
{{- end }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
{{- include "pulsar.broker.certs.volumeMounts" . | nindent 10 }}
|
{{- include "pulsar.broker.certs.volumeMounts" . | nindent 10 }}
|
||||||
containers:
|
containers:
|
||||||
@ -228,6 +236,10 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- include "pulsar.broker.certs.volumeMounts" . | nindent 10 }}
|
{{- include "pulsar.broker.certs.volumeMounts" . | nindent 10 }}
|
||||||
|
{{- if and .Values.rbac.enabled .Values.rbac.psp }}
|
||||||
|
securityContext:
|
||||||
|
readOnlyRootFilesystem: false
|
||||||
|
{{- end }}
|
||||||
volumes:
|
volumes:
|
||||||
{{- if .Values.auth.authentication.enabled }}
|
{{- if .Values.auth.authentication.enabled }}
|
||||||
{{- if eq .Values.auth.authentication.provider "jwt" }}
|
{{- if eq .Values.auth.authentication.provider "jwt" }}
|
||||||
|
|||||||
89
charts/pulsar/templates/proxy-rbac.yaml
Normal file
89
charts/pulsar/templates/proxy-rbac.yaml
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
#
|
||||||
|
# Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
# or more contributor license agreements. See the NOTICE file
|
||||||
|
# distributed with this work for additional information
|
||||||
|
# regarding copyright ownership. The ASF licenses this file
|
||||||
|
# to you under the Apache License, Version 2.0 (the
|
||||||
|
# "License"); you may not use this file except in compliance
|
||||||
|
# with the License. You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing,
|
||||||
|
# software distributed under the License is distributed on an
|
||||||
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
# KIND, either express or implied. See the License for the
|
||||||
|
# specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
{{- if and .Values.rbac.enabled .Values.rbac.psp }}
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||||
|
kind: Role
|
||||||
|
metadata:
|
||||||
|
name: "{{ template "pulsar.fullname" . }}-{{ .Values.proxy.component }}"
|
||||||
|
namespace: {{ template "pulsar.namespace" . }}
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- policy
|
||||||
|
resourceNames:
|
||||||
|
- "{{ template "pulsar.fullname" . }}-{{ .Values.proxy.component }}"
|
||||||
|
resources:
|
||||||
|
- podsecuritypolicies
|
||||||
|
verbs:
|
||||||
|
- use
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: "{{ template "pulsar.fullname" . }}-{{ .Values.proxy.component }}"
|
||||||
|
namespace: {{ template "pulsar.namespace" . }}
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||||
|
kind: RoleBinding
|
||||||
|
metadata:
|
||||||
|
name: "{{ template "pulsar.fullname" . }}-{{ .Values.proxy.component }}"
|
||||||
|
namespace: {{ template "pulsar.namespace" . }}
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: Role
|
||||||
|
name: "{{ template "pulsar.fullname" . }}-{{ .Values.proxy.component }}"
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: "{{ template "pulsar.fullname" . }}-{{ .Values.proxy.component }}"
|
||||||
|
namespace: {{ template "pulsar.namespace" . }}
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: policy/v1beta1
|
||||||
|
kind: PodSecurityPolicy
|
||||||
|
metadata:
|
||||||
|
name: "{{ template "pulsar.fullname" . }}-{{ .Values.proxy.component }}"
|
||||||
|
namespace: {{ template "pulsar.namespace" . }}
|
||||||
|
spec:
|
||||||
|
readOnlyRootFilesystem: false
|
||||||
|
privileged: false
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
|
runAsUser:
|
||||||
|
rule: 'RunAsAny'
|
||||||
|
supplementalGroups:
|
||||||
|
ranges:
|
||||||
|
- max: 65535
|
||||||
|
min: 1
|
||||||
|
rule: MustRunAs
|
||||||
|
fsGroup:
|
||||||
|
rule: 'MustRunAs'
|
||||||
|
ranges:
|
||||||
|
- min: 1
|
||||||
|
max: 65535
|
||||||
|
seLinux:
|
||||||
|
rule: 'RunAsAny'
|
||||||
|
volumes:
|
||||||
|
- configMap
|
||||||
|
- emptyDir
|
||||||
|
- projected
|
||||||
|
- secret
|
||||||
|
- downwardAPI
|
||||||
|
- persistentVolumeClaim
|
||||||
|
{{- end}}
|
||||||
@ -101,6 +101,9 @@ spec:
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
terminationGracePeriodSeconds: {{ .Values.proxy.gracePeriod }}
|
terminationGracePeriodSeconds: {{ .Values.proxy.gracePeriod }}
|
||||||
|
{{- if and .Values.rbac.enabled .Values.rbac.psp }}
|
||||||
|
serviceAccountName: "{{ template "pulsar.fullname" . }}-{{ .Values.proxy.component }}"
|
||||||
|
{{- end}}
|
||||||
initContainers:
|
initContainers:
|
||||||
# This init container will wait for zookeeper to be ready before
|
# This init container will wait for zookeeper to be ready before
|
||||||
# deploying the bookies
|
# deploying the bookies
|
||||||
@ -189,6 +192,10 @@ spec:
|
|||||||
- name: pulsarssl
|
- name: pulsarssl
|
||||||
containerPort: {{ .Values.proxy.ports.pulsarssl }}
|
containerPort: {{ .Values.proxy.ports.pulsarssl }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if and .Values.rbac.enabled .Values.rbac.psp }}
|
||||||
|
securityContext:
|
||||||
|
readOnlyRootFilesystem: false
|
||||||
|
{{- end }}
|
||||||
envFrom:
|
envFrom:
|
||||||
- configMapRef:
|
- configMapRef:
|
||||||
name: "{{ template "pulsar.fullname" . }}-{{ .Values.proxy.component }}"
|
name: "{{ template "pulsar.fullname" . }}-{{ .Values.proxy.component }}"
|
||||||
|
|||||||
89
charts/pulsar/templates/toolset-rbac.yaml
Normal file
89
charts/pulsar/templates/toolset-rbac.yaml
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
#
|
||||||
|
# Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
# or more contributor license agreements. See the NOTICE file
|
||||||
|
# distributed with this work for additional information
|
||||||
|
# regarding copyright ownership. The ASF licenses this file
|
||||||
|
# to you under the Apache License, Version 2.0 (the
|
||||||
|
# "License"); you may not use this file except in compliance
|
||||||
|
# with the License. You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing,
|
||||||
|
# software distributed under the License is distributed on an
|
||||||
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
# KIND, either express or implied. See the License for the
|
||||||
|
# specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
{{- if and .Values.rbac.enabled .Values.rbac.psp }}
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||||
|
kind: Role
|
||||||
|
metadata:
|
||||||
|
name: "{{ template "pulsar.fullname" . }}-{{ .Values.toolset.component }}"
|
||||||
|
namespace: {{ template "pulsar.namespace" . }}
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- policy
|
||||||
|
resourceNames:
|
||||||
|
- "{{ template "pulsar.fullname" . }}-{{ .Values.toolset.component }}"
|
||||||
|
resources:
|
||||||
|
- podsecuritypolicies
|
||||||
|
verbs:
|
||||||
|
- use
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: "{{ template "pulsar.fullname" . }}-{{ .Values.toolset.component }}"
|
||||||
|
namespace: {{ template "pulsar.namespace" . }}
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||||
|
kind: RoleBinding
|
||||||
|
metadata:
|
||||||
|
name: "{{ template "pulsar.fullname" . }}-{{ .Values.toolset.component }}"
|
||||||
|
namespace: {{ template "pulsar.namespace" . }}
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: Role
|
||||||
|
name: "{{ template "pulsar.fullname" . }}-{{ .Values.toolset.component }}"
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: "{{ template "pulsar.fullname" . }}-{{ .Values.toolset.component }}"
|
||||||
|
namespace: {{ template "pulsar.namespace" . }}
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: policy/v1beta1
|
||||||
|
kind: PodSecurityPolicy
|
||||||
|
metadata:
|
||||||
|
name: "{{ template "pulsar.fullname" . }}-{{ .Values.toolset.component }}"
|
||||||
|
namespace: {{ template "pulsar.namespace" . }}
|
||||||
|
spec:
|
||||||
|
readOnlyRootFilesystem: false
|
||||||
|
privileged: false
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
|
runAsUser:
|
||||||
|
rule: 'RunAsAny'
|
||||||
|
supplementalGroups:
|
||||||
|
ranges:
|
||||||
|
- max: 65535
|
||||||
|
min: 1
|
||||||
|
rule: MustRunAs
|
||||||
|
fsGroup:
|
||||||
|
rule: 'MustRunAs'
|
||||||
|
ranges:
|
||||||
|
- min: 1
|
||||||
|
max: 65535
|
||||||
|
seLinux:
|
||||||
|
rule: 'RunAsAny'
|
||||||
|
volumes:
|
||||||
|
- configMap
|
||||||
|
- emptyDir
|
||||||
|
- projected
|
||||||
|
- secret
|
||||||
|
- downwardAPI
|
||||||
|
- persistentVolumeClaim
|
||||||
|
{{- end}}
|
||||||
@ -56,6 +56,9 @@ spec:
|
|||||||
{{ toYaml .Values.toolset.tolerations | indent 8 }}
|
{{ toYaml .Values.toolset.tolerations | indent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
terminationGracePeriodSeconds: {{ .Values.toolset.gracePeriod }}
|
terminationGracePeriodSeconds: {{ .Values.toolset.gracePeriod }}
|
||||||
|
{{- if and .Values.rbac.enabled .Values.rbac.psp }}
|
||||||
|
serviceAccountName: "{{ template "pulsar.fullname" . }}-{{ .Values.proxy.component }}"
|
||||||
|
{{- end}}
|
||||||
containers:
|
containers:
|
||||||
- name: "{{ template "pulsar.fullname" . }}-{{ .Values.toolset.component }}"
|
- name: "{{ template "pulsar.fullname" . }}-{{ .Values.toolset.component }}"
|
||||||
image: "{{ .Values.images.broker.repository }}:{{ .Values.images.broker.tag }}"
|
image: "{{ .Values.images.broker.repository }}:{{ .Values.images.broker.tag }}"
|
||||||
@ -71,6 +74,10 @@ spec:
|
|||||||
bin/apply-config-from-env.py conf/bookkeeper.conf;
|
bin/apply-config-from-env.py conf/bookkeeper.conf;
|
||||||
{{- include "pulsar.toolset.zookeeper.tls.settings" . | nindent 10 }}
|
{{- include "pulsar.toolset.zookeeper.tls.settings" . | nindent 10 }}
|
||||||
sleep 10000000000
|
sleep 10000000000
|
||||||
|
{{- if and .Values.rbac.enabled .Values.rbac.psp }}
|
||||||
|
securityContext:
|
||||||
|
readOnlyRootFilesystem: false
|
||||||
|
{{- end }}
|
||||||
envFrom:
|
envFrom:
|
||||||
- configMapRef:
|
- configMapRef:
|
||||||
name: "{{ template "pulsar.fullname" . }}-{{ .Values.toolset.component }}"
|
name: "{{ template "pulsar.fullname" . }}-{{ .Values.toolset.component }}"
|
||||||
|
|||||||
89
charts/pulsar/templates/zookeeper-rbac.yaml
Normal file
89
charts/pulsar/templates/zookeeper-rbac.yaml
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
#
|
||||||
|
# Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
# or more contributor license agreements. See the NOTICE file
|
||||||
|
# distributed with this work for additional information
|
||||||
|
# regarding copyright ownership. The ASF licenses this file
|
||||||
|
# to you under the Apache License, Version 2.0 (the
|
||||||
|
# "License"); you may not use this file except in compliance
|
||||||
|
# with the License. You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing,
|
||||||
|
# software distributed under the License is distributed on an
|
||||||
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
# KIND, either express or implied. See the License for the
|
||||||
|
# specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
{{- if and .Values.rbac.enabled .Values.rbac.psp }}
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||||
|
kind: Role
|
||||||
|
metadata:
|
||||||
|
name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}"
|
||||||
|
namespace: {{ template "pulsar.namespace" . }}
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- policy
|
||||||
|
resourceNames:
|
||||||
|
- "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}"
|
||||||
|
resources:
|
||||||
|
- podsecuritypolicies
|
||||||
|
verbs:
|
||||||
|
- use
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}"
|
||||||
|
namespace: {{ template "pulsar.namespace" . }}
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||||
|
kind: RoleBinding
|
||||||
|
metadata:
|
||||||
|
name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}"
|
||||||
|
namespace: {{ template "pulsar.namespace" . }}
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: Role
|
||||||
|
name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}"
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}"
|
||||||
|
namespace: {{ template "pulsar.namespace" . }}
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: policy/v1beta1
|
||||||
|
kind: PodSecurityPolicy
|
||||||
|
metadata:
|
||||||
|
name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}"
|
||||||
|
namespace: {{ template "pulsar.namespace" . }}
|
||||||
|
spec:
|
||||||
|
readOnlyRootFilesystem: false
|
||||||
|
privileged: false
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
|
runAsUser:
|
||||||
|
rule: 'RunAsAny'
|
||||||
|
supplementalGroups:
|
||||||
|
ranges:
|
||||||
|
- max: 65535
|
||||||
|
min: 1
|
||||||
|
rule: MustRunAs
|
||||||
|
fsGroup:
|
||||||
|
rule: 'MustRunAs'
|
||||||
|
ranges:
|
||||||
|
- min: 1
|
||||||
|
max: 65535
|
||||||
|
seLinux:
|
||||||
|
rule: 'RunAsAny'
|
||||||
|
volumes:
|
||||||
|
- configMap
|
||||||
|
- emptyDir
|
||||||
|
- projected
|
||||||
|
- secret
|
||||||
|
- downwardAPI
|
||||||
|
- persistentVolumeClaim
|
||||||
|
{{- end}}
|
||||||
@ -98,6 +98,9 @@ spec:
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
terminationGracePeriodSeconds: {{ .Values.zookeeper.gracePeriod }}
|
terminationGracePeriodSeconds: {{ .Values.zookeeper.gracePeriod }}
|
||||||
|
{{- if and .Values.rbac.enabled .Values.rbac.psp }}
|
||||||
|
serviceAccountName: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}"
|
||||||
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}"
|
- name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}"
|
||||||
image: "{{ .Values.images.zookeeper.repository }}:{{ .Values.images.zookeeper.tag }}"
|
image: "{{ .Values.images.zookeeper.repository }}:{{ .Values.images.zookeeper.tag }}"
|
||||||
@ -136,6 +139,10 @@ spec:
|
|||||||
- configMapRef:
|
- configMapRef:
|
||||||
name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}"
|
name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}"
|
||||||
{{- if .Values.zookeeper.probe.readiness.enabled }}
|
{{- if .Values.zookeeper.probe.readiness.enabled }}
|
||||||
|
{{- if and .Values.rbac.enabled .Values.rbac.psp }}
|
||||||
|
securityContext:
|
||||||
|
readOnlyRootFilesystem: false
|
||||||
|
{{- end}}
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
exec:
|
exec:
|
||||||
command:
|
command:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user