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 name override #67

Merged
merged 2 commits into from
Jun 13, 2022
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 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