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

Fix e2e test #481

Open
wants to merge 26 commits into
base: master
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
5 changes: 4 additions & 1 deletion deploy/cluster-status/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
7 changes: 5 additions & 2 deletions deploy/infrabox/templates/api/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: infrabox-api
namespace: {{ template "system_namespace" . }}
labels:
app: infrabox-api
spec:
selector:
matchLabels:
app: infrabox-api
replicas: {{ default 1 .Values.api.replicas }}
template:
metadata:
Expand Down Expand Up @@ -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 }}
{{ include "volumes_dev" . | indent 16 }}
7 changes: 5 additions & 2 deletions deploy/infrabox/templates/checker/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{{ if or .Values.ha.enabled .Values.monitoring.enabled }}
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: infrabox-checker
namespace: {{ template "system_namespace" . }}
labels:
app: infrabox-checker
spec:
selector:
matchLabels:
app: infrabox-checker
replicas: 1
template:
metadata:
Expand Down Expand Up @@ -65,4 +68,4 @@ spec:
{{ include "volumes_rsa" . | indent 16 }}
{{ include "volumes_gcs" . | indent 16 }}
{{ include "volumes_dev" . | indent 16 }}
{{ end }}
{{ end }}
5 changes: 4 additions & 1 deletion deploy/infrabox/templates/docker-registry/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: infrabox-docker-registry
namespace: {{ template "system_namespace" . }}
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:
Expand Down
5 changes: 4 additions & 1 deletion deploy/infrabox/templates/fluentbit/daemonset.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: infrabox-fluent-bit
namespace: {{ template "system_namespace" . }}
labels:
app: infrabox-fluent-bit
spec:
selector:
matchLabels:
app: infrabox-fluent-bit
template:
metadata:
labels:
Expand Down
7 changes: 5 additions & 2 deletions deploy/infrabox/templates/gc/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: infrabox-gc
namespace: {{ template "system_namespace" . }}
labels:
app: infrabox-gc
spec:
selector:
matchLabels:
app: infrabox-gc
replicas: 1
template:
metadata:
Expand All @@ -29,4 +32,4 @@ spec:
{{ include "env_azure" . | indent 16 }}
{{ include "env_swift" . | indent 16 }}
volumes:
{{ include "volumes_database" . | indent 16 }}
{{ include "volumes_database" . | indent 16 }}
2 changes: 1 addition & 1 deletion deploy/infrabox/templates/gerrit/review.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion deploy/infrabox/templates/gerrit/trigger.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 4 additions & 1 deletion deploy/infrabox/templates/github/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
{{ define "github_deployment" }}
{{ if .Values.github.enabled }}
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: infrabox-github
namespace: {{ template "system_namespace" . }}
labels:
app: infrabox-github
spec:
selector:
matchLabels:
app: infrabox-github
replicas: 1
template:
metadata:
Expand Down
5 changes: 4 additions & 1 deletion deploy/infrabox/templates/grafana/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{{ if .Values.monitoring.enabled }}
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: infrabox-grafana
namespace: {{ template "system_namespace" . }}
labels:
app: infrabox-grafana
spec:
selector:
matchLabels:
app: infrabox-grafana
replicas: 1
template:
metadata:
Expand Down
5 changes: 4 additions & 1 deletion deploy/infrabox/templates/metrics/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{{ if .Values.monitoring.enabled }}
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: infrabox-metrics
namespace: {{ template "system_namespace" . }}
labels:
app: infrabox-metrics
spec:
selector:
matchLabels:
app: infrabox-metrics
replicas: 1
template:
metadata:
Expand Down
5 changes: 4 additions & 1 deletion deploy/infrabox/templates/scheduler/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: infrabox-scheduler
namespace: {{ template "system_namespace" . }}
labels:
app: infrabox-scheduler
spec:
selector:
matchLabels:
app: infrabox-scheduler
replicas: 1
template:
metadata:
Expand Down
5 changes: 4 additions & 1 deletion deploy/infrabox/templates/static/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{{ define "static_deployment" }}
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: infrabox-static
namespace: {{ template "system_namespace" . }}
labels:
app: infrabox-static
spec:
selector:
matchLabels:
app: infrabox-static
replicas: 1
template:
metadata:
Expand Down
5 changes: 4 additions & 1 deletion deploy/infrabox/templates/status-cachet/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{{ if .Values.cachet.enabled }}
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: infrabox-status-cachet
namespace: {{ template "system_namespace" . }}
labels:
app: infrabox-status-cachet
spec:
selector:
matchLabels:
app: infrabox-status-cachet
replicas: 1
template:
metadata:
Expand Down
4 changes: 2 additions & 2 deletions infrabox/generator/e2e.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -24,7 +24,7 @@
"numNodes": 2,
"preemptible": false,
"zone": "us-east1-b",
"clusterVersion": "1.15"
"clusterVersion": "1.18"
}
}]
}]
Expand Down
37 changes: 15 additions & 22 deletions infrabox/test/e2e/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/services/aks/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "infrabox-service-aks.fullname" . }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "infrabox-service-gardener.fullname" . }}
Expand Down
4 changes: 2 additions & 2 deletions src/services/gardener/pkg/stub/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "infrabox-service-namespace.fullname" . }}
Expand Down