Skip to content

Commit

Permalink
chore: verification-api
Browse files Browse the repository at this point in the history
  • Loading branch information
nemo83 committed Aug 22, 2023
1 parent 07b529f commit 517d257
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 60 deletions.
11 changes: 1 addition & 10 deletions deploy/cf-cardano-ballot-api/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,7 @@ service:
port: 80

ingress:
enabled: false
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths:
- path: /
pathType: ImplementationSpecific
tls: []
enabled: true

resources: {}
# limits:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ spec:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
# - name: SPRING_PROFILES_ACTIVE
# value: {{ .springProfiles }}
- name: CARDANO_NETWORK
value: {{ .Values.network | default "preprod" | upper}}
ports:
- name: http
containerPort: {{ .Values.service.port }}
Expand Down
46 changes: 7 additions & 39 deletions deploy/cf-cardano-ballot-verification-api/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "voting-verification-app.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 }}
Expand All @@ -23,39 +12,18 @@ metadata:
{{- 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 }}
- host: "verification-api.{{ .Values.domain }}"
http:
paths:
{{- range .paths }}
- path: {{ .path }}
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
pathType: {{ .pathType }}
{{- end }}
- path: /
pathType: Prefix
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{- else }}
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
tls:
- hosts:
- "verification-api.{{ .Values.domain }}"
{{ end }}
13 changes: 2 additions & 11 deletions deploy/cf-cardano-ballot-verification-api/values.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
replicaCount: 1

image:
repository: pro.registry.gitlab.metadata.dev.cf-deployments.org/base-infrastructure/docker-registry/cf-explorer-api
repository: pro.registry.gitlab.metadata.dev.cf-deployments.org/base-infrastructure/docker-registry/voting-verification-app
tag: "0.0.1"
pullPolicy: Always

Expand All @@ -15,16 +15,7 @@ service:
port: 80

ingress:
enabled: false
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths:
- path: /
pathType: ImplementationSpecific
tls: []
enabled: true

resources: {}
# limits:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{{ if index .Values "cf-cardano-ballot-verification-api" "enabled" }}
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: cf-cardano-ballot-verification-api
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
source:
repoURL: git@github.com:cardano-foundation/cf-cardano-ballot.git
targetRevision: {{ .Values.git.targetRevision | default "HEAD" }}
path: deploy/cf-cardano-ballot-verification-api
helm:
parameters:
- name: "domain"
value: {{ .Values.domain }}
- name: "network"
value: {{ .Values.network }}
{{- with index .Values "cf-cardano-ballot-verification-api" "values" }}
values: |
{{ toYaml . | indent 8 }}
{{- end }}

syncPolicy:
automated:
prune: true
syncOptions:
- CreateNamespace=true

destination:
namespace: cf-cardano-ballot
server: {{ .Values.spec.destination.server }}
{{ end }}
5 changes: 5 additions & 0 deletions deploy/main-app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ cf-cardano-ballot-api:
# Whether Resources should be deployed.
enabled: true

# Ballot Verification API Parameters
cf-cardano-ballot-verification-api:
# Whether Resources should be deployed.
enabled: true

grafana-dashboards:
enabled: true

Expand Down

0 comments on commit 517d257

Please sign in to comment.