Skip to content

Commit

Permalink
Misc changes and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
blootsvoets committed Jul 21, 2022
1 parent 75b2512 commit 20ca1b4
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 72 deletions.
22 changes: 11 additions & 11 deletions charts/outcomes-dashboard-api/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ Create chart name and version as used by the chart label.
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Return true if a secret object should be created
*/}}
{{- define "outcomes-dashboard-api.createSecret" -}}
{{- if .Values.existingSecret }}
{{- else if .Values.existingSecret -}}
{{- else -}}
{{- true -}}
{{- end -}}
{{- end -}}

{{/*
Common labels
*/}}
Expand All @@ -49,14 +60,3 @@ Selector labels
app.kubernetes.io/name: {{ include "outcomes-dashboard-api.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "outcomes-dashboard-api.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "outcomes-dashboard-api.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
1 change: 0 additions & 1 deletion charts/outcomes-dashboard-api/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ spec:
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "outcomes-dashboard-api.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
Expand Down
14 changes: 8 additions & 6 deletions charts/outcomes-dashboard-api/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "outcomes-dashboard-api.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- $path := .Values.ingress.path -}}
{{- $hosts := .Values.ingress.hosts -}}
{{- $svcPort := .Values.service.port -}}
{{- $pathType := .Values.ingress.pathType -}}
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
Expand Down Expand Up @@ -38,13 +42,12 @@ spec:
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
- host: {{ . | quote }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
pathType: {{ .pathType }}
- path: {{ $path | quote }}
{{- if and $pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
pathType: {{ $pathType }}
{{- end }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
Expand All @@ -56,6 +59,5 @@ spec:
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
15 changes: 15 additions & 0 deletions charts/outcomes-dashboard-api/templates/secrets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if (include "outcomes-dashboard-api.createSecret" .) }}
apiVersion: v1
kind: Secret
metadata:
name: {{ template "outcomes-dashboard-api.fullname" . }}
labels:
{{- include "outcomes-dashboard-api.labels" . | nindent 4 }}
type: Opaque
data:
managementPortalClientId: {{ .Values.clientId | b64enc | quote }}
managementPortalClientSecret: {{ .Values.clientSecret | b64enc | quote }}
databaseUrl: {{ .Values.jdbc.url | b64enc | quote }}
databaseUser: {{ .Values.jdbc.user | b64enc | quote }}
databasePassword: {{ .Values.jdbc.password | b64enc | quote }}
{{- end -}}
48 changes: 30 additions & 18 deletions charts/outcomes-dashboard-api/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,29 +45,20 @@ ingress:
enabled: true
# -- Ingress class name
className: ""
# -- Annotations that define default ingress class, certificate issuer and session configuration
# -- Annotations that define default ingress class, certificate issuer
# @default -- check values.yaml
annotations:
nginx.ingress.kubernetes.io/affinity: cookie
nginx.ingress.kubernetes.io/affinity-mode: persistent
nginx.ingress.kubernetes.io/session-cookie-path: /rest-sources/
nginx.ingress.kubernetes.io/session-cookie-samesite: Strict
nginx.ingress.kubernetes.io/session-cookie-max-age: "900"
nginx.ingress.kubernetes.io/session-cookie-expires: "900"
kubernetes.io/ingress.class: nginx
cert-manager.io/cluster-issuer: letsencrypt-prod
# -- Path within the url structure
path: "/h2o/api($|/)(.*)"
pathType: ImplementationSpecific
# -- Hosts to accept requests from
hosts:
- # -- Host to accept requests from
host: chart-example.local
paths:
- # -- Path to resolve with this ingress
path: /
# -- Ingress path type
pathType: ImplementationSpecific
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
- localhost
tls:
# -- TLS Secret Name
secretName: radar-base-tls

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
Expand Down Expand Up @@ -97,3 +88,24 @@ tolerations: []

# -- Affinity labels for pod assignment
affinity: {}

existingSecret: ""

# -- Standard JAVA_OPTS that should be passed to this service
javaOpts: "-Xmx550m"
# -- OAuth2 client id
clientId: h2o_outcomes_dashboard_api
# -- OAuth2 client secret
clientSecret: secret

jdbc:
# -- JDBC Driver to connect to the database.
driver: org.postgresql.Driver
# -- JDBC Connection url of the database.
url: jdbc:postgresql://postgresql:5432/outcomes
# -- Username of the database
user: radarbase
# -- Password of the user
password: password
# -- JDBC dialect to use for JDBC Connection
dialect: org.hibernate.dialect.PostgreSQL10Dialect
3 changes: 0 additions & 3 deletions charts/outcomes-dashboard-webapp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ A Helm chart for Kubernetes
| imagePullSecrets | list | `[]` | |
| nameOverride | string | `""` | |
| fullnameOverride | string | `""` | |
| serviceAccount.create | bool | `true` | |
| serviceAccount.annotations | object | `{}` | |
| serviceAccount.name | string | `""` | |
| podAnnotations | object | `{}` | |
| podSecurityContext | object | `{}` | |
| securityContext | object | `{}` | |
Expand Down
11 changes: 0 additions & 11 deletions charts/outcomes-dashboard-webapp/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,3 @@ Selector labels
app.kubernetes.io/name: {{ include "outcomes-dashboard-webapp.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "outcomes-dashboard-webapp.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "outcomes-dashboard-webapp.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
1 change: 0 additions & 1 deletion charts/outcomes-dashboard-webapp/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ spec:
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "outcomes-dashboard-webapp.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
Expand Down
12 changes: 0 additions & 12 deletions charts/outcomes-dashboard-webapp/templates/serviceaccount.yaml

This file was deleted.

9 changes: 0 additions & 9 deletions charts/outcomes-dashboard-webapp/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@ imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

serviceAccount:
# Specifies whether a service account should be created
create: true
# Annotations to add to the service account
annotations: {}
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: ""

podAnnotations: {}

podSecurityContext: {}
Expand Down

0 comments on commit 20ca1b4

Please sign in to comment.