Skip to content

Commit

Permalink
move ingress out of web and make it configurable from gitops
Browse files Browse the repository at this point in the history
  • Loading branch information
simisimis committed Dec 18, 2024
1 parent 7ef602d commit ffefad7
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 73 deletions.
2 changes: 1 addition & 1 deletion on-chain-voting/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,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.2.0
version: 0.3.0

# 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
Expand Down
12 changes: 6 additions & 6 deletions on-chain-voting/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# on-chain-voting

![Version: 0.2.0](https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.16.0](https://img.shields.io/badge/AppVersion-1.16.0-informational?style=flat-square)
![Version: 0.3.0](https://img.shields.io/badge/Version-0.3.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.16.0](https://img.shields.io/badge/AppVersion-1.16.0-informational?style=flat-square)

A Helm chart for Kubernetes

Expand Down Expand Up @@ -48,6 +48,11 @@ helmfile status
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| fullnameOverride | string | `""` | Full name override |
| ingress.annotations | object | `{}` | The Ingress Annotations |
| ingress.className | string | `""` | The Ingress Class Name to use |
| ingress.enabled | bool | `false` | Whether to create an Ingress |
| ingress.hosts | list | `[]` | The Ingress Hosts |
| ingress.tls | list | `[]` | The TLS configuration |
| nameOverride | string | `""` | Name override |
| postgresql.auth.database | string | `"on-chain-voting"` | Default database name |
| postgresql.auth.enablePostgresUser | bool | `false` | Enable the default postgres user |
Expand Down Expand Up @@ -95,11 +100,6 @@ helmfile status
| web.image.pullPolicy | string | `"IfNotPresent"` | The image pull policy |
| web.image.repository | string | `"673156464838.dkr.ecr.us-west-2.amazonaws.com/on-chain-voting-web"` | The image repository |
| web.image.tag | string | `"0.1.0"` | Overrides the image tag whose default is the chart appVersion. |
| web.ingress.annotations | object | `{}` | The Ingress Annotations |
| web.ingress.className | string | `""` | The Ingress Class Name to use |
| web.ingress.enabled | bool | `false` | Whether to create an Ingress |
| web.ingress.hosts | list | `[]` | The Ingress Hosts |
| web.ingress.tls | list | `[]` | The TLS configuration |
| web.lifecycle | object | `{"preStop":{"exec":{"command":["sh","-c","sleep 15 && kill -SIGQUIT 1"]}}}` | Lifecycle hooks |
| web.nextPublicApiBaseURL | string | `""` | Next Public API base URL |
| web.nextPublicReleaseStage | string | `"production"` | Next Public Release Stage |
Expand Down
43 changes: 0 additions & 43 deletions on-chain-voting/templates/ingress-web.yaml

This file was deleted.

33 changes: 33 additions & 0 deletions on-chain-voting/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "on-chain-voting.fullname" . -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "on-chain-voting.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.className }}
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: {{- toYaml .paths | nindent 10 }}
{{- end }}
{{- end }}
51 changes: 28 additions & 23 deletions on-chain-voting/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,29 +57,6 @@ web:
# -- The service port
port: 3000

ingress:
# -- Whether to create an Ingress
enabled: false
# -- The Ingress Class Name to use
className: ""
# -- The Ingress Annotations
annotations:
{}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
# -- The Ingress Hosts
hosts:
[]
# - host: chart-example.local
# paths:
# - path: /
# pathType: ImplementationSpecific
# -- The TLS configuration
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local

# -- Resources
resources:
{}
Expand Down Expand Up @@ -234,6 +211,34 @@ server:
- -c
- sleep 15 && kill -SIGQUIT 1

ingress:
# -- Whether to create an Ingress
enabled: false
# -- The Ingress Class Name to use
className: ""
# -- The Ingress Annotations
annotations:
{}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
# -- The Ingress Hosts
hosts: []
# - host: chart-example.local
# paths:
# - path: /
# pathType: Prefix
# backend:
# service:
# name: chart-example-web
# port:
# number: 3000

# -- The TLS configuration
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local

postgresql:
# -- Whether to deploy a PostgreSQL server to satisfy the application database requirements
create: true
Expand Down

0 comments on commit ffefad7

Please sign in to comment.