Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions charts/cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ refer to the [CloudNativePG Documentation](https://cloudnative-pg.io/documentat
| cluster.monitoring.podMonitor.relabelings | list | `[]` | The list of relabelings for the PodMonitor. Applied to samples before scraping. |
| cluster.monitoring.prometheusRule.enabled | bool | `true` | Whether to enable the PrometheusRule automated alerts |
| cluster.monitoring.prometheusRule.excludeRules | list | `[]` | Exclude specified rules |
| cluster.podSecurityContext | object | `{}` | Configure the Pod Security Context. See: https://cloudnative-pg.io/documentation/preview/security/ |
| cluster.postgresGID | int | `-1` | The GID of the postgres user inside the image, defaults to 26 |
| cluster.postgresUID | int | `-1` | The UID of the postgres user inside the image, defaults to 26 |
| cluster.postgresql.ldap | object | `{}` | PostgreSQL LDAP configuration (see https://cloudnative-pg.io/documentation/current/postgresql_conf/#ldap-configuration) |
Expand All @@ -186,6 +187,7 @@ refer to the [CloudNativePG Documentation](https://cloudnative-pg.io/documentat
| cluster.priorityClassName | string | `""` | |
| cluster.resources | object | `{}` | Resources requirements of every generated Pod. Please refer to https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ for more information. We strongly advise you use the same setting for limits and requests so that your cluster pods are given a Guaranteed QoS. See: https://kubernetes.io/docs/concepts/workloads/pods/pod-qos/ |
| cluster.roles | list | `[]` | This feature enables declarative management of existing roles, as well as the creation of new roles if they are not already present in the database. See: https://cloudnative-pg.io/documentation/current/declarative_role_management/ |
| cluster.securityContext | object | `{}` | Configure Container Security Context. See: https://cloudnative-pg.io/documentation/preview/security/ |
| cluster.serviceAccountTemplate | object | `{}` | Configure the metadata of the generated service account |
| cluster.services | object | `{}` | Customization of service definitions. Please refer to https://cloudnative-pg.io/documentation/current/service_management/ |
| cluster.storage.size | string | `"8Gi"` | |
Expand Down
10 changes: 10 additions & 0 deletions charts/cluster/templates/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,16 @@ spec:
{{- toYaml . | nindent 4 }}
{{- end }}

{{- with .Values.cluster.podSecurityContext }}
podSecurityContext:
{{- toYaml . | nindent 4 }}
{{ end }}

{{- with .Values.cluster.securityContext }}
securityContext:
{{- toYaml . | nindent 4 }}
{{ end }}

monitoring:
enablePodMonitor: {{ and .Values.cluster.monitoring.enabled .Values.cluster.monitoring.podMonitor.enabled }}
disableDefaultQueries: {{ .Values.cluster.monitoring.disableDefaultQueries }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,18 @@ spec:
metadata:
annotations:
my-annotation: my-service-account
podSecurityContext:
runAsUser: 26
runAsGroup: 26
fsGroup: 26
supplementalGroups: [2000, 3000]
fsGroupChangePolicy: "OnRootMismatch"
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
add:
- NET_BIND_SERVICE
readOnlyRootFilesystem: true
runAsNonRoot: true
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,21 @@ cluster:
metadata:
annotations:
my-annotation: my-service-account
podSecurityContext:
runAsUser: 26
runAsGroup: 26
fsGroup: 26
supplementalGroups: [2000, 3000]
fsGroupChangePolicy: "OnRootMismatch"
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
add:
- NET_BIND_SERVICE
readOnlyRootFilesystem: true
runAsNonRoot: true

backups:
enabled: false
6 changes: 6 additions & 0 deletions charts/cluster/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@
}
}
},
"podSecurityContext": {
"type": "object"
},
"postgresGID": {
"type": "integer"
},
Expand Down Expand Up @@ -306,6 +309,9 @@
"roles": {
"type": "array"
},
"securityContext": {
"type": "object"
},
"serviceAccountTemplate": {
"type": "object"
},
Expand Down
8 changes: 8 additions & 0 deletions charts/cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,14 @@ cluster:
# -- Configure the metadata of the generated service account
serviceAccountTemplate: {}

# -- Configure the Pod Security Context.
# See: https://cloudnative-pg.io/documentation/preview/security/
podSecurityContext: {}

# -- Configure Container Security Context.
# See: https://cloudnative-pg.io/documentation/preview/security/
securityContext: {}

additionalLabels: {}
annotations: {}

Expand Down