Skip to content

Commit

Permalink
Allow name override (#67)
Browse files Browse the repository at this point in the history
* Allow name override

This allows multiple instances to be installed in the same namespace.

Signed-off-by: Kevin Fox <Kevin.Fox@pnnl.gov>

* Fix ingress object.

Signed-off-by: Kevin Fox <Kevin.Fox@pnnl.gov>
  • Loading branch information
kfox1111 authored Jun 13, 2022
1 parent c9e1415 commit b45c4cc
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 16 deletions.
2 changes: 1 addition & 1 deletion shinyproxy/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: shinyproxy
description: A Helm chart to install Shinyproxy
type: application
version: 0.6.4
version: 0.6.5
appVersion: 2.6.1
8 changes: 8 additions & 0 deletions shinyproxy/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,11 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{- define "shinyproxy.resourcename" -}}
{{- if .Values.useReleaseName }}
{{- printf "%s" (include "shinyproxy.fullname" .) }}
{{- else }}
{{- printf "%s" "shinyproxy" }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion shinyproxy/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: shinyproxy
name: {{ include "shinyproxy.resourcename" . }}
labels:
{{- include "shinyproxy.labels" . | nindent 4 }}
data:
Expand Down
8 changes: 4 additions & 4 deletions shinyproxy/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Deployment
metadata:
labels:
{{- include "shinyproxy.labels" . | nindent 4 }}
name: shinyproxy
name: {{ include "shinyproxy.resourcename" . }}
spec:
replicas: 1
selector:
Expand Down Expand Up @@ -31,7 +31,7 @@ spec:
- name: SPRING_APPLICATION_JSON
valueFrom:
secretKeyRef:
name: shinyproxy
name: {{ include "shinyproxy.resourcename" . }}
key: secrets.json
volumeMounts:
- name: application-conf
Expand Down Expand Up @@ -63,8 +63,8 @@ spec:
initialDelaySeconds: 40
timeoutSeconds: 5
{{- end }}
serviceAccountName: shinyproxy
serviceAccountName: {{ include "shinyproxy.resourcename" . }}
volumes:
- name: application-conf
configMap:
name: shinyproxy
name: {{ include "shinyproxy.resourcename" . }}
2 changes: 1 addition & 1 deletion shinyproxy/templates/hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
{{- include "shinyproxy.labels" . | nindent 8 }}
spec:
restartPolicy: Never
serviceAccountName: shinyproxy
serviceAccountName: {{ include "shinyproxy.resourcename" . }}
containers:
- name: delete-user-pods
image: bitnami/kubectl:{{ .Capabilities.KubeVersion.Major }}.{{ .Capabilities.KubeVersion.Minor }}
Expand Down
5 changes: 3 additions & 2 deletions shinyproxy/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{{- if .Values.ingress.enabled -}}
{{- $name := include "shinyproxy.resourcename" . }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: shinyproxy
name: {{ include "shinyproxy.resourcename" . }}
labels:
{{- include "shinyproxy.labels" . | nindent 4 }}
annotations:
Expand All @@ -20,7 +21,7 @@ spec:
pathType: Prefix
backend:
service:
name: shinyproxy
name: {{ $name }}
port:
number: 8080
{{- end }}
Expand Down
10 changes: 5 additions & 5 deletions shinyproxy/templates/rbac.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: shinyproxy
name: {{ include "shinyproxy.resourcename" . }}
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: shinyproxy
name: {{ include "shinyproxy.resourcename" . }}
namespace: {{ default .Release.Namespace .Values.proxy.kubernetes.namespace }}
rules:
- apiGroups: [""] # "" indicates the core API group
Expand All @@ -19,13 +19,13 @@ rules:
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: shinyproxy
name: {{ include "shinyproxy.resourcename" . }}
namespace: {{ default .Release.Namespace .Values.proxy.kubernetes.namespace }}
subjects:
- kind: ServiceAccount
name: shinyproxy
name: {{ include "shinyproxy.resourcename" . }}
namespace: {{ .Release.Namespace }}
roleRef:
kind: Role
apiGroup: rbac.authorization.k8s.io
name: shinyproxy
name: {{ include "shinyproxy.resourcename" . }}
2 changes: 1 addition & 1 deletion shinyproxy/templates/secrets.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
kind: Secret
apiVersion: v1
metadata:
name: shinyproxy
name: {{ include "shinyproxy.resourcename" . }}
labels:
{{- include "shinyproxy.labels" . | nindent 4 }}
type: Opaque
Expand Down
2 changes: 1 addition & 1 deletion shinyproxy/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: Service
metadata:
name: shinyproxy
name: {{ include "shinyproxy.resourcename" . }}
labels:
{{- include "shinyproxy.labels" . | nindent 4 }}
{{- if .Values.proxy.service.annotations }}
Expand Down
1 change: 1 addition & 0 deletions shinyproxy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,4 @@ proxy:
cpu: 300m
memory: 800Mi
createUsersNamespace: false
useReleaseName: false

0 comments on commit b45c4cc

Please sign in to comment.