Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Add crystal library helm chart #379

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
7 changes: 5 additions & 2 deletions charts/xchemlab/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ dependencies:
- name: compound-library
repository: ""
version: 0.0.1
- name: crystal-library
repository: ""
version: 0.0.1
- name: pin-packing
repository: ""
version: 0.0.3
Expand Down Expand Up @@ -35,5 +38,5 @@ dependencies:
- name: oauth2-proxy
repository: oci://registry-1.docker.io/bitnamicharts
version: 3.7.4
digest: sha256:37e0bc3ab1b7e071e600dc4e8416c4e98bed058f54fec0b1ee7b488f2eabe8d7
generated: "2024-02-19T17:22:02.993010787Z"
digest: sha256:e2987ea5e22dfa308a63f6f5e029d90bbc3cbd1c926161a2b72aa23ff7605825
generated: "2024-03-05T14:33:24.387624369Z"
5 changes: 4 additions & 1 deletion charts/xchemlab/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.7.0
version: 0.8.0

dependencies:
- name: chimp-chomp
Expand All @@ -15,6 +15,9 @@ dependencies:
- name: compound-library
version: 0.0.1
condition: compound-library.enabled
- name: crystal-library
version: 0.0.1
condition: crystal-library.enabled
- name: pin-packing
version: 0.0.3
condition: pin-packing.enabled
Expand Down
2 changes: 1 addition & 1 deletion charts/xchemlab/charts/chimp-chomp/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ version: 0.0.3
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.0.5"
appVersion: "0.0.6"
2 changes: 1 addition & 1 deletion charts/xchemlab/charts/compound-library/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ version: 0.0.1
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.0.5"
appVersion: "0.0.6"
20 changes: 10 additions & 10 deletions charts/xchemlab/charts/compound-library/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "pinPacking.name" -}}
{{- define "compoundLibrary.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

Expand All @@ -10,7 +10,7 @@ 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 "pinPacking.fullname" -}}
{{- define "compoundLibrary.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
Expand All @@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name.
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "pinPacking.chart" -}}
{{- define "compoundLibrary.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "pinPacking.labels" -}}
helm.sh/chart: {{ include "pinPacking.chart" . }}
{{ include "pinPacking.selectorLabels" . }}
{{- define "compoundLibrary.labels" -}}
helm.sh/chart: {{ include "compoundLibrary.chart" . }}
{{ include "compoundLibrary.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
Expand All @@ -45,15 +45,15 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{{/*
Selector labels
*/}}
{{- define "pinPacking.selectorLabels" -}}
app.kubernetes.io/name: {{ include "pinPacking.name" . }}
{{- define "compoundLibrary.selectorLabels" -}}
app.kubernetes.io/name: {{ include "compoundLibrary.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "pinPacking.serviceAccountName" -}}
{{- define "compoundLibrary.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "xchemlab.fullname" .) .Values.serviceAccount.name }}
{{- else }}
Expand All @@ -64,7 +64,7 @@ Create the name of the service account to use
{{/*
Create the database URL string
*/}}
{{- define "pinPacking.databaseURL" -}}
{{- define "compoundLibrary.databaseURL" -}}
{{- $host_parts := urlParse .Values.database.host }}
{{- $raw_user_info := printf "%s:$DATABASE_PASSWORD" .Values.database.user }}
{{- $url_parts := set $host_parts "userinfo" $raw_user_info }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "pinPacking.fullname" . }}
name: {{ include "compoundLibrary.fullname" . }}
labels:
{{- include "pinPacking.labels" . | nindent 4 }}
{{- include "compoundLibrary.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "pinPacking.selectorLabels" . | nindent 6 }}
{{- include "compoundLibrary.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "pinPacking.selectorLabels" . | nindent 8 }}
{{- include "compoundLibrary.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "pinPacking.serviceAccountName" . }}
serviceAccountName: {{ include "compoundLibrary.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
Expand All @@ -40,7 +40,7 @@ spec:
name: {{ .Values.database.password.secretName }}
key: {{ .Values.database.password.secretKey }}
- name: DATABASE_URL
value: {{ include "pinPacking.databaseURL" . }}
value: {{ include "compoundLibrary.databaseURL" . }}
- name: OPA_URL
value: {{ tpl .Values.opa.url . }}
ports:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "pinPacking.fullname" . }}
name: {{ include "compoundLibrary.fullname" . }}
labels:
{{- include "pinPacking.labels" . | nindent 4 }}
{{- include "compoundLibrary.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
Expand All @@ -12,4 +12,4 @@ spec:
protocol: TCP
name: http
selector:
{{- include "pinPacking.selectorLabels" . | nindent 4 }}
{{- include "compoundLibrary.selectorLabels" . | nindent 4 }}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "pinPacking.serviceAccountName" . }}
name: {{ include "compoundLibrary.serviceAccountName" . }}
labels:
{{- include "pinPacking.labels" . | nindent 4 }}
{{- include "compoundLibrary.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand Down
15 changes: 15 additions & 0 deletions charts/xchemlab/charts/crystal-library/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v2
name: crystal-library
description: A service for crystals currently available in the XChem lab
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.0.6"
73 changes: 73 additions & 0 deletions charts/xchemlab/charts/crystal-library/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "crystalLibrary.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 "crystalLibrary.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 "crystalLibrary.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

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

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

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

{{/*
Create the database URL string
*/}}
{{- define "crystalLibrary.databaseURL" -}}
{{- $host_parts := urlParse .Values.database.host }}
{{- $raw_user_info := printf "%s:$DATABASE_PASSWORD" .Values.database.user }}
{{- $url_parts := set $host_parts "userinfo" $raw_user_info }}
{{- $raw_database_url := urlJoin $url_parts }}
{{- replace "$DATABASE_PASSWORD" "$(DATABASE_PASSWORD)" $raw_database_url }}
{{- end }}
63 changes: 63 additions & 0 deletions charts/xchemlab/charts/crystal-library/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "crystalLibrary.fullname" . }}
labels:
{{- include "crystalLibrary.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "crystalLibrary.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "crystalLibrary.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "crystalLibrary.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- serve
env:
- name: DATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.database.password.secretName }}
key: {{ .Values.database.password.secretKey }}
- name: DATABASE_URL
value: {{ include "crystalLibrary.databaseURL" . }}
- name: OPA_URL
value: {{ tpl .Values.opa.url . }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
protocol: TCP
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
15 changes: 15 additions & 0 deletions charts/xchemlab/charts/crystal-library/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "crystalLibrary.fullname" . }}
labels:
{{- include "crystalLibrary.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
{{- include "crystalLibrary.selectorLabels" . | nindent 4 }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "crystalLibrary.serviceAccountName" . }}
labels:
{{- include "crystalLibrary.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
Loading
Loading