From 99f2a6d50bb90cd2da264e3431796b04d7cafe5d Mon Sep 17 00:00:00 2001 From: Vibhav Bobade Date: Tue, 7 Nov 2023 14:35:50 +0530 Subject: [PATCH 1/5] add gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index a6f21c9..7ab4242 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ src/node_modules +.idea From a166190ab93dbe195f3da817b964c2f99bc7ba12 Mon Sep 17 00:00:00 2001 From: Vibhav Bobade Date: Tue, 7 Nov 2023 14:38:40 +0530 Subject: [PATCH 2/5] use kustomize on builds --- .github/k8s/deployment.yaml | 18 ++++++++++++++++++ .github/k8s/ingress.yaml | 20 ++++++++++++++++++++ .github/k8s/kustomization.yaml | 6 ++++++ .github/k8s/service.yaml | 10 ++++++++++ 4 files changed, 54 insertions(+) create mode 100644 .github/k8s/deployment.yaml create mode 100644 .github/k8s/ingress.yaml create mode 100644 .github/k8s/kustomization.yaml create mode 100644 .github/k8s/service.yaml diff --git a/.github/k8s/deployment.yaml b/.github/k8s/deployment.yaml new file mode 100644 index 0000000..d451510 --- /dev/null +++ b/.github/k8s/deployment.yaml @@ -0,0 +1,18 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: web +spec: + selector: + matchLabels: + app: web + template: + metadata: + labels: + app: web + spec: + containers: + - name: web + image: registry.uffizzi.com/quickstart + ports: + - containerPort: 8080 diff --git a/.github/k8s/ingress.yaml b/.github/k8s/ingress.yaml new file mode 100644 index 0000000..5d8bab3 --- /dev/null +++ b/.github/k8s/ingress.yaml @@ -0,0 +1,20 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: web +spec: + ingressClassName: uffizzi + rules: + - host: web.example.com + http: + paths: + - backend: + service: + name: web + port: + number: 8080 + path: / + pathType: Prefix + tls: + - hosts: + - web.example.com diff --git a/.github/k8s/kustomization.yaml b/.github/k8s/kustomization.yaml new file mode 100644 index 0000000..f77144d --- /dev/null +++ b/.github/k8s/kustomization.yaml @@ -0,0 +1,6 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - deployment.yaml + - ingress.yaml + - service.yaml \ No newline at end of file diff --git a/.github/k8s/service.yaml b/.github/k8s/service.yaml new file mode 100644 index 0000000..12d5c21 --- /dev/null +++ b/.github/k8s/service.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Service +metadata: + name: web +spec: + ports: + - port: 8080 + type: ClusterIP + selector: + app: web From abc880e221ed21f4817e7330bf08e8d45f92318f Mon Sep 17 00:00:00 2001 From: Vibhav Bobade Date: Tue, 7 Nov 2023 14:40:04 +0530 Subject: [PATCH 3/5] fix e2e --- .github/workflows/uffizzi-cluster.yaml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/uffizzi-cluster.yaml b/.github/workflows/uffizzi-cluster.yaml index 7ce2de7..02056a3 100644 --- a/.github/workflows/uffizzi-cluster.yaml +++ b/.github/workflows/uffizzi-cluster.yaml @@ -92,17 +92,20 @@ jobs: - name: Apply Kustomize to test the new image id: prev run: | - # Change the image name to those just built and pushed. - kustomize edit set image uffizzi/hello-world-k8s=${{ needs.build-image.outputs.tags }} - if [[ ${RUNNER_DEBUG} == 1 ]]; then - cat kustomization.yaml - echo "`pwd`" - echo "`ls`" + pwd + ls -la fi - - # Apply kustomized manifests to virtual cluster. - kubectl apply --kustomize . --kubeconfig ./kubeconfig + ( + cp ./kubeconfig ./.github/k8s + cd .github/k8s + # Change the image name to those just built and pushed. + kustomize edit set image uffizzi/hello-world-k8s=${{ needs.build-image.outputs.tags }} + + + # Apply kustomized manifests to virtual cluster. + kubectl apply --kustomize . --kubeconfig ./kubeconfig + ) # Allow uffizzi to sync the resources sleep 5 From 2eb5fe407ac2eba91eda60ee2030b785a342c61f Mon Sep 17 00:00:00 2001 From: Vibhav Bobade Date: Tue, 7 Nov 2023 14:43:06 +0530 Subject: [PATCH 4/5] update docker build context --- .github/workflows/uffizzi-cluster.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/uffizzi-cluster.yaml b/.github/workflows/uffizzi-cluster.yaml index 02056a3..946c815 100644 --- a/.github/workflows/uffizzi-cluster.yaml +++ b/.github/workflows/uffizzi-cluster.yaml @@ -39,7 +39,7 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - context: ./ + context: ./src cache-from: type=gha cache-to: type=gha,mode=max From 3f12863699a24a40c4e19bb54e30d819224728e4 Mon Sep 17 00:00:00 2001 From: Vibhav Bobade Date: Tue, 7 Nov 2023 14:54:21 +0530 Subject: [PATCH 5/5] add more options to the cluster creations --- .github/workflows/uffizzi-cluster.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/uffizzi-cluster.yaml b/.github/workflows/uffizzi-cluster.yaml index 946c815..4840a26 100644 --- a/.github/workflows/uffizzi-cluster.yaml +++ b/.github/workflows/uffizzi-cluster.yaml @@ -88,6 +88,8 @@ jobs: with: cluster-name: pr-${{ github.event.pull_request.number }}-e2e-helm server: https://app.uffizzi.com + k8s-version: 1.28 + kubeconfig: kubeconfig - name: Apply Kustomize to test the new image id: prev