From 06329d3f8ae307dd42ca403af19a102afc3b60cc Mon Sep 17 00:00:00 2001 From: Abhimanyu Babbar Date: Mon, 26 Aug 2024 18:19:05 +0530 Subject: [PATCH 1/5] fix: login using docker creds on the node to allow to pull the desired image --- .github/workflows/ut-tests.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ut-tests.yml b/.github/workflows/ut-tests.yml index 2f2f303219..7cb7cdafcb 100644 --- a/.github/workflows/ut-tests.yml +++ b/.github/workflows/ut-tests.yml @@ -29,6 +29,12 @@ jobs: with: fetch-depth: 1 + - name: Login to Dockerhub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Setup Node uses: actions/setup-node@v4.0.3 with: From eb8f289772f8bb0278227cc620d904290a5a14ae Mon Sep 17 00:00:00 2001 From: Abhimanyu Babbar Date: Mon, 26 Aug 2024 19:59:48 +0530 Subject: [PATCH 2/5] fix: add steps to create regcred secret and then patch deployment with it --- .github/workflows/ut-tests.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ut-tests.yml b/.github/workflows/ut-tests.yml index 7cb7cdafcb..63b173e395 100644 --- a/.github/workflows/ut-tests.yml +++ b/.github/workflows/ut-tests.yml @@ -72,6 +72,12 @@ jobs: --set gateway.image=rudderlabs/rudder-openfaas-gateway:0.25.2 \ --set faasnetes.image=rudderlabs/rudder-openfaas-faas-netes:0.15.4 + - name: Create regcred secret + run: kubectl create secret docker-registry regcred --docker-server=https://index.docker.io/v1/ --docker-username=$DOCKERHUB_USERNAME --docker-password=$DOCKERHUB_TOKEN --docker-email=$DOCKERHUB_EMAIL -n openfaas + + - name: Patch Gateway Deployment with ImagePullSecret + run: 'kubectl patch deployment gateway -n openfaas -p=''{"spec": {"template": {"spec": {"imagePullSecrets": [{"name": "regcred"}]}}}}''' + - name: Wait for deployment "gateway" rollout run: kubectl rollout status deploy/gateway --timeout 120s -n openfaas From 4e2ec5b2b60de8863a40293d2a66c4dbeb982ce3 Mon Sep 17 00:00:00 2001 From: Abhimanyu Babbar Date: Mon, 26 Aug 2024 20:04:39 +0530 Subject: [PATCH 3/5] chore: fix the github action --- .github/workflows/ut-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ut-tests.yml b/.github/workflows/ut-tests.yml index 63b173e395..3beb1b36fc 100644 --- a/.github/workflows/ut-tests.yml +++ b/.github/workflows/ut-tests.yml @@ -73,7 +73,7 @@ jobs: --set faasnetes.image=rudderlabs/rudder-openfaas-faas-netes:0.15.4 - name: Create regcred secret - run: kubectl create secret docker-registry regcred --docker-server=https://index.docker.io/v1/ --docker-username=$DOCKERHUB_USERNAME --docker-password=$DOCKERHUB_TOKEN --docker-email=$DOCKERHUB_EMAIL -n openfaas + run: kubectl create secret docker-registry regcred --docker-server=https://index.docker.io/v1/ --docker-username=${{ secrets.DOCKERHUB_USERNAME }} --docker-password=${{ secrets.DOCKERHUB_TOKEN }} --docker-email=${{ secrets.DOCKERHUB_EMAIL }} -n openfaas - name: Patch Gateway Deployment with ImagePullSecret run: 'kubectl patch deployment gateway -n openfaas -p=''{"spec": {"template": {"spec": {"imagePullSecrets": [{"name": "regcred"}]}}}}''' From ebdd4713e435aef2422b09c6a1a7a534b685041e Mon Sep 17 00:00:00 2001 From: Abhimanyu Babbar Date: Mon, 26 Aug 2024 20:46:12 +0530 Subject: [PATCH 4/5] chore: patch the service account in openfaas-fn ns to allow for pulling openfaas flask base images --- .github/workflows/ut-tests.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ut-tests.yml b/.github/workflows/ut-tests.yml index 3beb1b36fc..a96030c552 100644 --- a/.github/workflows/ut-tests.yml +++ b/.github/workflows/ut-tests.yml @@ -72,9 +72,15 @@ jobs: --set gateway.image=rudderlabs/rudder-openfaas-gateway:0.25.2 \ --set faasnetes.image=rudderlabs/rudder-openfaas-faas-netes:0.15.4 - - name: Create regcred secret + - name: Create regcred secret in openfaas run: kubectl create secret docker-registry regcred --docker-server=https://index.docker.io/v1/ --docker-username=${{ secrets.DOCKERHUB_USERNAME }} --docker-password=${{ secrets.DOCKERHUB_TOKEN }} --docker-email=${{ secrets.DOCKERHUB_EMAIL }} -n openfaas + - name: Create regcred secret in openfaas-fn + run: kubectl create secret docker-registry regcred --docker-server=https://index.docker.io/v1/ --docker-username=${{ secrets.DOCKERHUB_USERNAME }} --docker-password=${{ secrets.DOCKERHUB_TOKEN }} --docker-email=${{ secrets.DOCKERHUB_EMAIL }} -n openfaas-fn + + - name: Patch default service account in openfaas-fn + run: 'kubectl patch serviceaccount default -n openfaas-fn -p ''{"imagePullSecrets": [{"name": "regcred"}]}''' + - name: Patch Gateway Deployment with ImagePullSecret run: 'kubectl patch deployment gateway -n openfaas -p=''{"spec": {"template": {"spec": {"imagePullSecrets": [{"name": "regcred"}]}}}}''' From 1fd195dc1117b5cd7aeef0b15cba9839c20b649e Mon Sep 17 00:00:00 2001 From: Abhimanyu Babbar Date: Mon, 26 Aug 2024 22:52:01 +0530 Subject: [PATCH 5/5] chore: minor fixes --- .github/workflows/ut-tests.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ut-tests.yml b/.github/workflows/ut-tests.yml index a96030c552..b825bdb9d3 100644 --- a/.github/workflows/ut-tests.yml +++ b/.github/workflows/ut-tests.yml @@ -29,12 +29,6 @@ jobs: with: fetch-depth: 1 - - name: Login to Dockerhub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Setup Node uses: actions/setup-node@v4.0.3 with: @@ -81,8 +75,8 @@ jobs: - name: Patch default service account in openfaas-fn run: 'kubectl patch serviceaccount default -n openfaas-fn -p ''{"imagePullSecrets": [{"name": "regcred"}]}''' - - name: Patch Gateway Deployment with ImagePullSecret - run: 'kubectl patch deployment gateway -n openfaas -p=''{"spec": {"template": {"spec": {"imagePullSecrets": [{"name": "regcred"}]}}}}''' + - name: Patch deployment "gateway" + run: 'kubectl patch deployment gateway -n openfaas -p ''{"spec": {"template": {"spec": {"imagePullSecrets": [{"name": "regcred"}]}}}}''' - name: Wait for deployment "gateway" rollout run: kubectl rollout status deploy/gateway --timeout 120s -n openfaas