File tree Expand file tree Collapse file tree 6 files changed +27
-10
lines changed Expand file tree Collapse file tree 6 files changed +27
-10
lines changed Original file line number Diff line number Diff line change 5454      {{- end }} 
5555        resources :
5656{{ toYaml .Values.resources | indent 10 }} 
57+         securityContext :
58+ {{ toYaml .Values.securityContext | indent 10 }} 
5759      {{- if .Values.imagePullSecrets }} 
5860      imagePullSecrets :
5961{{ toYaml .Values.imagePullSecrets | indent 8 }} 
Original file line number Diff line number Diff line change @@ -359,18 +359,24 @@ resources:
359359    cpu : 100m 
360360    memory : 250Mi 
361361
362+ securityContext :
363+   runAsUser : 1000 
364+   runAsNonRoot : true 
365+   readOnlyRootFilesystem : true 
366+   allowPrivilegeEscalation : false 
367+ 
362368#  Affinity for pod assignment
363369#  Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
364370affinity : {} 
365371
366- #  Tolerations for pod assignment
367- #  Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
368- tolerations : [] 
369- 
370372#  Node labels for pod assignment
371373#  Ref: https://kubernetes.io/docs/user-guide/node-selection/
372374nodeSelector : {} 
373375
376+ #  Tolerations for pod assignment
377+ #  Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
378+ tolerations : [] 
379+ 
374380controllerID :
375381  #  Specifies whether a controller ID should be defined for the operator
376382  #  Note, all postgres manifest must then contain the following annotation to be found by this operator
Original file line number Diff line number Diff line change @@ -354,18 +354,24 @@ resources:
354354    cpu : 100m 
355355    memory : 250Mi 
356356
357+ securityContext :
358+   runAsUser : 1000 
359+   runAsNonRoot : true 
360+   readOnlyRootFilesystem : true 
361+   allowPrivilegeEscalation : false 
362+ 
357363#  Affinity for pod assignment
358364#  Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
359365affinity : {} 
360366
361- #  Tolerations for pod assignment
362- #  Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
363- tolerations : [] 
364- 
365367#  Node labels for pod assignment
366368#  Ref: https://kubernetes.io/docs/user-guide/node-selection/
367369nodeSelector : {} 
368370
371+ #  Tolerations for pod assignment
372+ #  Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
373+ tolerations : [] 
374+ 
369375controllerID :
370376  #  Specifies whether a controller ID should be defined for the operator
371377  #  Note, all postgres manifest must then contain the following annotation to be found by this operator
Original file line number Diff line number Diff line change 4545    size : 1Gi 
4646#     storageClass: my-sc
4747#     iops: 1000  # for EBS gp3
48-   #    throughput: 250  # in MB/s for EBS gp3
48+ #      throughput: 250  # in MB/s for EBS gp3
4949  additionalVolumes :
5050    - name : empty 
5151      mountPath : /opt/empty 
Original file line number Diff line number Diff line change 3232          runAsUser : 1000 
3333          runAsNonRoot : true 
3434          readOnlyRootFilesystem : true 
35+           allowPrivilegeEscalation : false 
3536        env :
3637        #  provided additional ENV vars can overwrite individual config map entries
3738        - name : CONFIG_MAP_NAME 
Original file line number Diff line number Diff line change @@ -280,6 +280,9 @@ func (c *Cluster) generateConnectionPoolerPodTemplate(role PostgresRole) (
280280				},
281281			},
282282		},
283+ 		SecurityContext : & v1.SecurityContext {
284+ 			AllowPrivilegeEscalation : util .False (),
285+ 		},
283286	}
284287
285288	podTemplate  :=  & v1.PodTemplateSpec {
@@ -289,7 +292,6 @@ func (c *Cluster) generateConnectionPoolerPodTemplate(role PostgresRole) (
289292			Annotations : c .annotationsSet (c .generatePodAnnotations (spec )),
290293		},
291294		Spec : v1.PodSpec {
292- 			ServiceAccountName :            c .OpConfig .PodServiceAccountName ,
293295			TerminationGracePeriodSeconds : & gracePeriod ,
294296			Containers :                    []v1.Container {poolerContainer },
295297			// TODO: add tolerations to scheduler pooler on the same node 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments