diff --git a/deploy/cluster-status/templates/deployment.yaml b/deploy/cluster-status/templates/deployment.yaml index 1da8d3a1d..be9b73e2a 100644 --- a/deploy/cluster-status/templates/deployment.yaml +++ b/deploy/cluster-status/templates/deployment.yaml @@ -1,10 +1,13 @@ -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: infrabox-cluster-status 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 077329626..b83f37dab 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 @@ -6,6 +6,9 @@ metadata: labels: app: infrabox-api spec: + selector: + matchLabels: + app: infrabox-api replicas: {{ default 1 .Values.api.replicas }} template: metadata: @@ -81,4 +84,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..faa4bc833 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 @@ -7,6 +7,9 @@ metadata: labels: app: infrabox-checker spec: + selector: + matchLabels: + app: infrabox-checker replicas: 1 template: metadata: @@ -65,4 +68,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..7516947ab 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 @@ -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/fluentbit/daemonset.yaml b/deploy/infrabox/templates/fluentbit/daemonset.yaml index cae3d396d..24f287e5e 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 @@ -6,6 +6,9 @@ metadata: labels: app: infrabox-fluent-bit spec: + selector: + matchLabels: + app: infrabox-fluent-bit template: metadata: labels: diff --git a/deploy/infrabox/templates/gc/deployment.yaml b/deploy/infrabox/templates/gc/deployment.yaml index 7a7c0db99..95fda311b 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 @@ -6,6 +6,9 @@ metadata: labels: app: infrabox-gc spec: + selector: + matchLabels: + app: infrabox-gc replicas: 1 template: metadata: @@ -29,4 +32,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..238e9d0cd 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 @@ -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 0475b81fb..b71978949 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 @@ -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 89571671c..1c880d5fe 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 @@ -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 c704cd311..e3cb4a157 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 @@ -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 9e3b1dac1..d26b3a9e2 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 @@ -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 b41229df0..0d935516d 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 @@ -7,6 +7,9 @@ metadata: labels: app: infrabox-status-cachet spec: + selector: + matchLabels: + app: infrabox-status-cachet replicas: 1 template: metadata: 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" } }] }] diff --git a/infrabox/test/e2e/entrypoint.sh b/infrabox/test/e2e/entrypoint.sh index 1714a48a2..9d1a91cc6 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 @@ -93,8 +86,8 @@ _getPodName() { _installPostgres() { echo "## Install postgres" helm install -n postgres stable/postgresql \ - --version 1.0.0 \ - --set imageTag=9.6.2,postgresPassword=postgres,probes.readiness.periodSeconds=5 \ + --version 7.0.0 \ + --set postgresqlPassword=postgres,readinessProbe.periodSeconds=5 \ --wait \ --namespace infrabox-system @@ -104,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 diff --git a/src/services/aks/Dockerfile b/src/services/aks/Dockerfile index 8898717a4..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 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/aks/pkg/controller/akscluster/akscluster_controller.go b/src/services/aks/pkg/controller/akscluster/akscluster_controller.go index 5d399545c..afe60463f 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", @@ -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/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/gardener/pkg/stub/handler.go b/src/services/gardener/pkg/stub/handler.go index d09dc8e8c..418fa33e9 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", @@ -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", 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" . }}