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 securityContext for snipe-it deployment #173

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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: 1 addition & 1 deletion snipeit/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: snipeit
version: 3.3.0
version: 3.3.1
appVersion: 5.3.0
description: A free open source IT asset/license management system
keywords:
Expand Down
7 changes: 5 additions & 2 deletions snipeit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ and their default values.
| `ingress.enabled` | Whether or not to enable Ingress | `true` |
| `ingress.className` | Ingress Class Name | `""` |
| `ingress.annotations` | Custom Ingress Annotations | `{}` |
| `ingress.path` | Root Path for the Ingress Ressource | `/` |
| `ingress.path` | Root Path for the Ingress Resource | `/` |
| `ingress.hosts` | URL where Snipe-IT will be accessed | `example.local` |
| `ingress.tls` | Configuration for SecretName and TLS-Hosts | `[]` |
| `mysql.enabled` | Whether or not to deploy a MySQL Deployment | `true` |
Expand All @@ -90,7 +90,7 @@ and their default values.
| `deploymentStrategy` | Deployment strategy | `{ "type": "RollingUpdate" }` |
| `revisionHistoryLimit` | The number of old Replicas to keep to allow rollback. | `0` |
| `service.type` | Type of service to create | `ClusterIP` |
| `service.annotations` | Annotations of service to create | `{}` |
| `service.annotations` | Annotations of service to create | `{}` |
| `service.clusterIP` | Internal cluster service IP | `nil` |
| `service.loadBalancerIP` | IP address to assign to load balancer (if supported) | `nil` |
| `service.loadBalancerSourceRanges` | list of IP CIDRs allowed access to lb (if supported) | `[]` |
Expand All @@ -99,6 +99,9 @@ and their default values.
| `nodeSelector` | Node labels for pod assignment | `{}` |
| `tolerations` | Toleration labels for pod assignment | `[]` |
| `affinity` | Affinity settings for pod assignment | `{}` |
| `podSecurityContext` | Deployment's pods securityContext | `{}` |
| `securityContext` | Deployment's container securityContext | `{}` |
| `initContainer.securityContext` | Deployment's initContainer securityContext | `{}` |

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,

Expand Down
12 changes: 12 additions & 0 deletions snipeit/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ spec:
- name: config-data
image: busybox
command: ["sh", "-c", "find {{ .Values.persistence.sessions.mountPath }} -not -user 1000 -exec chown 1000 {} \\+"]
{{- if .Values.initContainer.securityContext }}
securityContext:
{{- toYaml .Values.initContainer.securityContext | nindent 12 }}
{{- end }}
volumeMounts:
- name: data
mountPath: {{ .Values.persistence.sessions.mountPath }}
Expand Down Expand Up @@ -67,6 +71,10 @@ spec:
resources:
{{ toYaml . | nindent 12 }}
{{- end }}
{{- if .Values.securityContext }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
{{- end }}
volumeMounts:
- name: data
mountPath: {{ .Values.persistence.www.mountPath }}
Expand Down Expand Up @@ -94,3 +102,7 @@ spec:
tolerations:
{{ toYaml . | indent 8 | trim }}
{{- end }}
{{- if .Values.podSecurityContext }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8}}
{{- end }}
7 changes: 7 additions & 0 deletions snipeit/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,10 @@ nodeSelector: {}
tolerations: []

affinity: {}

podSecurityContext: {}

securityContext: {}

initContainer:
securityContext: {}