From da9133c3c35388f9175b6e4ea650a545bb73f191 Mon Sep 17 00:00:00 2001 From: Dennis Zhang Date: Sat, 5 Sep 2020 13:46:51 -0700 Subject: [PATCH 1/5] add service values --- kubernetes/Chart.yaml | 2 +- kubernetes/templates/service.yaml | 6 +++++- kubernetes/values.yaml | 5 +++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/kubernetes/Chart.yaml b/kubernetes/Chart.yaml index 0d7791d7..bb0838ad 100644 --- a/kubernetes/Chart.yaml +++ b/kubernetes/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: invidious description: Invidious is an alternative front-end to YouTube -version: 1.0.0 +version: 1.1.0 appVersion: 0.20.1 keywords: - youtube diff --git a/kubernetes/templates/service.yaml b/kubernetes/templates/service.yaml index 56bdea2e..01454d4e 100644 --- a/kubernetes/templates/service.yaml +++ b/kubernetes/templates/service.yaml @@ -7,10 +7,14 @@ metadata: chart: {{ .Chart.Name }} release: {{ .Release.Name }} spec: + type: {{ .Values.service.type }} ports: - name: http - port: 3000 + port: {{ .Values.service.port }} targetPort: 3000 selector: app: {{ template "invidious.name" . }} release: {{ .Release.Name }} +{{- if .Values.service.loadBalancerIP }} + loadBalancerIP: {{ .Values.service.loadBalancerIP }} +{{- end }} diff --git a/kubernetes/values.yaml b/kubernetes/values.yaml index ce32b257..7f3dcdfd 100644 --- a/kubernetes/values.yaml +++ b/kubernetes/values.yaml @@ -13,6 +13,11 @@ autoscaling: maxReplicas: 16 targetCPUUtilizationPercentage: 50 +service: + type: clusterIP + port: 3000 + # loadBalancerIP: + resources: {} #requests: # cpu: 100m From 8408ceffe8b9a8e081ec2b2bdd621a9ab612be43 Mon Sep 17 00:00:00 2001 From: Dennis Zhang Date: Sat, 5 Sep 2020 17:12:21 -0700 Subject: [PATCH 2/5] also add initial delay --- kubernetes/templates/deployment.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/kubernetes/templates/deployment.yaml b/kubernetes/templates/deployment.yaml index 34156127..eec407b0 100644 --- a/kubernetes/templates/deployment.yaml +++ b/kubernetes/templates/deployment.yaml @@ -50,4 +50,5 @@ spec: httpGet: port: 3000 path: / + initialDelaySeconds: 15 restartPolicy: Always From b860c69fd7a7bc641ff7a2b0a7390af32b8d40f7 Mon Sep 17 00:00:00 2001 From: Dennis Zhang Date: Sat, 5 Sep 2020 19:51:58 -0700 Subject: [PATCH 3/5] Add initContainer to check for postgres up --- kubernetes/templates/deployment.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kubernetes/templates/deployment.yaml b/kubernetes/templates/deployment.yaml index eec407b0..d63747a7 100644 --- a/kubernetes/templates/deployment.yaml +++ b/kubernetes/templates/deployment.yaml @@ -23,6 +23,13 @@ spec: runAsUser: {{ .Values.securityContext.runAsUser }} runAsGroup: {{ .Values.securityContext.runAsGroup }} fsGroup: {{ .Values.securityContext.fsGroup }} + initContainers: + - name: wait-for-postgresql + image: postgres + args: + - /bin/sh + - -c + - until pg_isready -h {{ .Values.config.db.host }} -p {{ .Values.config.db.port }} -U {{ .Values.config.db.port }}; do echo waiting for database; sleep 2; done; containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" From 4a56ba34d4840fcad2f97f2b68191b7f1388f7c8 Mon Sep 17 00:00:00 2001 From: Dennis Zhang Date: Sun, 6 Sep 2020 00:37:05 -0700 Subject: [PATCH 4/5] Fix pg_is ready user --- kubernetes/templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubernetes/templates/deployment.yaml b/kubernetes/templates/deployment.yaml index d63747a7..bb0b832f 100644 --- a/kubernetes/templates/deployment.yaml +++ b/kubernetes/templates/deployment.yaml @@ -29,7 +29,7 @@ spec: args: - /bin/sh - -c - - until pg_isready -h {{ .Values.config.db.host }} -p {{ .Values.config.db.port }} -U {{ .Values.config.db.port }}; do echo waiting for database; sleep 2; done; + - until pg_isready -h {{ .Values.config.db.host }} -p {{ .Values.config.db.port }} -U {{ .Values.config.db.user }}; do echo waiting for database; sleep 2; done; containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" From fa3eb185aba77a59896a64f67113178b371e0b32 Mon Sep 17 00:00:00 2001 From: Dennis Zhang Date: Sun, 6 Sep 2020 00:37:43 -0700 Subject: [PATCH 5/5] Remove space --- kubernetes/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubernetes/values.yaml b/kubernetes/values.yaml index 7f3dcdfd..4d037022 100644 --- a/kubernetes/values.yaml +++ b/kubernetes/values.yaml @@ -16,7 +16,7 @@ autoscaling: service: type: clusterIP port: 3000 - # loadBalancerIP: + #loadBalancerIP: resources: {} #requests: