Skip to content

Commit dd71323

Browse files
committed
Added helm charts for sp-next
1 parent 9c5ead6 commit dd71323

File tree

14 files changed

+331
-282
lines changed

14 files changed

+331
-282
lines changed
Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,52 @@
11
# Patterns to ignore when building packages.
22
# This supports shell glob matching, relative path matching, and
33
# negation (prefixed with !). Only one pattern per line.
4-
.DS_Store
5-
# Common VCS dirs
4+
5+
# Common VCS directories
66
.git/
77
.gitignore
88
.bzr/
99
.bzrignore
1010
.hg/
1111
.hgignore
1212
.svn/
13+
1314
# Common backup files
1415
*.swp
1516
*.bak
1617
*.tmp
1718
*.orig
1819
*~
20+
1921
# Various IDEs
2022
.project
2123
.idea/
2224
*.tmproj
2325
.vscode/
26+
*.code-workspace
27+
28+
# OS files
29+
.DS_Store
30+
Thumbs.db
31+
32+
# Helm-specific files
33+
.helmignore
34+
35+
# Documentation
36+
README.md
37+
NOTES.md
38+
39+
# CI/CD
40+
.github/
41+
.gitlab-ci.yml
42+
.travis.yml
43+
.circleci/
44+
45+
# Development files
46+
values-dev.yaml
47+
values-local.yaml
48+
*.test.yaml
49+
50+
# Temporary files
51+
tmp/
52+
temp/
Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,13 @@
11
apiVersion: v2
22
name: science-portal
3-
description: Science Portal Helm Chart
4-
icon: https://www.canfar.net/css/images/logo.png
5-
6-
# A chart can be either an 'application' or a 'library' chart.
7-
#
8-
# Application charts are a collection of templates that can be packaged into versioned archives
9-
# to be deployed.
10-
#
11-
# Library charts provide useful utilities or functions for the chart developer. They're included as
12-
# a dependency of application charts to inject those utilities and functions into the rendering
13-
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
3+
description: A Helm chart for Science Portal Next.js application
144
type: application
15-
16-
# Using 2.0.0 here to clearly indicate a major update from the previous 1.x.x versions.
17-
version: 2.0.0
18-
19-
# This is the version number of the application being deployed. This version number should be
20-
# incremented each time you make changes to the application. Versions are not expected to
21-
# follow Semantic Versioning. They should reflect the version the application is using.
22-
# It is recommended to use it with quotes.
23-
appVersion: "2.0.0"
5+
version: 0.1.0
6+
appVersion: "0.1.0"
7+
keywords:
8+
- nextjs
9+
- science-portal
10+
- web-application
11+
maintainers:
12+
- name: Science Portal Team
13+
home: https://github.com/opencadc/science-portal

helm/applications/canfar-next/science-portal/templates/NOTES.txt

Lines changed: 0 additions & 37 deletions
This file was deleted.

helm/applications/canfar-next/science-portal/templates/_helpers.tpl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ Expand the name of the chart.
77

88
{{/*
99
Create a default fully qualified app name.
10-
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11-
If release name contains chart name it will be used as a full name.
1210
*/}}
1311
{{- define "science-portal.fullname" -}}
1412
{{- if .Values.fullnameOverride }}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "science-portal.fullname" . }}
5+
labels:
6+
{{- include "science-portal.labels" . | nindent 4 }}
7+
data:
8+
# This ConfigMap can be used for non-sensitive configuration
9+
# For now, we're using environment variables directly in the deployment
10+
# Add any configuration files or non-sensitive data here

helm/applications/canfar-next/science-portal/templates/deployment.yaml

Lines changed: 65 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -11,55 +11,85 @@ spec:
1111
selector:
1212
matchLabels:
1313
{{- include "science-portal.selectorLabels" . | nindent 6 }}
14+
strategy:
15+
type: RollingUpdate
16+
rollingUpdate:
17+
maxSurge: 1
18+
maxUnavailable: 0
1419
template:
1520
metadata:
16-
{{- with .Values.podAnnotations }}
1721
annotations:
18-
{{- toYaml . | nindent 8 }}
19-
{{- end }}
20-
labels:
21-
{{- include "science-portal.labels" . | nindent 8 }}
22-
{{- with .Values.podLabels }}
22+
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
23+
{{- with .Values.podAnnotations }}
2324
{{- toYaml . | nindent 8 }}
2425
{{- end }}
26+
labels:
27+
{{- include "science-portal.selectorLabels" . | nindent 8 }}
2528
spec:
2629
{{- with .Values.imagePullSecrets }}
2730
imagePullSecrets:
2831
{{- toYaml . | nindent 8 }}
2932
{{- end }}
3033
serviceAccountName: {{ include "science-portal.serviceAccountName" . }}
31-
{{- with .Values.podSecurityContext }}
3234
securityContext:
33-
{{- toYaml . | nindent 8 }}
34-
{{- end }}
35+
{{- toYaml .Values.podSecurityContext | nindent 8 }}
3536
containers:
36-
- name: {{ .Chart.Name }}
37-
{{- with .Values.securityContext }}
38-
securityContext:
39-
{{- toYaml . | nindent 12 }}
40-
{{- end }}
41-
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
42-
imagePullPolicy: {{ .Values.image.pullPolicy }}
43-
ports:
44-
- name: http
45-
containerPort: {{ .Values.service.port }}
46-
protocol: TCP
47-
{{- with .Values.livenessProbe }}
48-
livenessProbe:
49-
{{- toYaml . | nindent 12 }}
50-
{{- end }}
51-
{{- with .Values.readinessProbe }}
52-
readinessProbe:
53-
{{- toYaml . | nindent 12 }}
54-
{{- end }}
55-
{{- with .Values.resources }}
56-
resources:
57-
{{- toYaml . | nindent 12 }}
58-
{{- end }}
59-
{{- with .Values.volumeMounts }}
60-
volumeMounts:
61-
{{- toYaml . | nindent 12 }}
37+
- name: {{ .Chart.Name }}
38+
securityContext:
39+
{{- toYaml .Values.securityContext | nindent 12 }}
40+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
41+
imagePullPolicy: {{ .Values.image.pullPolicy }}
42+
ports:
43+
- name: http
44+
containerPort: {{ .Values.service.targetPort }}
45+
protocol: TCP
46+
livenessProbe:
47+
{{- toYaml .Values.livenessProbe | nindent 12 }}
48+
readinessProbe:
49+
{{- toYaml .Values.readinessProbe | nindent 12 }}
50+
resources:
51+
{{- toYaml .Values.resources | nindent 12 }}
52+
env:
53+
{{- range .Values.env }}
54+
- name: {{ .name }}
55+
value: {{ .value | quote }}
6256
{{- end }}
57+
# OIDC Configuration
58+
- name: NEXT_OIDC_URI
59+
value: {{ .Values.oidc.uri | quote }}
60+
- name: NEXT_PUBLIC_OIDC_URI
61+
value: {{ .Values.oidc.uri | quote }}
62+
- name: NEXT_OIDC_CLIENT_ID
63+
value: {{ .Values.oidc.clientId | quote }}
64+
- name: NEXT_PUBLIC_OIDC_CLIENT_ID
65+
value: {{ .Values.oidc.clientId | quote }}
66+
- name: NEXT_OIDC_CALLBACK_URI
67+
value: {{ .Values.oidc.callbackUri | quote }}
68+
- name: NEXT_PUBLIC_OIDC_CALLBACK_URI
69+
value: {{ .Values.oidc.callbackUri | quote }}
70+
- name: NEXT_OIDC_REDIRECT_URI
71+
value: {{ .Values.oidc.redirectUri | quote }}
72+
- name: NEXT_PUBLIC_OIDC_REDIRECT_URI
73+
value: {{ .Values.oidc.redirectUri | quote }}
74+
- name: NEXT_OIDC_SCOPE
75+
value: {{ .Values.oidc.scope | quote }}
76+
- name: NEXT_PUBLIC_OIDC_SCOPE
77+
value: {{ .Values.oidc.scope | quote }}
78+
# Secrets from Kubernetes Secret
79+
- name: AUTH_SECRET
80+
valueFrom:
81+
secretKeyRef:
82+
name: {{ .Values.secrets.existingSecret }}
83+
key: {{ .Values.secrets.keys.authSecret }}
84+
- name: NEXT_OIDC_CLIENT_SECRET
85+
valueFrom:
86+
secretKeyRef:
87+
name: {{ .Values.secrets.existingSecret }}
88+
key: {{ .Values.secrets.keys.oidcClientSecret }}
89+
{{- with .Values.volumeMounts }}
90+
volumeMounts:
91+
{{- toYaml . | nindent 12 }}
92+
{{- end }}
6393
{{- with .Values.volumes }}
6494
volumes:
6595
{{- toYaml . | nindent 8 }}

helm/applications/canfar-next/science-portal/templates/httproute.yaml

Lines changed: 0 additions & 38 deletions
This file was deleted.

helm/applications/canfar-next/science-portal/templates/ingress.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ metadata:
1010
{{- toYaml . | nindent 4 }}
1111
{{- end }}
1212
spec:
13-
{{- with .Values.ingress.className }}
14-
ingressClassName: {{ . }}
13+
{{- if .Values.ingress.className }}
14+
ingressClassName: {{ .Values.ingress.className }}
1515
{{- end }}
1616
{{- if .Values.ingress.tls }}
1717
tls:
@@ -30,9 +30,7 @@ spec:
3030
paths:
3131
{{- range .paths }}
3232
- path: {{ .path }}
33-
{{- with .pathType }}
34-
pathType: {{ . }}
35-
{{- end }}
33+
pathType: {{ .pathType }}
3634
backend:
3735
service:
3836
name: {{ include "science-portal.fullname" $ }}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{{- if .Values.networkPolicy.enabled }}
2+
apiVersion: networking.k8s.io/v1
3+
kind: NetworkPolicy
4+
metadata:
5+
name: {{ include "science-portal.fullname" . }}
6+
labels:
7+
{{- include "science-portal.labels" . | nindent 4 }}
8+
spec:
9+
podSelector:
10+
matchLabels:
11+
{{- include "science-portal.selectorLabels" . | nindent 6 }}
12+
policyTypes:
13+
{{- toYaml .Values.networkPolicy.policyTypes | nindent 4 }}
14+
{{- with .Values.networkPolicy.ingress }}
15+
ingress:
16+
{{- toYaml . | nindent 4 }}
17+
{{- end }}
18+
{{- with .Values.networkPolicy.egress }}
19+
egress:
20+
{{- toYaml . | nindent 4 }}
21+
{{- end }}
22+
{{- end }}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{{- if .Values.podDisruptionBudget.enabled }}
2+
apiVersion: policy/v1
3+
kind: PodDisruptionBudget
4+
metadata:
5+
name: {{ include "science-portal.fullname" . }}
6+
labels:
7+
{{- include "science-portal.labels" . | nindent 4 }}
8+
spec:
9+
minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
10+
selector:
11+
matchLabels:
12+
{{- include "science-portal.selectorLabels" . | nindent 6 }}
13+
{{- end }}

0 commit comments

Comments
 (0)