From 41b576448af5a43b4b49692ea8c7fa6e0133eb18 Mon Sep 17 00:00:00 2001 From: DickPostma <108724920+DickPostma@users.noreply.github.com> Date: Tue, 15 Oct 2024 14:12:30 +0200 Subject: [PATCH] build: feat/previews-to-aks (#719) * feat/previews-to-aks * add slack mesage --------- Co-authored-by: DickPostma <(ID)+(username)@users.noreply.github.com> Co-authored-by: Morris Swertz Co-authored-by: marikaris --- .circleci/config.yml | 107 +++++++++---- .github/workflows/main.yml | 14 ++ build.gradle | 5 + ci/create_or_update_k8s-azure.sh | 39 +++++ ci/set_kubectl_config-azure.sh | 9 ++ helm-chart/.helmignore | 23 +++ helm-chart/Chart.yaml | 6 + helm-chart/templates/NOTES.txt | 22 +++ helm-chart/templates/_helpers.tpl | 62 ++++++++ helm-chart/templates/deployment.yaml | 92 +++++++++++ helm-chart/templates/hpa.yaml | 28 ++++ helm-chart/templates/ingress.yaml | 61 ++++++++ helm-chart/templates/pvc.yaml | 16 ++ helm-chart/templates/service.yaml | 15 ++ helm-chart/templates/serviceaccount.yaml | 12 ++ .../templates/tests/test-connection.yaml | 15 ++ helm-chart/values.yaml | 145 ++++++++++++++++++ 17 files changed, 644 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/main.yml create mode 100644 ci/create_or_update_k8s-azure.sh create mode 100644 ci/set_kubectl_config-azure.sh create mode 100644 helm-chart/.helmignore create mode 100644 helm-chart/Chart.yaml create mode 100644 helm-chart/templates/NOTES.txt create mode 100644 helm-chart/templates/_helpers.tpl create mode 100644 helm-chart/templates/deployment.yaml create mode 100644 helm-chart/templates/hpa.yaml create mode 100644 helm-chart/templates/ingress.yaml create mode 100644 helm-chart/templates/pvc.yaml create mode 100644 helm-chart/templates/service.yaml create mode 100644 helm-chart/templates/serviceaccount.yaml create mode 100644 helm-chart/templates/tests/test-connection.yaml create mode 100644 helm-chart/values.yaml diff --git a/.circleci/config.yml b/.circleci/config.yml index 727043ae7..b26a74c9d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,10 +6,40 @@ # version: 2.1 +parameters: + GHA_Actor: + type: string + default: "" + GHA_Event: + type: string + default: "" + GHA_Action: + type: string + default: "" + GHA_Meta: + type: string + default: "" + +orbs: + slack: circleci/slack@4.4.4 + +definitions: + build_config: &build_config + docker: + - image: molgenis/ci-build:1.2.3 + working_directory: ~/repo + resource_class: large + environment: + JVM_OPTS: -Xmx3200m + GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.workers.max=2" + TERM: dumb + + + jobs: build: docker: - - image: eclipse-temurin:17.0.12_7-jdk-jammy + - image: molgenis/ci-build:1.2.3 working_directory: ~/repo resource_class: large @@ -38,30 +68,6 @@ jobs: pwd echo "$CIRCLE_WORKING_DIRECTORY" - - run: - name: update package manager - command: apt-get update - - - run: - name: add packages for docker cli install - command: apt-get -y install gnupg lsb-release curl - - - run: - name: update packages again - command: apt-get update - - - run: - name: set repo keys for docker packages - command: curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg - - - run: - name: add repo for docker packages - command: echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null - - - run: - name: update package manager again - command: apt-get update - - run: name: Install Docker client command: apt-get -y install docker-ce docker-ce-cli containerd.io @@ -89,7 +95,7 @@ jobs: - run: name: Build Armadillo and R CICD image command: | - ./gradlew docker + ./gradlew docker ci ./docker/bin/prepare.bash ci - store_artifacts: @@ -134,6 +140,20 @@ jobs: dockerPush fi + - run: + name: deploy preview to Azure + command: | + if [ "${CIRCLE_BRANCH}" != "master" ]; then + export $( cat build/ci.properties | xargs ) + bash ci/set_kubectl_config-azure.sh + bash ci/create_or_update_k8s-azure.sh "preview-armadillo-pr-${CIRCLE_PULL_REQUEST##*/}" ${TAG_NAME} DELETE + curl -d "token=${SLACK_TOKEN}" \ + -d "text=*<${CIRCLE_PULL_REQUEST}|Circle-CI » Armadillo » Armadillo-Service » PR-${CIRCLE_PULL_REQUEST##*/} #${CIRCLE_BUILD_NUM}>* + PR Preview available on https://preview-armadillo-pr-${CIRCLE_PULL_REQUEST##*/}.dev.molgenis.org" \ + -d "channel=C0639V5KTCY" \ + -X POST https://slack.com/api/chat.postMessage + fi + - run: name: Make sure all images declared in docker-compose.yml are available and ready command: | @@ -197,8 +217,41 @@ jobs: docker images ls docker compose rm + delete-helm-preview: + environment: + GHA_PREVIEW_NR: << pipeline.parameters.GHA_Meta >> + + docker: + - image: molgenis/ci-build:1.2.3 + + working_directory: ~/repo + resource_class: large + + steps: + - checkout + - run: + name: delete preview on azure + command: | + export $( cat build/ci.properties | xargs ) + bash ci/set_kubectl_config-azure.sh + kubectl delete namespace preview-emx2-pr-${GHA_PREVIEW_NR} || true workflows: + version: 2 build-deploy: + unless: + equal: ["delete-pr-preview", << pipeline.parameters.GHA_Action >>] + jobs: + - build: + filters: + branches: + ignore: master + + delete_preview: + when: + equal: [ "delete-pr-preview", << pipeline.parameters.GHA_Action >> ] jobs: - - build + - delete-helm-preview + + + diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..522042333 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,14 @@ +on: + pull_request: + types: [ closed ] +jobs: + trigger-circleci: + runs-on: ubuntu-latest + steps: + - name: Trigger CircleCI delete_preview workflow + id: "delete-pr-preview" + uses: CircleCI-Public/trigger-circleci-pipeline-action@v1.2.0 + with: + GHA_Meta: ${{ github.event.number }} + env: + CCI_TOKEN: ${{ secrets.CCI_PREV_TOKEN }} diff --git a/build.gradle b/build.gradle index bea3046f0..d2058ac57 100644 --- a/build.gradle +++ b/build.gradle @@ -134,6 +134,11 @@ if (version.toString().endsWith('-SNAPSHOT')) { imageName = "docker.io/molgenis/molgenis-armadillo-snapshot" tagName = "${project.version.toString()}-${ext.hash}" } +task ci(type: WriteProperties) { + outputFile file('build/ci.properties') + property 'TAG_NAME', tagName +} + docker { name imageName tags 'latest', tagName diff --git a/ci/create_or_update_k8s-azure.sh b/ci/create_or_update_k8s-azure.sh new file mode 100644 index 000000000..752a0da3f --- /dev/null +++ b/ci/create_or_update_k8s-azure.sh @@ -0,0 +1,39 @@ +#this scripts takes arguments +NAME=$1 +TAG_NAME=$2 +DELETE=$3 + +echo "Using namespace $NAME" +echo "Using docker tag_name $TAG_NAME" +echo "Delete=$DELETE" + +REPO=molgenis/molgenis-armadillo +if [[ $TAG_NAME == *"SNAPSHOT"* ]]; then + REPO=molgenis/molgenis-armadillo-snapshot +fi +echo "Using repositorie $REPO" + +# delete if exists +# Create certs from environement +echo ${CERTDEVMOLGENIS_KEY} | base64 --decode >> /tmp/cert_key +echo ${CERTDEVMOLGENIS_PEM} | base64 --decode >> /tmp/cert_pem + +# wait for deletion to complete +kubectl delete namespace $NAME || true +sleep 15s +kubectl create namespace $NAME +kubectl create secret tls "dev.molgenis.org" --key /tmp/cert_key --cert /tmp/cert_pem -n ${NAME} + +helm upgrade --install ${NAME} ./helm-chart --namespace ${NAME} \ +--set ingress.hosts[0].paths[0].path=/ \ +--set ingress.hosts[0].paths[0].pathType=ImplementationSpecific \ +--set ingress.hosts[0].host=${NAME}.dev.molgenis.org \ +--set ingress.tls[0].host=${NAME}.dev.molgenis.org \ +--set ingress.tls[0].secretName=dev.molgenis.org \ +--set adminPassword=adminArmadillo! \ +--set image.tag=${TAG_NAME} \ +--set image.pullPolicy=Always \ + +rm /tmp/cert_key +rm /tmp/cert_pem + diff --git a/ci/set_kubectl_config-azure.sh b/ci/set_kubectl_config-azure.sh new file mode 100644 index 000000000..3074b025f --- /dev/null +++ b/ci/set_kubectl_config-azure.sh @@ -0,0 +1,9 @@ +KUBE_CLUSTER=$1 +KUBE_TOKEN=$2 + +echo " logging in to azure with service principal and get kube config" +az login --service-principal --tenant ${AZURE_SP_TENANT} -u ${AZURE_CLIENT_ID} -p ${AZURE_CLIENT_SECRET} +az aks get-credentials -g ${RESOURCE_GROUP} -n ${RESOURCE_GROUP} + +kubectl config set-cluster ${RESOURCE_GROUP} +kubectl config use-context ${RESOURCE_GROUP} diff --git a/helm-chart/.helmignore b/helm-chart/.helmignore new file mode 100644 index 000000000..0e8a0eb36 --- /dev/null +++ b/helm-chart/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/helm-chart/Chart.yaml b/helm-chart/Chart.yaml new file mode 100644 index 000000000..08dd1d535 --- /dev/null +++ b/helm-chart/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: armadillo +description: A Helm chart for Kubernetes +type: application +version: 0.1.0 +appVersion: "1.16.0" diff --git a/helm-chart/templates/NOTES.txt b/helm-chart/templates/NOTES.txt new file mode 100644 index 000000000..8868b0fde --- /dev/null +++ b/helm-chart/templates/NOTES.txt @@ -0,0 +1,22 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "armadillo.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "armadillo.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "armadillo.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "armadillo.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/helm-chart/templates/_helpers.tpl b/helm-chart/templates/_helpers.tpl new file mode 100644 index 000000000..f0dbad474 --- /dev/null +++ b/helm-chart/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "armadillo.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 "armadillo.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 "armadillo.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "armadillo.labels" -}} +helm.sh/chart: {{ include "armadillo.chart" . }} +{{ include "armadillo.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "armadillo.selectorLabels" -}} +app.kubernetes.io/name: {{ include "armadillo.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "armadillo.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "armadillo.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/helm-chart/templates/deployment.yaml b/helm-chart/templates/deployment.yaml new file mode 100644 index 000000000..079b8f2e7 --- /dev/null +++ b/helm-chart/templates/deployment.yaml @@ -0,0 +1,92 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "armadillo.fullname" . }} + labels: + {{- include "armadillo.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "armadillo.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "armadillo.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "armadillo.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 }} + volumeMounts: + - mountPath: /data + name: data + {{- if .Values.persistence.additionalMounts }} + {{- .Values.persistence.additionalMounts | toYaml | nindent 12 }} + {{- end }} + ports: + - name: http + containerPort: 8080 + protocol: TCP + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + env: + - name: SPRING_APPLICATION_JSON + value: {{.Values.config | toJson | quote}} + livenessProbe: + initialDelaySeconds: 30 + httpGet: + path: /actuator/health + port: http + readinessProbe: + httpGet: + path: /actuator/health + port: http + + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + volumes: + - name: data + {{- if .Values.persistence.enabled }} + persistentVolumeClaim: + claimName: {{ .Values.persistence.existingClaim | default (include "armadillo.fullname" .) }} + {{- else }} + emptyDir: { } + {{- end }} + {{- if .Values.persistence.additionalVolumes }} + {{- .Values.persistence.additionalVolumes | toYaml | nindent 8}} + {{- end }} + diff --git a/helm-chart/templates/hpa.yaml b/helm-chart/templates/hpa.yaml new file mode 100644 index 000000000..9dd91585c --- /dev/null +++ b/helm-chart/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "armadillo.fullname" . }} + labels: + {{- include "armadillo.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "armadillo.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/helm-chart/templates/ingress.yaml b/helm-chart/templates/ingress.yaml new file mode 100644 index 000000000..0cc6bd88f --- /dev/null +++ b/helm-chart/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "armadillo.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 }} + labels: + {{- include "armadillo.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/helm-chart/templates/pvc.yaml b/helm-chart/templates/pvc.yaml new file mode 100644 index 000000000..c9f902365 --- /dev/null +++ b/helm-chart/templates/pvc.yaml @@ -0,0 +1,16 @@ +{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }} +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: {{ include "armadillo.fullname" . }} + labels: + {{- include "armadillo.labels" . | nindent 4 }} +spec: + storageClassName: {{ .Values.persistence.storageClass }} + accessModes: + - {{ .Values.persistence.accessMode | quote }} + resources: + requests: + storage: {{ .Values.persistence.size | quote }} + {{- end }} + diff --git a/helm-chart/templates/service.yaml b/helm-chart/templates/service.yaml new file mode 100644 index 000000000..17d8162d5 --- /dev/null +++ b/helm-chart/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "armadillo.fullname" . }} + labels: + {{- include "armadillo.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "armadillo.selectorLabels" . | nindent 4 }} diff --git a/helm-chart/templates/serviceaccount.yaml b/helm-chart/templates/serviceaccount.yaml new file mode 100644 index 000000000..d41dba85a --- /dev/null +++ b/helm-chart/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "armadillo.serviceAccountName" . }} + labels: + {{- include "armadillo.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/helm-chart/templates/tests/test-connection.yaml b/helm-chart/templates/tests/test-connection.yaml new file mode 100644 index 000000000..6039ea2cc --- /dev/null +++ b/helm-chart/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "armadillo.fullname" . }}-test-connection" + labels: + {{- include "armadillo.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "armadillo.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml new file mode 100644 index 000000000..ce6e90b25 --- /dev/null +++ b/helm-chart/values.yaml @@ -0,0 +1,145 @@ +# Default values for armadillo. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + + +config: + armadillo: + docker-management-enabled: false + docker-run-in-container: true + container-prefix: 'dev-' + profiles: + - name: default + image: datashield/rock-base:latest + #host: rock-molgenis-rock.armadillo-rock.svc + host: rock-molgenis-rock.armadillo-rock.svc + port: 8085 + package-whitelist: + - dsBase + - resourcer + function-blacklist: [ ] + options: + datashield: + # the seed can only be 9 digits + seed: 342325352 + - name: xenon + image: datashield/rock-dolomite-xenon:latest + host: xenon-molgenis-xenon.armadillo-xenon.svc + port: 8085 + package-whitelist: + - dsBase + - resourcer + - dsMediation + - dsMTLBase + function-blacklist: [ ] + options: + datashield: + # the seed can only be 9 digits + seed: 342325352 + + +image: + repository: "molgenis/molgenis-armadillo-snapshot" + pullPolicy: Always + tag: "latest" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + + +serviceAccount: + # Specifies whether a service account should be created + create: false + # 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: "" + + + # datashield: + # profiles: + # - name: default + # environment: default + # whitelist: + # - dsBase + # options: + # datashield: + # seed: #random-generated-9-digits-number# + # rserve: + # environments: + # - name: default + # host: service.namespace.svc + # port: 6311 + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 8080 + +ingress: + enabled: true + className: "" + annotations: + kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: armadillo.dev.molgenis.org + paths: + - path: / + pathType: ImplementationSpecific + tls: + - host: armadillo.dev.molgenis.org + secretName: dev.molgenis.org + + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +persistence: + storageClass: "" + existingClaim: "" + enabled: true + accessMode: ReadWriteOnce + size: 800Mi + # if you need any additional volumes, you can define them here + additionalVolumes: [] + # if you need any additional volume mounts, you can define them here + additionalMounts: []