-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Helm chart and PR Deployments #9285
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,108 @@ | ||||||||||||||||||||||||||||||||||||||||||
name: Deploy PR to Kubernetes | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
on: | ||||||||||||||||||||||||||||||||||||||||||
pull_request: | ||||||||||||||||||||||||||||||||||||||||||
types: [opened, synchronize, reopened] | ||||||||||||||||||||||||||||||||||||||||||
workflow_run: | ||||||||||||||||||||||||||||||||||||||||||
workflows: ["tests"] | ||||||||||||||||||||||||||||||||||||||||||
branches: [main] | ||||||||||||||||||||||||||||||||||||||||||
types: | ||||||||||||||||||||||||||||||||||||||||||
- completed | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
jobs: | ||||||||||||||||||||||||||||||||||||||||||
deploy: | ||||||||||||||||||||||||||||||||||||||||||
runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||
environment: k8s | ||||||||||||||||||||||||||||||||||||||||||
concurrency: k8s-pr${{ github.event.pull_request.number }} | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
steps: | ||||||||||||||||||||||||||||||||||||||||||
- name: Checkout repository | ||||||||||||||||||||||||||||||||||||||||||
uses: actions/checkout@v3 | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
- name: Setup Helm | ||||||||||||||||||||||||||||||||||||||||||
uses: azure/setup-helm@v3 | ||||||||||||||||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||||||||||||||||
version: v3.15.0 | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
- name: Setup Kubectl | ||||||||||||||||||||||||||||||||||||||||||
uses: azure/setup-kubectl@v3 | ||||||||||||||||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||||||||||||||||
version: v1.30.1 | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+28
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tip Codebase Verification Update Kubectl Version in Workflow The Kubectl version Analysis chainValidate Kubectl setup. The action Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Check the latest Kubectl version and compare with v1.30.1.
# Test: Fetch the latest Kubectl version from the official Kubernetes site. Expect: The latest version should be greater than or equal to v1.30.1.
curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt
Length of output: 86 |
||||||||||||||||||||||||||||||||||||||||||
- name: Authenticate to Kubernetes cluster | ||||||||||||||||||||||||||||||||||||||||||
run: | | ||||||||||||||||||||||||||||||||||||||||||
mkdir -p $HOME/.kube | ||||||||||||||||||||||||||||||||||||||||||
echo "${{ secrets.KUBECONFIG }}" > $HOME/.kube/config | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+33
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Address shell script issues flagged by static analysis. The script for setting up the Kubernetes configuration file should properly quote the variable to avoid globbing and word splitting issues. Apply this diff to address the shell script issues: - echo "${{ secrets.KUBECONFIG }}" > $HOME/.kube/config
+ echo "${{ secrets.KUBECONFIG }}" > "$HOME/.kube/config" Committable suggestion
Suggested change
Toolsactionlint
|
||||||||||||||||||||||||||||||||||||||||||
- name: Get branch name | ||||||||||||||||||||||||||||||||||||||||||
id: branch | ||||||||||||||||||||||||||||||||||||||||||
run: echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV | ||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix potential shell script issue. The environment variable Apply this diff to fix the potential shell script issue: - echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
+ echo "BRANCH_NAME=\"${GITHUB_REF#refs/heads/}\"" >> $GITHUB_ENV Committable suggestion
Suggested change
Toolsactionlint
|
||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
- name: Determine tag | ||||||||||||||||||||||||||||||||||||||||||
id: determine-tag | ||||||||||||||||||||||||||||||||||||||||||
run: | | ||||||||||||||||||||||||||||||||||||||||||
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | ||||||||||||||||||||||||||||||||||||||||||
SEM_VERSION="${GITHUB_REF#refs/tags/}" | ||||||||||||||||||||||||||||||||||||||||||
elif [[ "${GITHUB_REF}" == refs/pull/* ]]; then | ||||||||||||||||||||||||||||||||||||||||||
PR_NUMBER=$(echo "${GITHUB_REF}" | sed -n 's|refs/pull/\([0-9]\+\)/.*|\1|p') | ||||||||||||||||||||||||||||||||||||||||||
SEM_VERSION="0.0.0-pr${PR_NUMBER}" | ||||||||||||||||||||||||||||||||||||||||||
else | ||||||||||||||||||||||||||||||||||||||||||
SEM_VERSION="0.0.0-${{ env.BRANCH_NAME }}" | ||||||||||||||||||||||||||||||||||||||||||
fi | ||||||||||||||||||||||||||||||||||||||||||
echo "SEM_VERSION=${SEM_VERSION}" >> $GITHUB_ENV | ||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+43
to
+52
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure proper quoting in shell scripts. The script determining the semantic version ( Apply this diff to ensure proper quoting: - echo "SEM_VERSION=${SEM_VERSION}" >> $GITHUB_ENV
+ echo "SEM_VERSION=\"${SEM_VERSION}\"" >> $GITHUB_ENV Committable suggestion
Suggested change
Toolsactionlint
|
||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
- name: Update chart dependencies | ||||||||||||||||||||||||||||||||||||||||||
run: helm dependency update helm/artemis | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
- name: Chart | Push | ||||||||||||||||||||||||||||||||||||||||||
uses: appany/[email protected] | ||||||||||||||||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||||||||||||||||
name: artemis | ||||||||||||||||||||||||||||||||||||||||||
repository: ${{ github.repository_owner }}/helm | ||||||||||||||||||||||||||||||||||||||||||
tag: ${{ env.SEM_VERSION }} | ||||||||||||||||||||||||||||||||||||||||||
path: helm/artemis | ||||||||||||||||||||||||||||||||||||||||||
registry: ghcr.io | ||||||||||||||||||||||||||||||||||||||||||
registry_username: ${{ github.repository_owner }} | ||||||||||||||||||||||||||||||||||||||||||
registry_password: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||||||||||||||||||||||
update_dependencies: 'true' | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
- name: Deploy Helm chart | ||||||||||||||||||||||||||||||||||||||||||
run: | | ||||||||||||||||||||||||||||||||||||||||||
helm upgrade --install artemis \ | ||||||||||||||||||||||||||||||||||||||||||
oci://ghcr.io/${{ github.repository_owner }}/helm/artemis --version ${{ env.SEM_VERSION }} \ | ||||||||||||||||||||||||||||||||||||||||||
--namespace artemis-pr${{ github.event.pull_request.number }} --create-namespace \ | ||||||||||||||||||||||||||||||||||||||||||
--set artemis.ingress.className="" \ | ||||||||||||||||||||||||||||||||||||||||||
--set artemis.ingress.annotations.cert-manager\\.io/cluster-issuer="letsencrypt-prod" \ | ||||||||||||||||||||||||||||||||||||||||||
--set artemis.ingress.annotations.spec\\.ingressClassName=nginx \ | ||||||||||||||||||||||||||||||||||||||||||
--set-string artemis.ingress.annotations.kubernetes\\.io/tls-acme="true" \ | ||||||||||||||||||||||||||||||||||||||||||
--set-string artemis.ingress.annotations.nginx\\.ingress\\.kubernetes\\.io/ssl-redirect="true" \ | ||||||||||||||||||||||||||||||||||||||||||
--set artemis.ingress.hosts[0].host=pr${{ github.event.pull_request.number }}.artemis-k8s.ase.cit.tum.de \ | ||||||||||||||||||||||||||||||||||||||||||
--set artemis.ingress.hosts[0].paths[0].path="/" \ | ||||||||||||||||||||||||||||||||||||||||||
--set artemis.ingress.hosts[0].paths[0].pathType=ImplementationSpecific \ | ||||||||||||||||||||||||||||||||||||||||||
--set artemis.ingress.tls[0].secretName=artemis-pr${{ github.event.pull_request.number }}-tls \ | ||||||||||||||||||||||||||||||||||||||||||
--set artemis.ingress.tls[0].hosts[0]=pr${{ github.event.pull_request.number }}.artemis-k8s.ase.cit.tum.de \ | ||||||||||||||||||||||||||||||||||||||||||
--set application.registry.jwt=${{ secrets.REGISTRY_JWT }} \ | ||||||||||||||||||||||||||||||||||||||||||
--set application.versioncontrol.url="https://pr${{ github.event.pull_request.number }}.artemis-k8s.ase.cit.tum.de" \ | ||||||||||||||||||||||||||||||||||||||||||
--set application.userManagement.internalAdmin.username=admin \ | ||||||||||||||||||||||||||||||||||||||||||
--set application.userManagement.internalAdmin.password=${{ secrets.ADMIN_PW }} \ | ||||||||||||||||||||||||||||||||||||||||||
--set artemisVersion=pr-${{ github.event.pull_request.number }} \ | ||||||||||||||||||||||||||||||||||||||||||
--wait | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
- name: Post Deployment Comment | ||||||||||||||||||||||||||||||||||||||||||
uses: actions/github-script@v6 | ||||||||||||||||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||||||||||||||||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||||||||||||||||||||||
script: | | ||||||||||||||||||||||||||||||||||||||||||
const prNumber = context.issue.number; | ||||||||||||||||||||||||||||||||||||||||||
const branchName = process.env.BRANCH_NAME; | ||||||||||||||||||||||||||||||||||||||||||
const semVersion = process.env.SEM_VERSION; | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
github.rest.issues.createComment({ | ||||||||||||||||||||||||||||||||||||||||||
...context.repo, | ||||||||||||||||||||||||||||||||||||||||||
issue_number: prNumber, | ||||||||||||||||||||||||||||||||||||||||||
body: ` | ||||||||||||||||||||||||||||||||||||||||||
:rocket: Deployed **PR #${prNumber}** to https://pr${prNumber}.artemis-k8s.ase.cit.tum.de | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
:hourglass_flowing_sand: It might take up to **10 minutes** to fully start up. | ||||||||||||||||||||||||||||||||||||||||||
` | ||||||||||||||||||||||||||||||||||||||||||
}); |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,40 @@ | ||||||||||||||||||||
name: Deploy PR to Kubernetes | ||||||||||||||||||||
|
||||||||||||||||||||
Comment on lines
+1
to
+2
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Workflow name is misleading. The name of the workflow is "Deploy PR to Kubernetes," which is misleading as this workflow is designed to delete resources when a PR is closed. Consider renaming it to better reflect its purpose, such as "Delete PR Deployment from Kubernetes." |
||||||||||||||||||||
on: | ||||||||||||||||||||
pull_request: | ||||||||||||||||||||
types: [closed] | ||||||||||||||||||||
workflow_run: | ||||||||||||||||||||
workflows: ["tests"] | ||||||||||||||||||||
branches: [main] | ||||||||||||||||||||
types: | ||||||||||||||||||||
- completed | ||||||||||||||||||||
|
||||||||||||||||||||
jobs: | ||||||||||||||||||||
destroy: | ||||||||||||||||||||
runs-on: ubuntu-latest | ||||||||||||||||||||
environment: k8s | ||||||||||||||||||||
concurrency: k8s-pr${{ github.event.pull_request.number }} | ||||||||||||||||||||
|
||||||||||||||||||||
steps: | ||||||||||||||||||||
- name: Setup Helm | ||||||||||||||||||||
uses: azure/setup-helm@v3 | ||||||||||||||||||||
with: | ||||||||||||||||||||
version: v3.15.0 | ||||||||||||||||||||
|
||||||||||||||||||||
- name: Setup Kubectl | ||||||||||||||||||||
uses: azure/setup-kubectl@v3 | ||||||||||||||||||||
with: | ||||||||||||||||||||
version: v1.30.1 | ||||||||||||||||||||
|
||||||||||||||||||||
- name: Authenticate to Kubernetes cluster | ||||||||||||||||||||
run: | | ||||||||||||||||||||
mkdir -p $HOME/.kube | ||||||||||||||||||||
echo "${{ secrets.KUBECONFIG }}" > $HOME/.kube/config | ||||||||||||||||||||
|
||||||||||||||||||||
Comment on lines
+29
to
+33
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix shell script for security and stability. The script lacks double quotes around the Apply this diff to fix the shell script: -echo "${{ secrets.KUBECONFIG }}" > $HOME/.kube/config
+echo "${{ secrets.KUBECONFIG }}" > "$HOME/.kube/config" Committable suggestion
Suggested change
Toolsactionlint
|
||||||||||||||||||||
- name: Delete Helm release | ||||||||||||||||||||
run: | | ||||||||||||||||||||
helm uninstall artemis --namespace artemis-pr${{ github.event.pull_request.number }} | ||||||||||||||||||||
|
||||||||||||||||||||
- name: Delete Kubernetes namespace | ||||||||||||||||||||
run: | | ||||||||||||||||||||
kubectl delete namespace artemis-pr${{ github.event.pull_request.number }} |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,47 @@ | ||||||||||||||||||||||||||||||||||||||
name: Build and Push Helm Chart | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
on: | ||||||||||||||||||||||||||||||||||||||
push: | ||||||||||||||||||||||||||||||||||||||
branches: | ||||||||||||||||||||||||||||||||||||||
- '*' | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
jobs: | ||||||||||||||||||||||||||||||||||||||
build-and-push: | ||||||||||||||||||||||||||||||||||||||
runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
steps: | ||||||||||||||||||||||||||||||||||||||
- name: Checkout repository | ||||||||||||||||||||||||||||||||||||||
uses: actions/checkout@v3 | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
- name: Setup Helm | ||||||||||||||||||||||||||||||||||||||
uses: azure/setup-helm@v3 | ||||||||||||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||||||||||||
version: v3.15.0 | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
- name: Get branch name | ||||||||||||||||||||||||||||||||||||||
id: branch | ||||||||||||||||||||||||||||||||||||||
run: echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV | ||||||||||||||||||||||||||||||||||||||
Comment on lines
+21
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix potential shell script issues. The script uses unquoted variables which can lead to word splitting and globbing issues. Consider quoting the variables to avoid these problems. Apply this diff to fix the shell script: -echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
+echo "BRANCH_NAME=\"${GITHUB_REF#refs/heads/}\"" >> $GITHUB_ENV Committable suggestion
Suggested change
Toolsactionlint
|
||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
- name: Determine tag | ||||||||||||||||||||||||||||||||||||||
id: determine-tag | ||||||||||||||||||||||||||||||||||||||
run: | | ||||||||||||||||||||||||||||||||||||||
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | ||||||||||||||||||||||||||||||||||||||
SEM_VERSION="${GITHUB_REF#refs/tags/}" | ||||||||||||||||||||||||||||||||||||||
else | ||||||||||||||||||||||||||||||||||||||
SEM_VERSION="0.0.0-${{ env.BRANCH_NAME }}" | ||||||||||||||||||||||||||||||||||||||
fi | ||||||||||||||||||||||||||||||||||||||
echo "SEM_VERSION=${SEM_VERSION}" >> $GITHUB_ENV | ||||||||||||||||||||||||||||||||||||||
Comment on lines
+25
to
+33
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix potential shell script issues in semantic version determination. The script uses unquoted variables which can lead to word splitting and globbing issues. Consider quoting the variables to avoid these problems. Apply this diff to fix the shell script: -if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
+if [[ "${GITHUB_REF}" == "refs/tags/*" ]]; then
SEM_VERSION="${GITHUB_REF#refs/tags/}"
-else
+else
SEM_VERSION="0.0.0-${{ env.BRANCH_NAME }}"
-fi
+fi
echo "SEM_VERSION=${SEM_VERSION}" >> $GITHUB_ENV Committable suggestion
Suggested change
Toolsactionlint
|
||||||||||||||||||||||||||||||||||||||
- name: Update chart dependencies | ||||||||||||||||||||||||||||||||||||||
run: helm dependency update helm/artemis | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
- name: Chart | Push | ||||||||||||||||||||||||||||||||||||||
uses: appany/[email protected] | ||||||||||||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||||||||||||
name: artemis | ||||||||||||||||||||||||||||||||||||||
repository: ${{ github.repository_owner }}/helm | ||||||||||||||||||||||||||||||||||||||
tag: ${{ env.SEM_VERSION }} | ||||||||||||||||||||||||||||||||||||||
path: helm/artemis | ||||||||||||||||||||||||||||||||||||||
registry: ghcr.io | ||||||||||||||||||||||||||||||||||||||
registry_username: ${{ github.repository_owner }} | ||||||||||||||||||||||||||||||||||||||
registry_password: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||||||||||||||||||
update_dependencies: 'true' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
charts |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
dependencies: | ||
- name: prometheus-adapter | ||
repository: https://prometheus-community.github.io/helm-charts | ||
version: 3.4.1 | ||
- name: prometheus | ||
repository: https://prometheus-community.github.io/helm-charts | ||
version: 15.18.0 | ||
digest: sha256:9eb272bb161e9a4bf9fff7ec31a7719664ff2dce11e28be0d94a83bded0cffa1 | ||
generated: "2024-08-10T17:33:10.801079972+02:00" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
apiVersion: v2 | ||
name: artemis | ||
description: A Helm chart for Artemis | ||
|
||
# A chart can be either an 'application' or a 'library' chart. | ||
# | ||
# Application charts are a collection of templates that can be packaged into versioned archives | ||
# to be deployed. | ||
# | ||
# Library charts provide useful utilities or functions for the chart developer. They're included as | ||
# a dependency of application charts to inject those utilities and functions into the rendering | ||
# pipeline. Library charts do not define any templates and therefore cannot be deployed. | ||
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/) | ||
#TODO: figure out how and when this is updated | ||
version: 0.1.2 | ||
|
||
# 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: "5.5.7" | ||
|
||
|
||
sources: | ||
- https://github.com/ls1intum/Artemis | ||
- https://github.com/ls1intum/artemis-helm | ||
|
||
maintainers: | ||
- name: Matthias Linhuber | ||
email: [email protected] | ||
|
||
icon: "https://github.com/ls1intum/Artemis/blob/develop/src/main/resources/public/images/logo.png" | ||
|
||
dependencies: | ||
- name: prometheus-adapter | ||
repository: https://prometheus-community.github.io/helm-charts | ||
version: 3.4.1 | ||
condition: artemis.autoscaler.customPrometheus | ||
- name: prometheus | ||
repository: https://prometheus-community.github.io/helm-charts | ||
version: 15.18.0 | ||
condition: artemis.autoscaler.customPrometheus |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
1. Get the application URL by running these commands: | ||
{{- if .Values.artemis.ingress.enabled }} | ||
{{- range $host := .Values.artemis.ingress.hosts }} | ||
{{- range .paths }} | ||
http{{ if $.Values.artemis.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} | ||
{{- end }} | ||
{{- end }} | ||
{{- else if contains "NodePort" .Values.artemis.service.type }} | ||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "artemis.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.artemis.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 "artemis.fullname" . }}' | ||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "artemis.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") | ||
echo http://$SERVICE_IP:{{ .Values.artemis.service.port }} | ||
{{- else if contains "ClusterIP" .Values.artemis.service.type }} | ||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "artemis.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 }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "artemis.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 "artemis.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 "artemis.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "artemis.labels" -}} | ||
helm.sh/chart: {{ include "artemis.chart" . }} | ||
{{ include "artemis.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "artemis.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "artemis.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "artemis.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "artemis.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
|
||
{{/* | ||
Generate common Artemis java spring profiles | ||
*/}} | ||
{{- define "artemis.springprofiles" -}} | ||
prod,artemis,decoupling | ||
{{- if .Values.application.userManagement.provider -}} | ||
,{{ .Values.application.userManagement.provider }} | ||
{{- end }} | ||
{{- if .Values.application.userManagement.ldap.enabled -}} | ||
,ldap | ||
{{- end }} | ||
{{- if .Values.application.versioncontrol.provider -}} | ||
,{{ .Values.application.versioncontrol.provider }} | ||
{{- end }} | ||
{{- if .Values.application.continuousintegration.provider -}} | ||
,{{ .Values.application.continuousintegration.provider }} | ||
{{- end }} | ||
{{- end }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tip
Codebase Verification
Update Helm Version in Workflow
The Helm version specified in the workflow (
v3.15.0
) is outdated. The latest stable release isv3.15.4
. It is recommended to update to the latest version to ensure compatibility and security updates..github/workflows/helm_pr_deployment.yml
Analysis chain
Validate Helm setup.
The action
azure/setup-helm@v3
is used with Helm versionv3.15.0
. This version should be checked against the current stable release to ensure compatibility and security updates.Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 90