Skip to content

Commit

Permalink
Merge pull request #564 from cardano-foundation/chore/add-keri-ballot…
Browse files Browse the repository at this point in the history
…-verifier-helm-chart

chore(helm): add cf-keri-ballot-verifier helm chart
  • Loading branch information
rcmorano authored Aug 7, 2024
2 parents eb3d576 + 0cb73ea commit e6d2568
Show file tree
Hide file tree
Showing 24 changed files with 506 additions and 96 deletions.
2 changes: 1 addition & 1 deletion deploy/cf-cardano-summit-2024-ui/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
name: summit-2023-ui
name: summit-2024-ui
description: A Helm chart for Kubernetes
type: application
version: 0.0.1
Expand Down
20 changes: 10 additions & 10 deletions deploy/cf-cardano-summit-2024-ui/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "summit-2023-ui.name" -}}
{{- define "summit-2024-ui.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 "summit-2023-ui.fullname" -}}
{{- define "summit-2024-ui.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 "summit-2023-ui.chart" -}}
{{- define "summit-2024-ui.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

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

{{/*
Create the name of the service account to use
*/}}
{{- define "summit-2023-ui.serviceAccountName" -}}
{{- define "summit-2024-ui.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "summit-2023-ui.fullname" .) .Values.serviceAccount.name }}
{{- default (include "summit-2024-ui.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
Expand Down
72 changes: 40 additions & 32 deletions deploy/cf-cardano-summit-2024-ui/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "summit-2023-ui.fullname" . }}
name: {{ include "summit-2024-ui.fullname" . }}
labels:
{{- include "summit-2023-ui.labels" . | nindent 4 }}
{{- include "summit-2024-ui.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "summit-2023-ui.selectorLabels" . | nindent 6 }}
{{- include "summit-2024-ui.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "summit-2023-ui.selectorLabels" . | nindent 8 }}
{{- include "summit-2024-ui.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
Expand All @@ -23,34 +23,42 @@ spec:
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: REACT_APP_VERSION
value: {{ .Values.image.tag | default .Chart.AppVersion | quote }}
- name: REACT_APP_FRONTEND_URL
value: {{ .Values.frontendUrl }}
- name: REACT_APP_VOTING_APP_SERVER_URL
value: {{ .Values.votingAppServerUrl }}
- name: REACT_APP_VOTING_LEDGER_FOLLOWER_APP_SERVER_URL
value: {{ .Values.votingLedgerFollowerAppServerUrl }}
- name: REACT_APP_VOTING_VERIFICATION_APP_SERVER_URL
value: {{ .Values.votingVerificationAppServerUrl }}
- name: REACT_APP_USER_VERIFICATION_SERVER_URL
value: {{ .Values.userVerificationServerUrl }}
- name: REACT_APP_TARGET_NETWORK
value: {{ .Values.targetNetwork }}
- name: REACT_APP_EVENT_ID
value: {{ .Values.eventId }}
- name: REACT_APP_SUPPORTED_WALLETS
value: {{ .Values.supportedWallets | default "flint,eternl,nami,typhoncip30,yoroi,nufi,gerowallet,lace" }}
- name: REACT_APP_DISCORD_CHANNEL_URL
value: {{ .Values.discordChannelUrl }}
- name: REACT_APP_DISCORD_BOT_URL
value: {{ .Values.discordBotUrl }}
- name: REACT_APP_DISCORD_SUPPORT_CHANNEL_URL
value: {{ .Values.discordSupportChannelUrl }}
- name: REACT_APP_SHOW_WINNERS
value: {{ .Values.showWinners | quote }}
- name: REACT_APP_SHOW_HYDRA_TALLY
value: {{ .Values.showHydraTally | quote }}
- name: VITE_VOTING_APP_SERVER_URL
value: {{ .Values.votingAppServerUrl | default "http://localhost:9091" }}
- name: VITE_VOTING_LEDGER_FOLLOWER_APP_SERVER_URL
value: {{ .Values.votingLedgerFollowerAppServerUrl | default "http://localhost:9090" }}
- name: VITE_VOTING_VERIFICATION_APP_SERVER_URL
value: {{ .Values.votingVerificationAppServerUrl | default "http://localhost:9092" }}
- name: VITE_USER_VERIFICATION_SERVER_URL
value: {{ .Values.userVerificationServerUrl | default "http://localhost:9093" }}
- name: VITE_DISCORD_SUPPORT_CHANNEL_URL
value: {{ .Values.discordSupportChannelUrl | default "https://discord.gg/example" }}
- name: VITE_DISCORD_CHANNEL_URL
value: {{ .Values.discordChannelUrl | default "https://discord.gg/example" }}
- name: VITE_DISCORD_BOT_URL
value: {{ .Values.discordBotUrl | default "https://discord.com/channels/example" }}
- name: VITE_MATOMO_BASE_URL
value: {{ .Values.matomoBaseUrl | default "https://example.com" }}
- name: VITE_TARGET_NETWORK
value: {{ .Values.targetNetwork | default "PREPROD" }}
- name: VITE_EVENT_ID
value: {{ .Values.eventId | default "CF_SUMMIT_2024_8BCC" }}
- name: VITE_SUPPORTED_WALLETS
value: {{ .Values.supportedWallets | default "flint,eternl,nami,typhon,yoroi,nufi,gerowallet,lace" }}
- name: VITE_SHOW_WINNERS
value: {{ .Values.showWinners | default "false" | quote }}
- name: VITE_SHOW_HYDRA_TALLY
value: {{ .Values.showHydraTally | default "false" | quote }}
- name: VITE_USING_FIXTURES
value: {{ .Values.usingFixtures | default "false" | quote }}
- name: VITE_COMMIT_HASH
value: {{ .Values.image.tag | default "latest" }}
- name: VITE_WEB_URL
{{ if .Values.webUrl }}
value: {{ .Values.webUrl }}
{{ else }}
value: "https://{{ .Values.domain }}"
{{ end }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
Expand Down
4 changes: 2 additions & 2 deletions deploy/cf-cardano-summit-2024-ui/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "summit-2023-ui.fullname" . -}}
{{- $fullName := include "summit-2024-ui.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "summit-2023-ui.labels" . | nindent 4 }}
{{- include "summit-2024-ui.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand Down
6 changes: 3 additions & 3 deletions deploy/cf-cardano-summit-2024-ui/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "summit-2023-ui.fullname" . }}
name: {{ include "summit-2024-ui.fullname" . }}
labels:
{{- include "summit-2023-ui.labels" . | nindent 4 }}
{{- include "summit-2024-ui.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
Expand All @@ -12,4 +12,4 @@ spec:
protocol: TCP
name: http
selector:
{{- include "summit-2023-ui.selectorLabels" . | nindent 4 }}
{{- include "summit-2024-ui.selectorLabels" . | nindent 4 }}
8 changes: 4 additions & 4 deletions deploy/cf-cardano-summit-2024-ui/values.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
replicaCount: 1

image:
repository: pro.registry.gitlab.metadata.dev.cf-deployments.org/base-infrastructure/docker-registry/summit-2023-ui
tag: "0.0.1"
repository: pro.registry.gitlab.metadata.dev.cf-deployments.org/base-infrastructure/docker-registry/cf-ui-summit-2024
tag: "latest"
pullPolicy: Always

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""


service:
type: ClusterIP
port: 8080
port: 80

ingress:
enabled: true
Expand All @@ -31,3 +30,4 @@ nodeSelector: {}

showWinners: "false"
showHydraTally: "false"
usingFixtures: "false"
23 changes: 23 additions & 0 deletions deploy/cf-keri-ballot-verifier/.helmignore
Original file line number Diff line number Diff line change
@@ -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/
6 changes: 6 additions & 0 deletions deploy/cf-keri-ballot-verifier/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v2
name: keri-ballot-verifier
description: A Helm chart for Kubernetes
type: application
version: 0.0.1
appVersion: 0.0.1
62 changes: 62 additions & 0 deletions deploy/cf-keri-ballot-verifier/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "keri-ballot-verifier.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 "keri-ballot-verifier.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 "keri-ballot-verifier.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

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

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

{{/*
Create the name of the service account to use
*/}}
{{- define "keri-ballot-verifier.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "keri-ballot-verifier.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
44 changes: 44 additions & 0 deletions deploy/cf-keri-ballot-verifier/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "keri-ballot-verifier.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "keri-ballot-verifier.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
rules:
- host: "keri-ballot-verifier.{{ .Values.domain }}"
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{- range $domain := .Values.ingress.additionalDomains }}
- host: {{ $domain }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{- end }}
tls:
- hosts:
- "{{ .Values.domain }}"
{{ with .Values.ingress.additionalDomains }}
{{- toYaml . | nindent 8 }}
{{ end }}
{{ end }}
19 changes: 19 additions & 0 deletions deploy/cf-keri-ballot-verifier/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "keri-ballot-verifier.fullname" . }}
labels:
{{- include "keri-ballot-verifier.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port | default "5666"}}
targetPort: public
protocol: TCP
name: public
- port: {{ .Values.service.adminPort | default "5667"}}
targetPort: admin
protocol: TCP
name: admin
selector:
{{- include "keri-ballot-verifier.selectorLabels" . | nindent 4 }}
Loading

0 comments on commit e6d2568

Please sign in to comment.