set allowPrivilegeEscalation for deployment templates (#1328)
* set allowPrivilegeEscalation for deployment templates * securityContext of container, not pod * aligning * default service account for pooler
This commit is contained in:
parent
5ecb7b42e0
commit
ac2a00c45e
|
|
@ -54,6 +54,8 @@ spec:
|
||||||
{{- end }}
|
{{- end }}
|
||||||
resources:
|
resources:
|
||||||
{{ toYaml .Values.resources | indent 10 }}
|
{{ toYaml .Values.resources | indent 10 }}
|
||||||
|
securityContext:
|
||||||
|
{{ toYaml .Values.securityContext | indent 10 }}
|
||||||
{{- if .Values.imagePullSecrets }}
|
{{- if .Values.imagePullSecrets }}
|
||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
{{ toYaml .Values.imagePullSecrets | indent 8 }}
|
{{ toYaml .Values.imagePullSecrets | indent 8 }}
|
||||||
|
|
|
||||||
|
|
@ -359,18 +359,24 @@ resources:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
memory: 250Mi
|
memory: 250Mi
|
||||||
|
|
||||||
|
securityContext:
|
||||||
|
runAsUser: 1000
|
||||||
|
runAsNonRoot: true
|
||||||
|
readOnlyRootFilesystem: true
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
|
|
||||||
# Affinity for pod assignment
|
# Affinity for pod assignment
|
||||||
# Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
# Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||||
affinity: {}
|
affinity: {}
|
||||||
|
|
||||||
# Tolerations for pod assignment
|
|
||||||
# Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
|
||||||
tolerations: []
|
|
||||||
|
|
||||||
# Node labels for pod assignment
|
# Node labels for pod assignment
|
||||||
# Ref: https://kubernetes.io/docs/user-guide/node-selection/
|
# Ref: https://kubernetes.io/docs/user-guide/node-selection/
|
||||||
nodeSelector: {}
|
nodeSelector: {}
|
||||||
|
|
||||||
|
# Tolerations for pod assignment
|
||||||
|
# Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
||||||
|
tolerations: []
|
||||||
|
|
||||||
controllerID:
|
controllerID:
|
||||||
# Specifies whether a controller ID should be defined for the operator
|
# Specifies whether a controller ID should be defined for the operator
|
||||||
# Note, all postgres manifest must then contain the following annotation to be found by this operator
|
# Note, all postgres manifest must then contain the following annotation to be found by this operator
|
||||||
|
|
|
||||||
|
|
@ -354,18 +354,24 @@ resources:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
memory: 250Mi
|
memory: 250Mi
|
||||||
|
|
||||||
|
securityContext:
|
||||||
|
runAsUser: 1000
|
||||||
|
runAsNonRoot: true
|
||||||
|
readOnlyRootFilesystem: true
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
|
|
||||||
# Affinity for pod assignment
|
# Affinity for pod assignment
|
||||||
# Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
# Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||||
affinity: {}
|
affinity: {}
|
||||||
|
|
||||||
# Tolerations for pod assignment
|
|
||||||
# Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
|
||||||
tolerations: []
|
|
||||||
|
|
||||||
# Node labels for pod assignment
|
# Node labels for pod assignment
|
||||||
# Ref: https://kubernetes.io/docs/user-guide/node-selection/
|
# Ref: https://kubernetes.io/docs/user-guide/node-selection/
|
||||||
nodeSelector: {}
|
nodeSelector: {}
|
||||||
|
|
||||||
|
# Tolerations for pod assignment
|
||||||
|
# Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
||||||
|
tolerations: []
|
||||||
|
|
||||||
controllerID:
|
controllerID:
|
||||||
# Specifies whether a controller ID should be defined for the operator
|
# Specifies whether a controller ID should be defined for the operator
|
||||||
# Note, all postgres manifest must then contain the following annotation to be found by this operator
|
# Note, all postgres manifest must then contain the following annotation to be found by this operator
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ spec:
|
||||||
runAsUser: 1000
|
runAsUser: 1000
|
||||||
runAsNonRoot: true
|
runAsNonRoot: true
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
env:
|
env:
|
||||||
# provided additional ENV vars can overwrite individual config map entries
|
# provided additional ENV vars can overwrite individual config map entries
|
||||||
- name: CONFIG_MAP_NAME
|
- name: CONFIG_MAP_NAME
|
||||||
|
|
|
||||||
|
|
@ -280,6 +280,9 @@ func (c *Cluster) generateConnectionPoolerPodTemplate(role PostgresRole) (
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
SecurityContext: &v1.SecurityContext{
|
||||||
|
AllowPrivilegeEscalation: util.False(),
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
podTemplate := &v1.PodTemplateSpec{
|
podTemplate := &v1.PodTemplateSpec{
|
||||||
|
|
@ -289,7 +292,6 @@ func (c *Cluster) generateConnectionPoolerPodTemplate(role PostgresRole) (
|
||||||
Annotations: c.annotationsSet(c.generatePodAnnotations(spec)),
|
Annotations: c.annotationsSet(c.generatePodAnnotations(spec)),
|
||||||
},
|
},
|
||||||
Spec: v1.PodSpec{
|
Spec: v1.PodSpec{
|
||||||
ServiceAccountName: c.OpConfig.PodServiceAccountName,
|
|
||||||
TerminationGracePeriodSeconds: &gracePeriod,
|
TerminationGracePeriodSeconds: &gracePeriod,
|
||||||
Containers: []v1.Container{poolerContainer},
|
Containers: []v1.Container{poolerContainer},
|
||||||
// TODO: add tolerations to scheduler pooler on the same node
|
// TODO: add tolerations to scheduler pooler on the same node
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue