From bbe673d32ba5b9e650e2ff5d2fc72306ab4ee49a Mon Sep 17 00:00:00 2001 From: Beppe Vanrolleghem Date: Tue, 3 Mar 2020 20:33:28 +0100 Subject: [PATCH] trigger update --- .gitignore | 2 +- deploy.yaml | 13 ++++++++----- manifests/triggers/trigger-template.yaml | 8 +++++++- manifests/triggers/webhook-run.yaml | 2 +- serverA/app.py | 11 +++++++++++ 5 files changed, 28 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 8df380c..d4cc5a3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ config.json -manifests/triggers/webhook-secret.yaml +manifests/resources/secrets.yaml venv diff --git a/deploy.yaml b/deploy.yaml index 5408a41..c1731ea 100644 --- a/deploy.yaml +++ b/deploy.yaml @@ -28,6 +28,7 @@ spec: containers: - name: front-end image: beppev/server-a:latest + imagePullPolicy: "Always" ports: - containerPort: 5000 --- @@ -55,6 +56,7 @@ spec: containers: - name: front-end image: beppev/server-b:latest + imagePullPolicy: "Always" ports: - containerPort: 6000 --- @@ -82,6 +84,7 @@ spec: containers: - name: front-end image: beppev/server-c:latest + imagePullPolicy: "Always" ports: - containerPort: 6000 --- @@ -159,18 +162,18 @@ metadata: app: "project-1" spec: hosts: - "*" + - "*" gateways: - expose-server-gateway http: - match: - uri: - prefix: /server-a/ + prefix: /server-a route: - destination: - port: - number: 5000 - host: expose-server-service + port: + number: 5000 + host: expose-server-service --- # TODO fix gateway zodat we ingress gateway kunnen gebruike ipv de fuken loadbalancer. apiVersion: networking.istio.io/v1alpha3 kind: Gateway diff --git a/manifests/triggers/trigger-template.yaml b/manifests/triggers/trigger-template.yaml index 4a4e547..7ae7a86 100644 --- a/manifests/triggers/trigger-template.yaml +++ b/manifests/triggers/trigger-template.yaml @@ -38,4 +38,10 @@ spec: - name: imageTag-b value: "latest" - name: pathToContext-b - value: "./serverB" \ No newline at end of file + value: "./serverB" + - name: imageUrl-c + value: "server-c" + - name: imageTag-c + value: "latest" + - name: pathToContext-c + value: "./serverC" \ No newline at end of file diff --git a/manifests/triggers/webhook-run.yaml b/manifests/triggers/webhook-run.yaml index 3078d1f..5ec3839 100644 --- a/manifests/triggers/webhook-run.yaml +++ b/manifests/triggers/webhook-run.yaml @@ -8,7 +8,7 @@ spec: inputs: params: - name: GitHubOrg - value: "github.com" + value: "beppevanrolleghem" - name: GitHubUser value: "beppevanrolleghem" - name: GitHubRepo diff --git a/serverA/app.py b/serverA/app.py index 884cfe7..1fb7633 100644 --- a/serverA/app.py +++ b/serverA/app.py @@ -5,11 +5,22 @@ app = Flask(__name__) URL = "http://server-check:6000" +@app.errorhandler(404) +def page_not_found(error): + return "beppe's 404 error" @app.route('/') def doRequest(): return "it works" +@app.route('/server-a') +def checkThis(): + return "server-a is apparently something to worry abt" + +@app.route("/server-a/check") +def itAlsoWorks(): + return requests.get(URL).json() + @app.route('/check') def itWorks(): return requests.get(URL).json()