From 8d79a6c4c508c5c3108bc76caa5c3bf933f04b78 Mon Sep 17 00:00:00 2001 From: I517992 Date: Mon, 7 Jun 2021 13:26:47 +0800 Subject: [PATCH 01/20] fix e2e test cluster --- infrabox/generator/e2e.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/infrabox/generator/e2e.json b/infrabox/generator/e2e.json index 1d39956ea..36482b666 100644 --- a/infrabox/generator/e2e.json +++ b/infrabox/generator/e2e.json @@ -2,7 +2,7 @@ "version": 1, "jobs": [{ "type": "docker", - "name": "e2e-k8s-1-15", + "name": "e2e-k8s-1-18", "docker_file": "infrabox/test/e2e/Dockerfile", "build_context": "../..", "build_only": false, @@ -24,7 +24,7 @@ "numNodes": 2, "preemptible": false, "zone": "us-east1-b", - "clusterVersion": "1.15" + "clusterVersion": "1.18" } }] }] From 2eddb5c49e9b94e26f14bfb201ba61e55e759e89 Mon Sep 17 00:00:00 2001 From: I517992 Date: Mon, 7 Jun 2021 14:16:10 +0800 Subject: [PATCH 02/20] replace extensions/v1beta1 with apps/v1 in all deployments template --- deploy/infrabox/templates/api/deployment.yaml | 4 ++-- deploy/infrabox/templates/checker/deployment.yaml | 4 ++-- deploy/infrabox/templates/docker-registry/deployment.yaml | 2 +- deploy/infrabox/templates/gc/deployment.yaml | 4 ++-- deploy/infrabox/templates/gerrit/review.yaml | 2 +- deploy/infrabox/templates/gerrit/trigger.yaml | 2 +- deploy/infrabox/templates/github/deployment.yaml | 2 +- deploy/infrabox/templates/grafana/deployment.yaml | 2 +- deploy/infrabox/templates/metrics/deployment.yaml | 2 +- deploy/infrabox/templates/scheduler/deployment.yaml | 2 +- deploy/infrabox/templates/static/deployment.yaml | 2 +- deploy/infrabox/templates/status-cachet/deployment.yaml | 2 +- 12 files changed, 15 insertions(+), 15 deletions(-) diff --git a/deploy/infrabox/templates/api/deployment.yaml b/deploy/infrabox/templates/api/deployment.yaml index 077329626..9ac874b78 100644 --- a/deploy/infrabox/templates/api/deployment.yaml +++ b/deploy/infrabox/templates/api/deployment.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: infrabox-api @@ -81,4 +81,4 @@ spec: {{ include "volumes_gcs" . | indent 16 }} {{ include "volumes_gerrit" . | indent 16 }} {{ include "volumes_saml" . | indent 16 }} - {{ include "volumes_dev" . | indent 16 }} \ No newline at end of file + {{ include "volumes_dev" . | indent 16 }} diff --git a/deploy/infrabox/templates/checker/deployment.yaml b/deploy/infrabox/templates/checker/deployment.yaml index a0ce5f29c..f6b8331a2 100644 --- a/deploy/infrabox/templates/checker/deployment.yaml +++ b/deploy/infrabox/templates/checker/deployment.yaml @@ -1,5 +1,5 @@ {{ if or .Values.ha.enabled .Values.monitoring.enabled }} -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: infrabox-checker @@ -65,4 +65,4 @@ spec: {{ include "volumes_rsa" . | indent 16 }} {{ include "volumes_gcs" . | indent 16 }} {{ include "volumes_dev" . | indent 16 }} -{{ end }} \ No newline at end of file +{{ end }} diff --git a/deploy/infrabox/templates/docker-registry/deployment.yaml b/deploy/infrabox/templates/docker-registry/deployment.yaml index a980beb1e..78761bbd3 100644 --- a/deploy/infrabox/templates/docker-registry/deployment.yaml +++ b/deploy/infrabox/templates/docker-registry/deployment.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: infrabox-docker-registry diff --git a/deploy/infrabox/templates/gc/deployment.yaml b/deploy/infrabox/templates/gc/deployment.yaml index 7a7c0db99..b57375985 100644 --- a/deploy/infrabox/templates/gc/deployment.yaml +++ b/deploy/infrabox/templates/gc/deployment.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: infrabox-gc @@ -29,4 +29,4 @@ spec: {{ include "env_azure" . | indent 16 }} {{ include "env_swift" . | indent 16 }} volumes: - {{ include "volumes_database" . | indent 16 }} \ No newline at end of file + {{ include "volumes_database" . | indent 16 }} diff --git a/deploy/infrabox/templates/gerrit/review.yaml b/deploy/infrabox/templates/gerrit/review.yaml index a2405ee96..f96a31692 100644 --- a/deploy/infrabox/templates/gerrit/review.yaml +++ b/deploy/infrabox/templates/gerrit/review.yaml @@ -1,6 +1,6 @@ {{ define "gerrit_review_deployment" }} {{ if .Values.gerrit.enabled }} -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: infrabox-gerrit-review diff --git a/deploy/infrabox/templates/gerrit/trigger.yaml b/deploy/infrabox/templates/gerrit/trigger.yaml index 0d35aca36..fdc57bd32 100644 --- a/deploy/infrabox/templates/gerrit/trigger.yaml +++ b/deploy/infrabox/templates/gerrit/trigger.yaml @@ -1,6 +1,6 @@ {{ define "gerrit_trigger_deployment" }} {{ if .Values.gerrit.enabled }} -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: infrabox-gerrit-trigger diff --git a/deploy/infrabox/templates/github/deployment.yaml b/deploy/infrabox/templates/github/deployment.yaml index fc98064bd..fcb1c86d6 100644 --- a/deploy/infrabox/templates/github/deployment.yaml +++ b/deploy/infrabox/templates/github/deployment.yaml @@ -1,6 +1,6 @@ {{ define "github_deployment" }} {{ if .Values.github.enabled }} -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: infrabox-github diff --git a/deploy/infrabox/templates/grafana/deployment.yaml b/deploy/infrabox/templates/grafana/deployment.yaml index 0475b81fb..ea1a08960 100644 --- a/deploy/infrabox/templates/grafana/deployment.yaml +++ b/deploy/infrabox/templates/grafana/deployment.yaml @@ -1,5 +1,5 @@ {{ if .Values.monitoring.enabled }} -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: infrabox-grafana diff --git a/deploy/infrabox/templates/metrics/deployment.yaml b/deploy/infrabox/templates/metrics/deployment.yaml index 89571671c..2b0b80051 100644 --- a/deploy/infrabox/templates/metrics/deployment.yaml +++ b/deploy/infrabox/templates/metrics/deployment.yaml @@ -1,5 +1,5 @@ {{ if .Values.monitoring.enabled }} -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: infrabox-metrics diff --git a/deploy/infrabox/templates/scheduler/deployment.yaml b/deploy/infrabox/templates/scheduler/deployment.yaml index c704cd311..369b6398f 100644 --- a/deploy/infrabox/templates/scheduler/deployment.yaml +++ b/deploy/infrabox/templates/scheduler/deployment.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: infrabox-scheduler diff --git a/deploy/infrabox/templates/static/deployment.yaml b/deploy/infrabox/templates/static/deployment.yaml index 9e3b1dac1..89a3fef8f 100644 --- a/deploy/infrabox/templates/static/deployment.yaml +++ b/deploy/infrabox/templates/static/deployment.yaml @@ -1,5 +1,5 @@ {{ define "static_deployment" }} -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: infrabox-static diff --git a/deploy/infrabox/templates/status-cachet/deployment.yaml b/deploy/infrabox/templates/status-cachet/deployment.yaml index b41229df0..a034b5af2 100644 --- a/deploy/infrabox/templates/status-cachet/deployment.yaml +++ b/deploy/infrabox/templates/status-cachet/deployment.yaml @@ -1,5 +1,5 @@ {{ if .Values.cachet.enabled }} -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: infrabox-status-cachet From 60c940d626069596b920721d9972387bee0a9b45 Mon Sep 17 00:00:00 2001 From: I517992 Date: Mon, 7 Jun 2021 15:09:46 +0800 Subject: [PATCH 03/20] replace all extensions/v1beta1 with apps/v1 in all deployments template --- deploy/cluster-status/templates/deployment.yaml | 2 +- src/services/aks/infrabox-service-aks/templates/deployment.yaml | 2 +- .../gardener/infrabox-service-garden/templates/deployment.yaml | 2 +- .../infrabox-service-namespace/templates/deployment.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/deploy/cluster-status/templates/deployment.yaml b/deploy/cluster-status/templates/deployment.yaml index 1da8d3a1d..8a1fd68c8 100644 --- a/deploy/cluster-status/templates/deployment.yaml +++ b/deploy/cluster-status/templates/deployment.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: infrabox-cluster-status diff --git a/src/services/aks/infrabox-service-aks/templates/deployment.yaml b/src/services/aks/infrabox-service-aks/templates/deployment.yaml index e961c1d7b..14d2b7405 100644 --- a/src/services/aks/infrabox-service-aks/templates/deployment.yaml +++ b/src/services/aks/infrabox-service-aks/templates/deployment.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: {{ template "infrabox-service-aks.fullname" . }} diff --git a/src/services/gardener/infrabox-service-garden/templates/deployment.yaml b/src/services/gardener/infrabox-service-garden/templates/deployment.yaml index f307ebe6c..c1d473cd4 100644 --- a/src/services/gardener/infrabox-service-garden/templates/deployment.yaml +++ b/src/services/gardener/infrabox-service-garden/templates/deployment.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: {{ template "infrabox-service-gardener.fullname" . }} diff --git a/src/services/namespace/infrabox-service-namespace/templates/deployment.yaml b/src/services/namespace/infrabox-service-namespace/templates/deployment.yaml index b8da68fb0..b0359de40 100644 --- a/src/services/namespace/infrabox-service-namespace/templates/deployment.yaml +++ b/src/services/namespace/infrabox-service-namespace/templates/deployment.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: {{ template "infrabox-service-namespace.fullname" . }} From df4ea8c303178394d69d3c8b21e0ffc91f4b3a15 Mon Sep 17 00:00:00 2001 From: I517992 Date: Fri, 2 Jul 2021 15:04:42 +0800 Subject: [PATCH 04/20] fix aks-service bug --- src/services/aks/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/aks/Dockerfile b/src/services/aks/Dockerfile index 8898717a4..915e85a4a 100644 --- a/src/services/aks/Dockerfile +++ b/src/services/aks/Dockerfile @@ -19,7 +19,7 @@ RUN \ apk update && \ apk add bash py3-pip && \ apk add --virtual=build linux-headers gcc libffi-dev musl-dev openssl-dev python3-dev make && \ - python3 -m pip install -U "pip!=20.0" && \ + python3 -m pip install -U "pip!=21.1.3" && \ python3 -m pip install azure-cli && \ apk del --purge build && \ az aks install-cli From 7da60fb8901a4e7bf1e8c54c64122b16e75367af Mon Sep 17 00:00:00 2001 From: I517992 Date: Fri, 2 Jul 2021 15:43:26 +0800 Subject: [PATCH 05/20] don't use azure-cli 2.25.0 --- src/services/aks/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/aks/Dockerfile b/src/services/aks/Dockerfile index 915e85a4a..286e8a9db 100644 --- a/src/services/aks/Dockerfile +++ b/src/services/aks/Dockerfile @@ -19,8 +19,8 @@ RUN \ apk update && \ apk add bash py3-pip && \ apk add --virtual=build linux-headers gcc libffi-dev musl-dev openssl-dev python3-dev make && \ - python3 -m pip install -U "pip!=21.1.3" && \ - python3 -m pip install azure-cli && \ + python3 -m pip install -U "pip!=20.0" && \ + python3 -m pip install azure-cli!=2.25.0 && \ apk del --purge build && \ az aks install-cli From b4354a18ec22ecdc434e1e642e7e269d2534f525 Mon Sep 17 00:00:00 2001 From: I517992 Date: Fri, 2 Jul 2021 16:37:58 +0800 Subject: [PATCH 06/20] use alpine 3.13 to test --- src/services/aks/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/aks/Dockerfile b/src/services/aks/Dockerfile index 286e8a9db..f9e2f55dd 100644 --- a/src/services/aks/Dockerfile +++ b/src/services/aks/Dockerfile @@ -11,7 +11,7 @@ RUN dep ensure RUN chmod +x ./tmp/build.sh RUN ./tmp/build.sh -FROM alpine:3 +FROM alpine:3.13 ENV PATH $PATH:/usr/local/bin @@ -20,7 +20,7 @@ RUN \ apk add bash py3-pip && \ apk add --virtual=build linux-headers gcc libffi-dev musl-dev openssl-dev python3-dev make && \ python3 -m pip install -U "pip!=20.0" && \ - python3 -m pip install azure-cli!=2.25.0 && \ + python3 -m pip install azure-cli && \ apk del --purge build && \ az aks install-cli From 43c6cb85602914dd26a2a497db56ad792c6ebdf9 Mon Sep 17 00:00:00 2001 From: I517992 Date: Fri, 2 Jul 2021 17:54:48 +0800 Subject: [PATCH 07/20] replace extensions/v1beta1 with apps/v1 in aks-service and gardener-service --- .../aks/pkg/controller/akscluster/akscluster_controller.go | 2 +- src/services/gardener/pkg/stub/handler.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/aks/pkg/controller/akscluster/akscluster_controller.go b/src/services/aks/pkg/controller/akscluster/akscluster_controller.go index 5d399545c..d485764d9 100644 --- a/src/services/aks/pkg/controller/akscluster/akscluster_controller.go +++ b/src/services/aks/pkg/controller/akscluster/akscluster_controller.go @@ -665,7 +665,7 @@ func newCollectorDeployment() *appsv1.Deployment { return &appsv1.Deployment{ TypeMeta: metav1.TypeMeta{ Kind: "Deployment", - APIVersion: "extensions/v1beta1", + APIVersion: "apps/v1", }, ObjectMeta: metav1.ObjectMeta{ Name: "infrabox-collector-api", diff --git a/src/services/gardener/pkg/stub/handler.go b/src/services/gardener/pkg/stub/handler.go index d09dc8e8c..b84ccf7a4 100644 --- a/src/services/gardener/pkg/stub/handler.go +++ b/src/services/gardener/pkg/stub/handler.go @@ -598,7 +598,7 @@ func newCollectorDeployment() *appsv1.Deployment { return &appsv1.Deployment{ TypeMeta: metav1.TypeMeta{ Kind: "Deployment", - APIVersion: "extensions/v1beta1", + APIVersion: "apps/v1", }, ObjectMeta: metav1.ObjectMeta{ Name: "infrabox-collector-api", From 25279ba5a65d530f0ae2b17dc59e803d68233655 Mon Sep 17 00:00:00 2001 From: I517992 Date: Tue, 6 Jul 2021 10:51:49 +0800 Subject: [PATCH 08/20] use apps/v1 in daemonset --- deploy/infrabox/templates/fluentbit/daemonset.yaml | 2 +- .../aks/pkg/controller/akscluster/akscluster_controller.go | 2 +- src/services/gardener/pkg/stub/handler.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deploy/infrabox/templates/fluentbit/daemonset.yaml b/deploy/infrabox/templates/fluentbit/daemonset.yaml index cae3d396d..63df92f1b 100644 --- a/deploy/infrabox/templates/fluentbit/daemonset.yaml +++ b/deploy/infrabox/templates/fluentbit/daemonset.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: DaemonSet metadata: name: infrabox-fluent-bit diff --git a/src/services/aks/pkg/controller/akscluster/akscluster_controller.go b/src/services/aks/pkg/controller/akscluster/akscluster_controller.go index d485764d9..afe60463f 100644 --- a/src/services/aks/pkg/controller/akscluster/akscluster_controller.go +++ b/src/services/aks/pkg/controller/akscluster/akscluster_controller.go @@ -752,7 +752,7 @@ func newCollectorDaemonSet() *appsv1.DaemonSet { return &appsv1.DaemonSet{ TypeMeta: metav1.TypeMeta{ Kind: "DaemonSet", - APIVersion: "extensions/v1beta1", + APIVersion: "apps/v1", }, ObjectMeta: metav1.ObjectMeta{ Name: "infrabox-collector-fluent-bit", diff --git a/src/services/gardener/pkg/stub/handler.go b/src/services/gardener/pkg/stub/handler.go index b84ccf7a4..418fa33e9 100644 --- a/src/services/gardener/pkg/stub/handler.go +++ b/src/services/gardener/pkg/stub/handler.go @@ -632,7 +632,7 @@ func newCollectorDaemonSet() *appsv1.DaemonSet { return &appsv1.DaemonSet{ TypeMeta: metav1.TypeMeta{ Kind: "DaemonSet", - APIVersion: "extensions/v1beta1", + APIVersion: "apps/v1", }, ObjectMeta: metav1.ObjectMeta{ Name: "infrabox-collector-fluent-bit", From 7ea74d3b1dd5cdf9f900922501f54a08dc5be61b Mon Sep 17 00:00:00 2001 From: I517992 Date: Tue, 6 Jul 2021 11:21:43 +0800 Subject: [PATCH 09/20] add selector --- deploy/infrabox/templates/fluentbit/daemonset.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/deploy/infrabox/templates/fluentbit/daemonset.yaml b/deploy/infrabox/templates/fluentbit/daemonset.yaml index 63df92f1b..24f287e5e 100644 --- a/deploy/infrabox/templates/fluentbit/daemonset.yaml +++ b/deploy/infrabox/templates/fluentbit/daemonset.yaml @@ -6,6 +6,9 @@ metadata: labels: app: infrabox-fluent-bit spec: + selector: + matchLabels: + app: infrabox-fluent-bit template: metadata: labels: From 0814d662369884332e7f26cacf3f86f88b89744d Mon Sep 17 00:00:00 2001 From: I517992 Date: Tue, 6 Jul 2021 11:28:34 +0800 Subject: [PATCH 10/20] adding selector in deployment --- deploy/cluster-status/templates/deployment.yaml | 3 +++ deploy/infrabox/templates/api/deployment.yaml | 3 +++ deploy/infrabox/templates/checker/deployment.yaml | 3 +++ deploy/infrabox/templates/docker-registry/deployment.yaml | 3 +++ deploy/infrabox/templates/gc/deployment.yaml | 3 +++ deploy/infrabox/templates/github/deployment.yaml | 3 +++ deploy/infrabox/templates/grafana/deployment.yaml | 3 +++ deploy/infrabox/templates/metrics/deployment.yaml | 3 +++ deploy/infrabox/templates/scheduler/deployment.yaml | 3 +++ deploy/infrabox/templates/static/deployment.yaml | 3 +++ deploy/infrabox/templates/status-cachet/deployment.yaml | 3 +++ 11 files changed, 33 insertions(+) diff --git a/deploy/cluster-status/templates/deployment.yaml b/deploy/cluster-status/templates/deployment.yaml index 8a1fd68c8..be9b73e2a 100644 --- a/deploy/cluster-status/templates/deployment.yaml +++ b/deploy/cluster-status/templates/deployment.yaml @@ -5,6 +5,9 @@ metadata: labels: app: infrabox-cluster-status spec: + selector: + matchLabels: + app: infrabox-cluster-status replicas: 3 template: metadata: diff --git a/deploy/infrabox/templates/api/deployment.yaml b/deploy/infrabox/templates/api/deployment.yaml index 9ac874b78..b83f37dab 100644 --- a/deploy/infrabox/templates/api/deployment.yaml +++ b/deploy/infrabox/templates/api/deployment.yaml @@ -6,6 +6,9 @@ metadata: labels: app: infrabox-api spec: + selector: + matchLabels: + app: infrabox-api replicas: {{ default 1 .Values.api.replicas }} template: metadata: diff --git a/deploy/infrabox/templates/checker/deployment.yaml b/deploy/infrabox/templates/checker/deployment.yaml index f6b8331a2..faa4bc833 100644 --- a/deploy/infrabox/templates/checker/deployment.yaml +++ b/deploy/infrabox/templates/checker/deployment.yaml @@ -7,6 +7,9 @@ metadata: labels: app: infrabox-checker spec: + selector: + matchLabels: + app: infrabox-checker replicas: 1 template: metadata: diff --git a/deploy/infrabox/templates/docker-registry/deployment.yaml b/deploy/infrabox/templates/docker-registry/deployment.yaml index 78761bbd3..7516947ab 100644 --- a/deploy/infrabox/templates/docker-registry/deployment.yaml +++ b/deploy/infrabox/templates/docker-registry/deployment.yaml @@ -6,6 +6,9 @@ metadata: labels: app: infrabox-docker-registry spec: + selector: + matchLabels: + app: infrabox-docker-registry replicas: {{ required "docker_registry.replicas is required" .Values.docker_registry.replicas }} template: metadata: diff --git a/deploy/infrabox/templates/gc/deployment.yaml b/deploy/infrabox/templates/gc/deployment.yaml index b57375985..95fda311b 100644 --- a/deploy/infrabox/templates/gc/deployment.yaml +++ b/deploy/infrabox/templates/gc/deployment.yaml @@ -6,6 +6,9 @@ metadata: labels: app: infrabox-gc spec: + selector: + matchLabels: + app: infrabox-gc replicas: 1 template: metadata: diff --git a/deploy/infrabox/templates/github/deployment.yaml b/deploy/infrabox/templates/github/deployment.yaml index fcb1c86d6..238e9d0cd 100644 --- a/deploy/infrabox/templates/github/deployment.yaml +++ b/deploy/infrabox/templates/github/deployment.yaml @@ -8,6 +8,9 @@ metadata: labels: app: infrabox-github spec: + selector: + matchLabels: + app: infrabox-github replicas: 1 template: metadata: diff --git a/deploy/infrabox/templates/grafana/deployment.yaml b/deploy/infrabox/templates/grafana/deployment.yaml index ea1a08960..b71978949 100644 --- a/deploy/infrabox/templates/grafana/deployment.yaml +++ b/deploy/infrabox/templates/grafana/deployment.yaml @@ -7,6 +7,9 @@ metadata: labels: app: infrabox-grafana spec: + selector: + matchLabels: + app: infrabox-grafana replicas: 1 template: metadata: diff --git a/deploy/infrabox/templates/metrics/deployment.yaml b/deploy/infrabox/templates/metrics/deployment.yaml index 2b0b80051..1c880d5fe 100644 --- a/deploy/infrabox/templates/metrics/deployment.yaml +++ b/deploy/infrabox/templates/metrics/deployment.yaml @@ -7,6 +7,9 @@ metadata: labels: app: infrabox-metrics spec: + selector: + matchLabels: + app: infrabox-metrics replicas: 1 template: metadata: diff --git a/deploy/infrabox/templates/scheduler/deployment.yaml b/deploy/infrabox/templates/scheduler/deployment.yaml index 369b6398f..e3cb4a157 100644 --- a/deploy/infrabox/templates/scheduler/deployment.yaml +++ b/deploy/infrabox/templates/scheduler/deployment.yaml @@ -6,6 +6,9 @@ metadata: labels: app: infrabox-scheduler spec: + selector: + matchLabels: + app: infrabox-scheduler replicas: 1 template: metadata: diff --git a/deploy/infrabox/templates/static/deployment.yaml b/deploy/infrabox/templates/static/deployment.yaml index 89a3fef8f..d26b3a9e2 100644 --- a/deploy/infrabox/templates/static/deployment.yaml +++ b/deploy/infrabox/templates/static/deployment.yaml @@ -7,6 +7,9 @@ metadata: labels: app: infrabox-static spec: + selector: + matchLabels: + app: infrabox-static replicas: 1 template: metadata: diff --git a/deploy/infrabox/templates/status-cachet/deployment.yaml b/deploy/infrabox/templates/status-cachet/deployment.yaml index a034b5af2..0d935516d 100644 --- a/deploy/infrabox/templates/status-cachet/deployment.yaml +++ b/deploy/infrabox/templates/status-cachet/deployment.yaml @@ -7,6 +7,9 @@ metadata: labels: app: infrabox-status-cachet spec: + selector: + matchLabels: + app: infrabox-status-cachet replicas: 1 template: metadata: From e3d07126e150060c02c9df83fdd297a2be7c4445 Mon Sep 17 00:00:00 2001 From: I517992 Date: Wed, 7 Jul 2021 11:12:07 +0800 Subject: [PATCH 11/20] use new config for gcp service --- infrabox/test/e2e/entrypoint.sh | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/infrabox/test/e2e/entrypoint.sh b/infrabox/test/e2e/entrypoint.sh index 1714a48a2..a1f86fe9f 100755 --- a/infrabox/test/e2e/entrypoint.sh +++ b/infrabox/test/e2e/entrypoint.sh @@ -8,30 +8,23 @@ _prepareKubectl() { SERVICE_NAME="e2e-cluster" CA_CRT="/var/run/infrabox.net/services/$SERVICE_NAME/ca.crt" - CLIENT_CRT="/var/run/infrabox.net/services/$SERVICE_NAME/client.crt" - CLIENT_KEY="/var/run/infrabox.net/services/$SERVICE_NAME/client.key" + ENDPOINT=$(cat /var/run/infrabox.net/services/$SERVICE_NAME/endpoint) + TOKEN=$(cat /var/run/infrabox.net/services/$SERVICE_NAME/token) - ENDPOINT=$(cat /var/run/infrabox.net/services/$SERVICE_NAME/endpoint) - PASSWORD=$(cat /var/run/infrabox.net/services/$SERVICE_NAME/password) - USERNAME=$(cat /var/run/infrabox.net/services/$SERVICE_NAME/username) + kubectl config set-cluster $SERVICE_NAME \ + --server=$ENDPOINT \ + --embed-certs=true \ + --certificate-authority=$CA_CRT - kubectl config set-cluster $SERVICE_NAME \ - --server=$ENDPOINT \ - --certificate-authority=$CA_CRT + kubectl config set-credentials admin \ + --token=$TOKEN - kubectl config set-credentials admin \ - --certificate-authority=$CA_CRT \ - --client-certificate=$CLIENT_CRT \ - --client-key=$CLIENT_KEY \ - --username=$USERNAME \ - --password=$PASSWORD + kubectl config set-context default-system \ + --cluster=$SERVICE_NAME \ + --user=admin - kubectl config set-context default-system \ - --cluster=$SERVICE_NAME \ - --user=admin - - kubectl config use-context default-system + kubectl config use-context default-system kubectl get nodes From 4b68375e39ae1bbe3ff14a0cd42215fa7f011967 Mon Sep 17 00:00:00 2001 From: I517992 Date: Wed, 7 Jul 2021 13:45:20 +0800 Subject: [PATCH 12/20] fix postgres version to support k8s 1.16+ --- infrabox/test/e2e/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infrabox/test/e2e/entrypoint.sh b/infrabox/test/e2e/entrypoint.sh index a1f86fe9f..c5bacf948 100755 --- a/infrabox/test/e2e/entrypoint.sh +++ b/infrabox/test/e2e/entrypoint.sh @@ -86,7 +86,7 @@ _getPodName() { _installPostgres() { echo "## Install postgres" helm install -n postgres stable/postgresql \ - --version 1.0.0 \ + --version 7.0.0 \ --set imageTag=9.6.2,postgresPassword=postgres,probes.readiness.periodSeconds=5 \ --wait \ --namespace infrabox-system From 81e882aa672d7c64168967502ba4de7145b113cb Mon Sep 17 00:00:00 2001 From: I517992 Date: Wed, 7 Jul 2021 15:39:02 +0800 Subject: [PATCH 13/20] fix parameters --- infrabox/test/e2e/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infrabox/test/e2e/entrypoint.sh b/infrabox/test/e2e/entrypoint.sh index c5bacf948..d7ab0d64b 100755 --- a/infrabox/test/e2e/entrypoint.sh +++ b/infrabox/test/e2e/entrypoint.sh @@ -87,7 +87,7 @@ _installPostgres() { echo "## Install postgres" helm install -n postgres stable/postgresql \ --version 7.0.0 \ - --set imageTag=9.6.2,postgresPassword=postgres,probes.readiness.periodSeconds=5 \ + --set postgresqlPassword=postgres,readinessProbe.periodSeconds=5 \ --wait \ --namespace infrabox-system From 440cba08e1caa75b5bbae0e88281cdd36af23a2e Mon Sep 17 00:00:00 2001 From: I517992 Date: Wed, 7 Jul 2021 15:59:03 +0800 Subject: [PATCH 14/20] use non-interactive mode --- infrabox/test/e2e/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infrabox/test/e2e/entrypoint.sh b/infrabox/test/e2e/entrypoint.sh index d7ab0d64b..9d1a91cc6 100755 --- a/infrabox/test/e2e/entrypoint.sh +++ b/infrabox/test/e2e/entrypoint.sh @@ -97,7 +97,7 @@ _installPostgres() { kubectl port-forward -n infrabox-system $postgres_pod 5432 & # Wait until postgres is ready - until psql -U postgres -h localhost -c '\l'; do + until psql postgresql://postgres:postgres@localhost:5432 -c '\l'; do >&2 echo "Postgres is unavailable - sleeping" sleep 1 done From 47e7ba62feb9e4bdc02bd0e5f7b497d50338d39f Mon Sep 17 00:00:00 2001 From: I517992 Date: Wed, 7 Jul 2021 18:00:04 +0800 Subject: [PATCH 15/20] trigger a new build --- infrabox/test/e2e/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infrabox/test/e2e/test.py b/infrabox/test/e2e/test.py index 2f45d86b3..9c567ca6f 100644 --- a/infrabox/test/e2e/test.py +++ b/infrabox/test/e2e/test.py @@ -204,7 +204,7 @@ def run_it(self, cwd): self._print_job_logs() - #def test_docker_job(self): + # def test_docker_job(self): # self.run_it('/infrabox/context/infrabox/test/e2e/tests/docker_job') # self.expect_job('test') From ec3d4d6b2e523ff1afbba2f1b33133fac362e90a Mon Sep 17 00:00:00 2001 From: I517992 Date: Thu, 8 Jul 2021 10:48:35 +0800 Subject: [PATCH 16/20] add test code --- infrabox/test/e2e/test.py | 1 + 1 file changed, 1 insertion(+) diff --git a/infrabox/test/e2e/test.py b/infrabox/test/e2e/test.py index 9c567ca6f..7dd10dbe7 100644 --- a/infrabox/test/e2e/test.py +++ b/infrabox/test/e2e/test.py @@ -64,6 +64,7 @@ def _api_get(self, url): retries -= 1 if retries < 0: + time.sleep(36000) raise e def _get_build(self): From 5836f433bae001d6952f6eceb5f0695e18f7ef71 Mon Sep 17 00:00:00 2001 From: I517992 Date: Thu, 8 Jul 2021 14:05:32 +0800 Subject: [PATCH 17/20] add test code --- infrabox/test/e2e/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infrabox/test/e2e/test.py b/infrabox/test/e2e/test.py index 7dd10dbe7..b6ebf25ba 100644 --- a/infrabox/test/e2e/test.py +++ b/infrabox/test/e2e/test.py @@ -64,7 +64,6 @@ def _api_get(self, url): retries -= 1 if retries < 0: - time.sleep(36000) raise e def _get_build(self): @@ -346,4 +345,5 @@ def main(): unittest.main(testRunner=xmlrunner.XMLTestRunner(output=output), buffer=False) if __name__ == '__main__': + time.sleep(100000) main() From bc27a48bb88f5694351fa98e8fe7a4dcf320f1f0 Mon Sep 17 00:00:00 2001 From: I517992 Date: Thu, 8 Jul 2021 15:32:47 +0800 Subject: [PATCH 18/20] increase test time --- infrabox/generator/e2e.json | 2 +- infrabox/test/e2e/test.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/infrabox/generator/e2e.json b/infrabox/generator/e2e.json index 36482b666..ee827c866 100644 --- a/infrabox/generator/e2e.json +++ b/infrabox/generator/e2e.json @@ -12,7 +12,7 @@ "cache": { "image": true }, - "timeout": 2700, + "timeout": 360000, "services": [{ "apiVersion": "gcp.service.infrabox.net/v1alpha1", "kind": "GKECluster", diff --git a/infrabox/test/e2e/test.py b/infrabox/test/e2e/test.py index b6ebf25ba..4396d82ec 100644 --- a/infrabox/test/e2e/test.py +++ b/infrabox/test/e2e/test.py @@ -338,12 +338,11 @@ def main(): print("Server not yet ready") - time.sleep(90) + time.sleep(900000) print("Starting tests") with open('results.xml', 'wb') as output: unittest.main(testRunner=xmlrunner.XMLTestRunner(output=output), buffer=False) if __name__ == '__main__': - time.sleep(100000) main() From a999a499236e598f00978f4c9597b6aadb2f4aa3 Mon Sep 17 00:00:00 2001 From: I517992 Date: Thu, 8 Jul 2021 17:28:28 +0800 Subject: [PATCH 19/20] recover test --- infrabox/test/e2e/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/infrabox/test/e2e/test.py b/infrabox/test/e2e/test.py index 4396d82ec..2f45d86b3 100644 --- a/infrabox/test/e2e/test.py +++ b/infrabox/test/e2e/test.py @@ -204,7 +204,7 @@ def run_it(self, cwd): self._print_job_logs() - # def test_docker_job(self): + #def test_docker_job(self): # self.run_it('/infrabox/context/infrabox/test/e2e/tests/docker_job') # self.expect_job('test') @@ -338,7 +338,7 @@ def main(): print("Server not yet ready") - time.sleep(900000) + time.sleep(90) print("Starting tests") with open('results.xml', 'wb') as output: From c778f584bbd6b0def7dfe22a4e2e22def4e3f60b Mon Sep 17 00:00:00 2001 From: I517992 Date: Thu, 8 Jul 2021 17:39:13 +0800 Subject: [PATCH 20/20] change it to 2700 --- infrabox/generator/e2e.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infrabox/generator/e2e.json b/infrabox/generator/e2e.json index ee827c866..36482b666 100644 --- a/infrabox/generator/e2e.json +++ b/infrabox/generator/e2e.json @@ -12,7 +12,7 @@ "cache": { "image": true }, - "timeout": 360000, + "timeout": 2700, "services": [{ "apiVersion": "gcp.service.infrabox.net/v1alpha1", "kind": "GKECluster",