Skip to content
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
5 changes: 5 additions & 0 deletions .github/workflows/helm-charts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ jobs:
- name: Checkout source
uses: actions/checkout@v4.1.7

- name: Install chart dependencies
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
helm dependency update charts/${{ matrix.chart }}

- name: Package Chart
run: helm package charts/${{ matrix.chart }}

Expand Down
6 changes: 6 additions & 0 deletions charts/bundler/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: common
repository: oci://docker.io/bitnamicharts
version: 2.23.0
digest: sha256:c6a6a1cd877a7776095f62977d2fe441ee8b1145d624b6a57bc08dd52aa2611b
generated: "2024-09-17T10:12:41.346935619+01:00"
6 changes: 5 additions & 1 deletion charts/bundler/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ apiVersion: v2
name: bundler
description: A Open Policy Agent (OPA) Data Bundle Server providing permissionable data from ISPyB
type: application
version: 0.1.3
version: 0.2.0
appVersion: 0.0.10
maintainers:
- name: garryod
email: "garry.o'donnell@diamond.ac.uk"
dependencies:
- name: common
version: 2.23.0
repository: oci://docker.io/bitnamicharts
63 changes: 0 additions & 63 deletions charts/bundler/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,66 +1,3 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "bundler.name" -}}
{{- printf "%s-bundler" .Chart.Name | default .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "bundler.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := printf "%s-bundler" .Chart.Name | default .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "bundler.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "bundler.labels" -}}
helm.sh/chart: {{ include "bundler.chart" . }}
{{ include "bundler.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "bundler.selectorLabels" -}}
app.kubernetes.io/name: {{ include "bundler.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "bundler.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "bundler.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Create the database URL environment variable for use by the bundler
*/}}
Expand Down
13 changes: 7 additions & 6 deletions charts/bundler/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "bundler.fullname" . }}
name: {{ include "common.names.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "bundler.labels" . | nindent 4 }}
{{- include "common.labels.standard" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "bundler.selectorLabels" . | nindent 6 }}
{{- include "common.labels.matchLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "bundler.selectorLabels" . | nindent 8 }}
{{- include "common.labels.matchLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "bundler.serviceAccountName" . }}
serviceAccountName: {{ include "common.names.fullname" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ include "bundler.name" . }}
- name: bundler
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository}}:{{ default .Chart.AppVersion .Values.image.tag }}"
Expand Down
7 changes: 4 additions & 3 deletions charts/bundler/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "bundler.fullname" . }}
name: {{ include "common.names.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "bundler.labels" . | nindent 4 }}
{{- include "common.labels.standard" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "bundler.fullname" . }}
name: {{ include "common.names.fullname" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
Expand Down
31 changes: 7 additions & 24 deletions charts/bundler/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,17 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "bundler.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- 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}}
{{- end }}
{{- end }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}
name: {{ include "common.names.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "bundler.labels" . | nindent 4 }}
{{- include "common.labels.standard" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
{{- if .Values.ingress.className }}
ingressClassName: {{ .Values.ingress.className }}
{{- end }}
{{- if .Values.ingress.tls }}
Expand All @@ -43,19 +31,14 @@ spec:
paths:
{{- range .paths }}
- path: {{ .path }}
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
{{- if .pathType }}
pathType: {{ .pathType }}
{{- end }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ $fullName }}
name: {{ include "common.names.fullname" $ }}
port:
number: {{ $svcPort }}
{{- else }}
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end }}
number: {{ $.Values.service.port }}
{{- end }}
{{- end }}
{{- end }}
7 changes: 4 additions & 3 deletions charts/bundler/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "bundler.fullname" . }}
name: {{ include "common.names.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "bundler.labels" . | nindent 4 }}
{{- include "common.labels.standard" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
Expand All @@ -12,4 +13,4 @@ spec:
protocol: TCP
name: http
selector:
{{- include "bundler.selectorLabels" . | nindent 4 }}
{{- include "common.labels.matchLabels" . | nindent 4 }}
9 changes: 3 additions & 6 deletions charts/bundler/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "bundler.serviceAccountName" . }}
name: {{ include "common.names.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "bundler.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- include "common.labels.standard" . | nindent 4 }}
{{- end }}
6 changes: 3 additions & 3 deletions charts/bundler/templates/tests/test-connection.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "bundler.fullname" . }}-test-connection"
name: "{{ include "common.names.fullname" . }}-test-connection"
labels:
{{- include "bundler.labels" . | nindent 4 }}
{{- include "common.labels.standard" . | nindent 4 }}
annotations:
"helm.sh/hook": test
spec:
containers:
- name: wget
image: busybox
command: ['wget']
args: ['{{ include "bundler.fullname" . }}:{{ .Values.service.port }}']
args: ['{{ include "common.names.fullname" . }}:{{ .Values.service.port }}']
restartPolicy: Never
1 change: 1 addition & 0 deletions charts/opa/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
charts/*.tgz
6 changes: 6 additions & 0 deletions charts/opa/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: common
repository: oci://docker.io/bitnamicharts
version: 2.23.0
digest: sha256:c6a6a1cd877a7776095f62977d2fe441ee8b1145d624b6a57bc08dd52aa2611b
generated: "2024-09-17T11:46:38.801325647+01:00"
6 changes: 5 additions & 1 deletion charts/opa/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ apiVersion: v2
name: opa
description: An OPA deployment to run alongside applications requiring authorization
type: application
version: 0.3.1
version: 0.4.0
appVersion: 0.59.0
maintainers:
- name: garryod
email: "garry.o'donnell@diamond.ac.uk"
dependencies:
- name: common
version: 2.23.0
repository: oci://docker.io/bitnamicharts
63 changes: 0 additions & 63 deletions charts/opa/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,66 +1,3 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "opa.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "opa.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "opa.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "opa.labels" -}}
helm.sh/chart: {{ include "opa.chart" . }}
{{ include "opa.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "opa.selectorLabels" -}}
app.kubernetes.io/name: {{ include "opa.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "opa.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "opa.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Create the tag to be used to pull the chart
*/}}
Expand Down
12 changes: 6 additions & 6 deletions charts/opa/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "opa.fullname" . }}
name: {{ include "common.names.fullname" . }}
labels:
{{- include "opa.labels" . | nindent 4 }}
{{- include "common.labels.standard" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "opa.selectorLabels" . | nindent 6 }}
{{- include "common.labels.matchLabels" . | nindent 6 }}
template:
metadata:
annotations:
Expand All @@ -19,17 +19,17 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "opa.selectorLabels" . | nindent 8 }}
{{- include "common.labels.matchLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "opa.serviceAccountName" . }}
serviceAccountName: {{ include "common.names.fullname" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ include "opa.name" . }}
- name: opa
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ include "opa.imageTag" . }}"
Expand Down
Loading