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

IODEV-1762: Поправил securityContext для license #387

Merged
merged 1 commit into from
Jan 24, 2024
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
2 changes: 1 addition & 1 deletion charts/license/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type: application
description: A Helm chart for Kubernetes to deploy License service

version: 1.17.0
appVersion: 2.2.0
appVersion: 2.2.1

maintainers:
- name: 2gis
Expand Down
15 changes: 7 additions & 8 deletions charts/license/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ See the [documentation](https://docs.2gis.com/en/on-premise/architecture/service
| Name | Description | Value |
| ------------------ | ------------ | ------------------------- |
| `image.repository` | Repository. | `2gis-on-premise/license` |
| `image.tag` | Tag. | `2.2.0` |
| `image.tag` | Tag. | `2.2.1` |
| `image.pullPolicy` | Pull Policy. | `IfNotPresent` |

### License service application settings
Expand Down Expand Up @@ -107,13 +107,12 @@ See the [documentation](https://docs.2gis.com/en/on-premise/architecture/service

### TPM-related settings for license type 2

| Name | Description | Value |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| `tpm.securityContext` | Main container [security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/). Should enable access to the host TPM device (/dev/tpmrm0). | `{}` |
| `tpm.mountTPMDevice` | If TPM device should be mounted to the main container. Required if no TPM device plugin is used. Additionally, requires privileged access for the main container. | `false` |
| `tpm.pvcBind` | **Kubernetes PVC used to bind pod to the kubernetes node; not needed if FS persistence is used** | |
| `tpm.pvcBind.enable` | If PVC should be used to bind pod to the kubernetes node. | `false` |
| `tpm.pvcBind.storageClassName` | Storage class name. | `""` |
| Name | Description | Value |
| ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| `tpm.mountTPMDevice` | If TPM device should be mounted to the main container. Required if no TPM device plugin is used. Adds privileged access for the main container. | `false` |
| `tpm.pvcBind` | **Kubernetes PVC used to bind pod to the kubernetes node** | |
| `tpm.pvcBind.enable` | If PVC should be used to bind pod to the kubernetes node. | `false` |
| `tpm.pvcBind.storageClassName` | Storage class name. | `""` |

### **Custom Certificate Authority**

Expand Down
8 changes: 6 additions & 2 deletions charts/license/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,13 @@ spec:
{{- end }}
resources:
{{- toYaml .resources | nindent 12 }}
{{- if and (eq (include "license.type" $) "2") (not (empty .tpm.securityContext)) }}
{{- if eq (include "license.type" $) "2" }}
v-a-v marked this conversation as resolved.
Show resolved Hide resolved
securityContext:
{{- toYaml .tpm.securityContext | nindent 12 }}
runAsUser: 0
runAsGroup: 0
{{- if $.Values.tpm.mountTPMDevice }}
privileged: true
{{- end }}
{{- end }}
volumes:
- name: config
Expand Down
8 changes: 3 additions & 5 deletions charts/license/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ imagePullSecrets: []

image:
repository: 2gis-on-premise/license
tag: 2.2.0
tag: 2.2.1
pullPolicy: IfNotPresent

# @section License service application settings
Expand Down Expand Up @@ -152,14 +152,12 @@ persistence:

# @section TPM-related settings for license type 2

# @param tpm.securityContext Main container [security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/). Should enable access to the host TPM device (/dev/tpmrm0).
# @param tpm.mountTPMDevice If TPM device should be mounted to the main container. Required if no TPM device plugin is used. Additionally, requires privileged access for the main container.
# @extra tpm.pvcBind **Kubernetes PVC used to bind pod to the kubernetes node; not needed if FS persistence is used**
# @param tpm.mountTPMDevice If TPM device should be mounted to the main container. Required if no TPM device plugin is used. Adds privileged access for the main container.
# @extra tpm.pvcBind **Kubernetes PVC used to bind pod to the kubernetes node**
# @param tpm.pvcBind.enable If PVC should be used to bind pod to the kubernetes node.
# @param tpm.pvcBind.storageClassName Storage class name.

tpm:
securityContext: {}
mountTPMDevice: false
pvcBind:
enable: false
Expand Down