Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the user to specify container securityContext. Fixes #97 #99 #100

Merged
merged 1 commit into from
Nov 21, 2023
Merged
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,5 @@ Configure your Infinispan cluster by specifying values in the `deploy.*` section
| `deploy.makeDataDirWritable` | Allows write access to the `data` directory for each Infinispan Server node. | false | Setting the value to `true` creates an initContainer that runs `chmod -R` on the `/opt/infinispan/server/data` directory and changes its permissions. |
| `deploy.monitoring.enabled` | Enable or disable `ServiceMonitor` functionality. | false | Users must have `monitoring-edit` role assigned by the admin to deploy the Helm chart with `ServiceMonitor` enabled. |
| `deploy.nameOverride` | Specifies a name for all Infinispan cluster resources. | Helm Chart release name | Configure a name for the created resources only if you need it to be different to the Helm Chart release name. |
| `deploy.securityContext` | Defines the securityContext settings used by the cluster's StatefulSet | `{}` | - |
| `deploy.infinispan` | Infinispan Server configuration. | - | You should not change the default socket bindings or the security realm and endpoints named "metrics". Modifying these default properties can result in unexpected behavior and loss of service. |
1 change: 1 addition & 0 deletions README.md.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,5 @@ Configure your {brandname} cluster by specifying values in the `deploy.*` sectio
| `deploy.makeDataDirWritable` | Allows write access to the `data` directory for each {brandname} Server node. | false | Setting the value to `true` creates an initContainer that runs `chmod -R` on the `/opt/infinispan/server/data` directory and changes its permissions. |
| `deploy.monitoring.enabled` | Enable or disable `ServiceMonitor` functionality. | false | Users must have `monitoring-edit` role assigned by the admin to deploy the Helm chart with `ServiceMonitor` enabled. |
| `deploy.nameOverride` | Specifies a name for all {brandname} cluster resources. | Helm Chart release name | Configure a name for the created resources only if you need it to be different to the Helm Chart release name. |
| `deploy.securityContext` | Defines the securityContext settings used by the cluster's StatefulSet | `{}` | - |
| `deploy.infinispan` | {brandname} Server configuration. | - | You should not change the default socket bindings or the security realm and endpoints named "metrics". Modifying these default properties can result in unexpected behavior and loss of service. |
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ You can also find field and value descriptions in the link:{helm_chart_readme}[{
|No default value.

|`deploy.container.libraries`
| Libraries to be downloaded before server startup. Specify multiple, space-separated artifacts represented as URLs or as Maven coordinates. Archive artifacts in .tar, .tar.gz or .zip formats will be extracted.
| Libraries to be downloaded before server startup. Specify multiple, space-separated artifacts represented as URLs or as Maven coordinates. Archive artifacts in .tar, .tar.gz or .zip formats will be extracted.
|No default value.

|`deploy.container.storage.ephemeral`
Expand Down Expand Up @@ -102,6 +102,10 @@ If you do not specify a port, the platform selects an available one.
|Allows write access to the `data` directory for each {brandname} Server node. |`false`
If you set the value to `true`, {brandname} creates an initContainer that runs `chmod -R` on the `/opt/infinispan/server/data` directory to change permissions.

|`deploy.securityContext`
|Configures the securityContext used by the StatefulSet pods. |`{}`
This can be used to change the group of mounted file systems. Set `securityContext.fsGroup` to `185` if you need to explicitly match the group owner for `/opt/infinispan/server/data` to the default {brandname}'s group

|`deploy.monitoring.enabled`
|Enable or disable monitoring using `ServiceMonitor`.
| `false` Users must have `monitoring-edit` role assigned by the admin to deploy the Helm chart with `ServiceMonitor` enabled.
Expand Down
8 changes: 7 additions & 1 deletion templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- if .Values.deploy.securityContext }}
securityContext:
{{- with .Values.deploy.securityContext }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
Expand Down Expand Up @@ -163,4 +169,4 @@ spec:
resources:
requests:
storage: {{ .Values.deploy.container.storage.size }}
{{- end }}
{{- end }}
7 changes: 7 additions & 0 deletions values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,13 @@
"null"
]
},
"securityContext": {
"description": "Defines the securityContext policy used by the cluster's StatefulSet.",
"type": [
"object",
"null"
]
},
"expose": {
"description": "Controls network access to Infinispan Server endpoints.",
"properties": {
Expand Down
7 changes: 7 additions & 0 deletions values.schema.json.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,13 @@
"null"
]
},
"securityContext": {
"description": "Defines the securityContext policy used by the cluster's StatefulSet.",
"type": [
"object",
"null"
]
},
"expose": {
"description": "Controls network access to {brandname} Server endpoints.",
"properties": {
Expand Down
5 changes: 4 additions & 1 deletion values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,12 @@ deploy:
tolerations: []

nodeAffinity: {}

nodeSelector: {}

securityContext:
fsGroup: 185

infinispan:
cacheContainer:
# [USER] Add cache, template, and counter configuration.
Expand Down
Loading