Skip to content
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

WIP helm/GCE ingress #2

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/budibase/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sources:
- https://budibase.com
type: application
# populates on packaging
version: 0.0.0
version: 0.2.12
# populates on packaging
appVersion: 0.0.0
dependencies:
Expand Down
14 changes: 14 additions & 0 deletions charts/budibase/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.DEFAULT_GOAL := push
REPO="europe-central2-docker.pkg.dev/tooploox-app-deployer/tplx-helm-repo"
repo-login:
@export HELM_EXPERIMENTAL_OCI=1 ; gcloud auth application-default print-access-token | helm registry login -u oauth2accesstoken --password-stdin https://$(REPO)

repo-check:
@export HELM_EXPERIMENTAL_OCI=1 ; helm show readme oci:https://$(REPO)/$${PWD##*/} --version $$(grep version Chart.yaml | cut -f 2 -d ' ') 2>/dev/null \
&& echo "Version already exist!" && exit 1 || echo "Repo ready to push!"
push: clean repo-login repo-check
@helm package . --version v$$(grep version Chart.yaml | cut -f 2 -d ' ')
@export HELM_EXPERIMENTAL_OCI=1 ; helm push $${PWD##*/}-v$$(grep version Chart.yaml | cut -f 2 -d ' ').tgz oci:https://$(REPO)
@rm -f *.tgz
clean:
@rm -f *.tgz
78 changes: 78 additions & 0 deletions charts/budibase/templates/gce-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# {{- if .Values.ingress.gce.enabled }}
# apiVersion: networking.k8s.io/v1
# kind: Ingress
# metadata:
# name: {{ include "budibase.fullname" . }}
# annotations:
# kubernetes.io/ingress.class: gce
# # {{- if .Values.ingress.gce.staticIP }}
# # kubernetes.io/ingress.global-static-ip-name: "web-static-ip"
# # {{- end }}
# {{- if .Values.ingress.gce.managedCertificate.enabled }}
# networking.gke.io/managed-certificates: {{ include "budibase.fullname" . }}-certificate
# {{- end }}
# {{- if .Values.ingress.gce.enabled }}
# networking.gke.io/v1beta1.FrontendConfig: {{ include "budibase.fullname" . }}-frontend-config
# {{- end }}
# spec:
# 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: {{ .backend.service.name }}
# port:
# number: {{ .backend.service.port.number }}
# {{- else }}
# serviceName: {{ .backend.service.name }}
# servicePort: {{ .backend.service.port.number }}
# {{- end }}
# {{- end }}
# {{- end }}
# {{- end }}
---
{{- if .Values.ingress.gce.enabled }}
apiVersion: cloud.google.com/v1
kind: BackendConfig
metadata:
name: {{ include "budibase.fullname" . }}
spec:
healthCheck:
# checkIntervalSec: 15
# port: 15020
# type: HTTPS
requestPath: /builder #root doesn't return 200
{{- end }}
---
{{- if .Values.ingress.gce.managedCertificate.enabled }}
apiVersion: networking.gke.io/v1beta1
kind: FrontendConfig
metadata:
name: {{ include "budibase.fullname" . }}-frontend-config
spec:
redirectToHttps:
enabled: true
{{- end }}
---
{{- if .Values.ingress.gce.managedCertificate.enabled }}
apiVersion: networking.gke.io/v1
kind: ManagedCertificate
metadata:
name: {{ include "budibase.fullname" . }}-certificate
labels:
{{- include "budibase.labels" . | nindent 4 }}
spec:
domains:
{{- range .Values.ingress.hosts }}
- {{ .host | quote }}
{{- end }}
{{- end }}

9 changes: 9 additions & 0 deletions charts/budibase/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ metadata:
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
# {{- if .Values.ingress.staticIP }}
# kubernetes.io/ingress.global-static-ip-name: "web-static-ip"
# {{- end }}
{{- if .Values.ingress.gce.enabled }}
networking.gke.io/v1beta1.FrontendConfig: {{ include "budibase.fullname" . }}-frontend-config
{{- end }}
{{- if .Values.ingress.gce.managedCertificate.enabled }}
networking.gke.io/managed-certificates: {{ include "budibase.fullname" . }}-certificate
{{- end }}
spec:
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ .Values.ingress.className }}
Expand Down
6 changes: 6 additions & 0 deletions charts/budibase/templates/proxy-service-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ metadata:
annotations:
kompose.cmd: kompose convert
kompose.version: 1.21.0 (992df58d8)
{{- if .Values.ingress.gce.enabled }}
cloud.google.com/backend-config: '{"default": "{{ include "budibase.fullname" . }}"}'
{{- end }}
creationTimestamp: null
labels:
app.kubernetes.io/name: budibase-proxy
Expand All @@ -15,5 +18,8 @@ spec:
targetPort: {{ .Values.services.proxy.port }}
selector:
app.kubernetes.io/name: budibase-proxy
{{- if .Values.ingress.gce }}
type: NodePort
{{- end }}
status:
loadBalancer: {}
5 changes: 5 additions & 0 deletions charts/budibase/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,13 @@ service:

ingress:
enabled: true
# class: nginx,aws,gce
aws: false
nginx: true
gce:
enabled: false
managedCertificate:
enabled: false
certificateArn: ""
className: ""
annotations:
Expand Down
6 changes: 6 additions & 0 deletions charts/tmp/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: budibase
repository: file:https://../budibase
version: 0.3.01
digest: sha256:5ef79008a880af8b382bb446040f475c167c1134dce93ec4c4831b080b457c03
generated: "2023-01-17T21:47:51.50175+01:00"
9 changes: 9 additions & 0 deletions charts/tmp/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v2
name: budibase-dev
type: application
version: 0.1.0
appVersion: 0.1.0
dependencies:
- name: budibase
version: 0.3.01
repository: file:https://../budibase
Loading