From 3116cd07aba03b92853397c8e40849b82a410888 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Fri, 19 Mar 2021 19:56:34 +0100 Subject: [PATCH 01/43] Add minikube tests --- .github/workflows/ci-actions.yml | 561 ++-- .../application-inventory/db-deploy.yml | 84 + kubernetes/application-inventory/db-pvc.yml | 16 + kubernetes/application-inventory/db-svc.yml | 21 + kubernetes/application-inventory/deploy.yml | 77 + kubernetes/application-inventory/svc.yml | 23 + kubernetes/controls/db-deploy.yml | 84 + kubernetes/controls/db-pvc.yml | 16 + kubernetes/controls/db-svc.yml | 21 + kubernetes/controls/deploy.yml | 77 + kubernetes/controls/svc.yml | 22 + kubernetes/ing.yml | 34 + kubernetes/keycloak/cm.yml | 2346 +++++++++++++++++ kubernetes/keycloak/db-deploy.yml | 82 + kubernetes/keycloak/db-pvc.yml | 16 + kubernetes/keycloak/db-svc.yml | 21 + kubernetes/keycloak/deploy.yml | 72 + kubernetes/keycloak/svc.yml | 16 + kubernetes/start-minikube.sh | 5 + kubernetes/ui/deploy.yml | 73 + kubernetes/ui/svc.yml | 17 + public/keycloak.json | 2 +- src/setupProxy.js | 11 +- 23 files changed, 3444 insertions(+), 253 deletions(-) create mode 100644 kubernetes/application-inventory/db-deploy.yml create mode 100644 kubernetes/application-inventory/db-pvc.yml create mode 100644 kubernetes/application-inventory/db-svc.yml create mode 100644 kubernetes/application-inventory/deploy.yml create mode 100644 kubernetes/application-inventory/svc.yml create mode 100644 kubernetes/controls/db-deploy.yml create mode 100644 kubernetes/controls/db-pvc.yml create mode 100644 kubernetes/controls/db-svc.yml create mode 100644 kubernetes/controls/deploy.yml create mode 100644 kubernetes/controls/svc.yml create mode 100644 kubernetes/ing.yml create mode 100644 kubernetes/keycloak/cm.yml create mode 100644 kubernetes/keycloak/db-deploy.yml create mode 100644 kubernetes/keycloak/db-pvc.yml create mode 100644 kubernetes/keycloak/db-svc.yml create mode 100644 kubernetes/keycloak/deploy.yml create mode 100644 kubernetes/keycloak/svc.yml create mode 100755 kubernetes/start-minikube.sh create mode 100644 kubernetes/ui/deploy.yml create mode 100644 kubernetes/ui/svc.yml diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index 1b043336..d740eff2 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -9,268 +9,329 @@ on: - main jobs: - unit-test: - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [10.x, 12.x, 14.x] - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - name: Build - run: | - yarn install - yarn build - - name: Test - run: yarn test --coverage --watchAll=false - - uses: codecov/codecov-action@v1 - with: - flags: unitests + # unit-test: + # runs-on: ubuntu-latest + # strategy: + # matrix: + # node-version: [10.x, 12.x, 14.x] + # steps: + # - uses: actions/checkout@v2 + # - name: Use Node.js ${{ matrix.node-version }} + # uses: actions/setup-node@v1 + # with: + # node-version: ${{ matrix.node-version }} + # - name: Build + # run: | + # yarn install + # yarn build + # - name: Test + # run: yarn test --coverage --watchAll=false + # - uses: codecov/codecov-action@v1 + # with: + # flags: unitests + + # e2e: + # needs: [unit-test] + # runs-on: ${{ matrix.os }} + # strategy: + # matrix: + # os: [ubuntu-latest] + # browser: [chrome, firefox] + # services: + # keycloak: + # image: quay.io/keycloak/keycloak:12.0.2 + # ports: + # - 8180:8080 + # env: + # KEYCLOAK_USER: admin + # KEYCLOAK_PASSWORD: admin + # options: >- + # --health-cmd "curl --fail http://localhost:8080/auth || exit 1" + # --health-interval 10s + # --health-timeout 5s + # --health-retries 5 + # controls-db: + # image: postgres:13.1 + # ports: + # - 5433:5432 + # env: + # POSTGRES_USER: user + # POSTGRES_PASSWORD: password + # POSTGRES_DB: controls_db + # options: >- + # --health-cmd pg_isready + # --health-interval 10s + # --health-timeout 5s + # --health-retries 5 + # application-inventory-db: + # image: postgres:13.1 + # ports: + # - 5434:5432 + # env: + # POSTGRES_USER: user + # POSTGRES_PASSWORD: password + # POSTGRES_DB: application_inventory_db + # options: >- + # --health-cmd pg_isready + # --health-interval 10s + # --health-timeout 5s + # --health-retries 5 + # steps: + # - name: Checkout + # uses: actions/checkout@v2 + # - name: Keycloak Admin CLI + # uses: carlosthe19916/keycloak-action@0.4 + # with: + # server: http://keycloak:8080/auth + # username: admin + # password: admin + # kcadm: create realms -f konveyor-realm.json + # - name: Controls API + # run: | + # docker run -d --name controls --network ${{ job.services.controls-db.network }} --network-alias controls -p 8081:8080 \ + # -e QUARKUS_HTTP_PORT=8080 \ + # -e QUARKUS_DATASOURCE_USERNAME=user \ + # -e QUARKUS_DATASOURCE_PASSWORD=password \ + # -e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://controls-db:5432/controls_db \ + # -e QUARKUS_OIDC_AUTH_SERVER_URL=http://keycloak:8080/auth/realms/konveyor \ + # -e QUARKUS_OIDC_CLIENT_ID=controls-api \ + # -e QUARKUS_OIDC_CREDENTIALS_SECRET=secret quay.io/konveyor/tackle-controls:latest-native + # sleep 5s && docker logs controls + # - name: Application inventory API + # run: | + # docker run -d --name application-inventory --network ${{ job.services.application-inventory-db.network }} --network-alias application-inventory -p 8082:8080 \ + # -e QUARKUS_HTTP_PORT=8080 \ + # -e QUARKUS_DATASOURCE_USERNAME=user \ + # -e QUARKUS_DATASOURCE_PASSWORD=password \ + # -e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://application-inventory-db:5432/application_inventory_db \ + # -e QUARKUS_OIDC_AUTH_SERVER_URL=http://keycloak:8080/auth/realms/konveyor \ + # -e QUARKUS_OIDC_CLIENT_ID=application-inventory-api \ + # -e QUARKUS_OIDC_CREDENTIALS_SECRET=secret quay.io/konveyor/tackle-application-inventory:latest-native + # sleep 5s && docker logs application-inventory + # - name: Build + # run: | + # yarn install + # yarn build:instrumentation + # - name: Cypress run + # uses: cypress-io/github-action@v2 + # with: + # record: false + # start: yarn run ui:start + # wait-on: "http://localhost:3000" + # wait-on-timeout: 120 + # config: pageLoadTimeout=100000 + # browser: ${{ matrix.browser }} + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # - uses: actions/upload-artifact@v1 + # if: failure() + # with: + # name: e2e-screenshots-${{ matrix.os }}-${{ matrix.browser }} + # path: cypress/screenshots + # - uses: actions/upload-artifact@v1 + # if: always() + # with: + # name: e2e-videos-${{ matrix.os }}-${{ matrix.browser }} + # path: cypress/videos + # - uses: codecov/codecov-action@v1 + # with: + # flags: e2etests - e2e: - needs: [unit-test] + e2e-ks8: + # needs: [unit-test] runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest] - browser: [chrome, firefox] - services: - keycloak: - image: quay.io/keycloak/keycloak:12.0.2 - ports: - - 8180:8080 - env: - KEYCLOAK_USER: admin - KEYCLOAK_PASSWORD: admin - options: >- - --health-cmd "curl --fail http://localhost:8080/auth || exit 1" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - controls-db: - image: postgres:13.1 - ports: - - 5433:5432 - env: - POSTGRES_USER: user - POSTGRES_PASSWORD: password - POSTGRES_DB: controls_db - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - application-inventory-db: - image: postgres:13.1 - ports: - - 5434:5432 - env: - POSTGRES_USER: user - POSTGRES_PASSWORD: password - POSTGRES_DB: application_inventory_db - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 + browser: [chrome] + # browser: [chrome, firefox] steps: - name: Checkout uses: actions/checkout@v2 - - name: Keycloak Admin CLI - uses: carlosthe19916/keycloak-action@0.4 - with: - server: http://keycloak:8080/auth - username: admin - password: admin - kcadm: create realms -f konveyor-realm.json - - name: Controls API - run: | - docker run -d --name controls --network ${{ job.services.controls-db.network }} --network-alias controls -p 8081:8080 \ - -e QUARKUS_HTTP_PORT=8080 \ - -e QUARKUS_DATASOURCE_USERNAME=user \ - -e QUARKUS_DATASOURCE_PASSWORD=password \ - -e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://controls-db:5432/controls_db \ - -e QUARKUS_OIDC_AUTH_SERVER_URL=http://keycloak:8080/auth/realms/konveyor \ - -e QUARKUS_OIDC_CLIENT_ID=controls-api \ - -e QUARKUS_OIDC_CREDENTIALS_SECRET=secret quay.io/konveyor/tackle-controls:latest-native - sleep 5s && docker logs controls - - name: Application inventory API - run: | - docker run -d --name application-inventory --network ${{ job.services.application-inventory-db.network }} --network-alias application-inventory -p 8082:8080 \ - -e QUARKUS_HTTP_PORT=8080 \ - -e QUARKUS_DATASOURCE_USERNAME=user \ - -e QUARKUS_DATASOURCE_PASSWORD=password \ - -e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://application-inventory-db:5432/application_inventory_db \ - -e QUARKUS_OIDC_AUTH_SERVER_URL=http://keycloak:8080/auth/realms/konveyor \ - -e QUARKUS_OIDC_CLIENT_ID=application-inventory-api \ - -e QUARKUS_OIDC_CREDENTIALS_SECRET=secret quay.io/konveyor/tackle-application-inventory:latest-native - sleep 5s && docker logs application-inventory - name: Build run: | yarn install yarn build:instrumentation - - name: Cypress run - uses: cypress-io/github-action@v2 - with: - record: false - start: yarn run ui:start - wait-on: "http://localhost:3000" - wait-on-timeout: 120 - config: pageLoadTimeout=100000 - browser: ${{ matrix.browser }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/upload-artifact@v1 - if: failure() - with: - name: e2e-screenshots-${{ matrix.os }}-${{ matrix.browser }} - path: cypress/screenshots - - uses: actions/upload-artifact@v1 - if: always() + - name: Setup Minikube + uses: manusa/actions-setup-minikube@v2.3.1 with: - name: e2e-videos-${{ matrix.os }}-${{ matrix.browser }} - path: cypress/videos - - uses: codecov/codecov-action@v1 - with: - flags: e2etests + minikube version: "v1.18.1" + kubernetes version: "v1.20.5" + - name: Deploy Tackle + run: | + kubectl create ns tackle + kubectl create -f kubernetes/ing.yml -n tackle - container-images: - if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'konveyor' }} - runs-on: ubuntu-latest - needs: [unit-test, e2e] - steps: - - uses: actions/checkout@v2 - - name: Use Node.js - uses: actions/setup-node@v1 - with: - node-version: 12.x - - name: Build - run: | - yarn install - yarn build - - name: Push to Quay.io - uses: elgohr/Publish-Docker-Github-Action@3.02 - with: - registry: quay.io - name: konveyor/tackle-ui - username: ${{ secrets.QUAYIO_USERNAME }} - password: ${{ secrets.QUAYIO_PASSWORD }} - dockerfile: Dockerfile - snapshot: false - tags: "main" + kubectl create -f kubernetes/keycloak -n tackle + kubectl wait deployment/keycloak --for condition=available --timeout=0 -n tackle - test-container-images: - needs: [container-images] - runs-on: ubuntu-latest - strategy: - matrix: - os: [ubuntu-latest] - browser: [chrome, firefox] - services: - keycloak: - image: quay.io/keycloak/keycloak:12.0.2 - ports: - - 8180:8080 - env: - KEYCLOAK_USER: admin - KEYCLOAK_PASSWORD: admin - options: >- - --health-cmd "curl --fail http://localhost:8080/auth || exit 1" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - controls-db: - image: postgres:13.1 - ports: - - 5433:5432 - env: - POSTGRES_USER: user - POSTGRES_PASSWORD: password - POSTGRES_DB: controls_db - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - application-inventory-db: - image: postgres:13.1 - ports: - - 5434:5432 - env: - POSTGRES_USER: user - POSTGRES_PASSWORD: password - POSTGRES_DB: application_inventory_db - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - steps: - - uses: actions/checkout@v2 - - name: Keycloak Admin CLI - uses: carlosthe19916/keycloak-action@0.4 - with: - server: http://keycloak:8080/auth - username: admin - password: admin - kcadm: create realms -f konveyor-realm.json - - name: Controls API - run: | - docker run -d --name controls --network ${{ job.services.controls-db.network }} --network-alias controls -p 8081:8080 \ - -e QUARKUS_HTTP_PORT=8080 \ - -e QUARKUS_DATASOURCE_USERNAME=user \ - -e QUARKUS_DATASOURCE_PASSWORD=password \ - -e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://controls-db:5432/controls_db \ - -e QUARKUS_OIDC_AUTH_SERVER_URL=http://keycloak:8080/auth/realms/konveyor \ - -e QUARKUS_OIDC_CLIENT_ID=controls-api \ - -e QUARKUS_OIDC_CREDENTIALS_SECRET=secret \ - quay.io/konveyor/tackle-controls:latest-native - sleep 5s && docker logs controls - - name: Application inventory API - run: | - docker run -d --name application-inventory --network ${{ job.services.application-inventory-db.network }} --network-alias application-inventory -p 8082:8080 \ - -e QUARKUS_HTTP_PORT=8080 \ - -e QUARKUS_DATASOURCE_USERNAME=user \ - -e QUARKUS_DATASOURCE_PASSWORD=password \ - -e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://application-inventory-db:5432/application_inventory_db \ - -e QUARKUS_OIDC_AUTH_SERVER_URL=http://keycloak:8080/auth/realms/konveyor \ - -e QUARKUS_OIDC_CLIENT_ID=application-inventory-api \ - -e QUARKUS_OIDC_CREDENTIALS_SECRET=secret \ - quay.io/konveyor/tackle-application-inventory:latest-native - sleep 5s && docker logs application-inventory - - name: Tackle UI - run: | - docker run -d --name tackle-ui --network ${{ job.services.keycloak.network }} --network-alias tackle-ui -p 3000:8080 \ - -e SSO_REALM=konveyor \ - -e SSO_CLIENT_ID=tackle-ui \ - -e SSO_SERVER_URL=http://keycloak:8080/auth \ - -e CONTROLS_API_URL=http://controls:8080/controls \ - -e APPLICATION_INVENTORY_API_URL=http://application-inventory:8080/application-inventory \ - quay.io/konveyor/tackle-ui:main - sleep 5s && docker logs tackle-ui - - name: Cypress run - uses: cypress-io/github-action@v2 - with: - record: false - wait-on: "http://localhost:3000" - wait-on-timeout: 120 - config: pageLoadTimeout=100000 - browser: ${{ matrix.browser }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CYPRESS_auth_base_url: http://localhost:3000/auth - CYPRESS_controls_base_url: http://localhost:8081/controls - CYPRESS_application_inventory_base_url: http://localhost:8082/application-inventory - - uses: actions/upload-artifact@v1 - if: failure() - with: - name: container-screenshots-${{ matrix.os }}-${{ matrix.browser }} - path: cypress/screenshots - - uses: actions/upload-artifact@v1 - if: always() - with: - name: container-videos-${{ matrix.os }}-${{ matrix.browser }} - path: cypress/videos + kubectl create -f kubernetes/controls -n tackle + kubectl wait deployment/tackle-controls --for condition=available --timeout=0 -n tackle + + kubectl create -f kubernetes/application-inventory -n tackle + kubectl wait deployment/tackle-application-inventory --for condition=available --timeout=0 -n tackle + + # export TACKLE_CONTROLS_HOST=$(minikube ip) + # export TACKLE_APPLICATION_INVENTORY_HOST=$(minikube ip) + + # - name: Cypress run + # uses: cypress-io/github-action@v2 + # with: + # record: false + # start: yarn run ui:start + # wait-on: "http://localhost:3000" + # wait-on-timeout: 120 + # config: pageLoadTimeout=100000 + # browser: ${{ matrix.browser }} + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # - uses: actions/upload-artifact@v1 + # if: failure() + # with: + # name: e2e-screenshots-${{ matrix.os }}-${{ matrix.browser }} + # path: cypress/screenshots + # - uses: actions/upload-artifact@v1 + # if: always() + # with: + # name: e2e-videos-${{ matrix.os }}-${{ matrix.browser }} + # path: cypress/videos + # - uses: codecov/codecov-action@v1 + # with: + # flags: e2etests + + # container-images: + # if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'konveyor' }} + # runs-on: ubuntu-latest + # needs: [unit-test, e2e] + # steps: + # - uses: actions/checkout@v2 + # - name: Use Node.js + # uses: actions/setup-node@v1 + # with: + # node-version: 12.x + # - name: Build + # run: | + # yarn install + # yarn build + # - name: Push to Quay.io + # uses: elgohr/Publish-Docker-Github-Action@3.02 + # with: + # registry: quay.io + # name: konveyor/tackle-ui + # username: ${{ secrets.QUAYIO_USERNAME }} + # password: ${{ secrets.QUAYIO_PASSWORD }} + # dockerfile: Dockerfile + # snapshot: false + # tags: "main" + # test-container-images: + # needs: [container-images] + # runs-on: ubuntu-latest + # strategy: + # matrix: + # os: [ubuntu-latest] + # browser: [chrome, firefox] + # services: + # keycloak: + # image: quay.io/keycloak/keycloak:12.0.2 + # ports: + # - 8180:8080 + # env: + # KEYCLOAK_USER: admin + # KEYCLOAK_PASSWORD: admin + # options: >- + # --health-cmd "curl --fail http://localhost:8080/auth || exit 1" + # --health-interval 10s + # --health-timeout 5s + # --health-retries 5 + # controls-db: + # image: postgres:13.1 + # ports: + # - 5433:5432 + # env: + # POSTGRES_USER: user + # POSTGRES_PASSWORD: password + # POSTGRES_DB: controls_db + # options: >- + # --health-cmd pg_isready + # --health-interval 10s + # --health-timeout 5s + # --health-retries 5 + # application-inventory-db: + # image: postgres:13.1 + # ports: + # - 5434:5432 + # env: + # POSTGRES_USER: user + # POSTGRES_PASSWORD: password + # POSTGRES_DB: application_inventory_db + # options: >- + # --health-cmd pg_isready + # --health-interval 10s + # --health-timeout 5s + # --health-retries 5 + # steps: + # - uses: actions/checkout@v2 + # - name: Keycloak Admin CLI + # uses: carlosthe19916/keycloak-action@0.4 + # with: + # server: http://keycloak:8080/auth + # username: admin + # password: admin + # kcadm: create realms -f konveyor-realm.json + # - name: Controls API + # run: | + # docker run -d --name controls --network ${{ job.services.controls-db.network }} --network-alias controls -p 8081:8080 \ + # -e QUARKUS_HTTP_PORT=8080 \ + # -e QUARKUS_DATASOURCE_USERNAME=user \ + # -e QUARKUS_DATASOURCE_PASSWORD=password \ + # -e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://controls-db:5432/controls_db \ + # -e QUARKUS_OIDC_AUTH_SERVER_URL=http://keycloak:8080/auth/realms/konveyor \ + # -e QUARKUS_OIDC_CLIENT_ID=controls-api \ + # -e QUARKUS_OIDC_CREDENTIALS_SECRET=secret \ + # quay.io/konveyor/tackle-controls:latest-native + # sleep 5s && docker logs controls + # - name: Application inventory API + # run: | + # docker run -d --name application-inventory --network ${{ job.services.application-inventory-db.network }} --network-alias application-inventory -p 8082:8080 \ + # -e QUARKUS_HTTP_PORT=8080 \ + # -e QUARKUS_DATASOURCE_USERNAME=user \ + # -e QUARKUS_DATASOURCE_PASSWORD=password \ + # -e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://application-inventory-db:5432/application_inventory_db \ + # -e QUARKUS_OIDC_AUTH_SERVER_URL=http://keycloak:8080/auth/realms/konveyor \ + # -e QUARKUS_OIDC_CLIENT_ID=application-inventory-api \ + # -e QUARKUS_OIDC_CREDENTIALS_SECRET=secret \ + # quay.io/konveyor/tackle-application-inventory:latest-native + # sleep 5s && docker logs application-inventory + # - name: Tackle UI + # run: | + # docker run -d --name tackle-ui --network ${{ job.services.keycloak.network }} --network-alias tackle-ui -p 3000:8080 \ + # -e SSO_REALM=konveyor \ + # -e SSO_CLIENT_ID=tackle-ui \ + # -e SSO_SERVER_URL=http://keycloak:8080/auth \ + # -e CONTROLS_API_URL=http://controls:8080/controls \ + # -e APPLICATION_INVENTORY_API_URL=http://application-inventory:8080/application-inventory \ + # quay.io/konveyor/tackle-ui:main + # sleep 5s && docker logs tackle-ui + # - name: Cypress run + # uses: cypress-io/github-action@v2 + # with: + # record: false + # wait-on: "http://localhost:3000" + # wait-on-timeout: 120 + # config: pageLoadTimeout=100000 + # browser: ${{ matrix.browser }} + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # CYPRESS_auth_base_url: http://localhost:3000/auth + # CYPRESS_controls_base_url: http://localhost:8081/controls + # CYPRESS_application_inventory_base_url: http://localhost:8082/application-inventory + # - uses: actions/upload-artifact@v1 + # if: failure() + # with: + # name: container-screenshots-${{ matrix.os }}-${{ matrix.browser }} + # path: cypress/screenshots + # - uses: actions/upload-artifact@v1 + # if: always() + # with: + # name: container-videos-${{ matrix.os }}-${{ matrix.browser }} + # path: cypress/videos diff --git a/kubernetes/application-inventory/db-deploy.yml b/kubernetes/application-inventory/db-deploy.yml new file mode 100644 index 00000000..3b2368f0 --- /dev/null +++ b/kubernetes/application-inventory/db-deploy.yml @@ -0,0 +1,84 @@ +kind: Deployment +apiVersion: apps/v1 +metadata: + name: application-inventory-db + labels: + app.kubernetes.io/name: application-inventory-db + app.kubernetes.io/version: "10.6" + app.kubernetes.io/component: database + app.kubernetes.io/instance: application-inventory-db + app.kubernetes.io/part-of: tackle +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: application-inventory-db + app.kubernetes.io/version: "10.6" + template: + metadata: + labels: + app.kubernetes.io/name: application-inventory-db + app.kubernetes.io/version: "10.6" + spec: + volumes: + - name: application-inventory-db-data + persistentVolumeClaim: + claimName: application-inventory-db + containers: + - name: postgres + image: postgres:10.6 + ports: + - containerPort: 5432 + protocol: TCP + env: + - name: POSTGRES_USER + value: application-inventory_username + - name: POSTGRES_PASSWORD + value: application-inventory_password + - name: POSTGRES_DB + value: application-inventory_db + resources: {} + livenessProbe: + exec: + command: + - /bin/sh + - "-c" + - | + psql -U $POSTGRES_USER -d $POSTGRES_DB -c 'SELECT 1' + initialDelaySeconds: 60 + timeoutSeconds: 10 + periodSeconds: 10 + successThreshold: 1 + failureThreshold: 3 + readinessProbe: + exec: + command: + - /bin/sh + - "-c" + - | + psql -U $POSTGRES_USER -d $POSTGRES_DB -c 'SELECT 1' + initialDelaySeconds: 10 + timeoutSeconds: 1 + periodSeconds: 10 + successThreshold: 1 + failureThreshold: 3 + terminationMessagePath: "/dev/termination-log" + terminationMessagePolicy: File + imagePullPolicy: IfNotPresent + volumeMounts: + - name: application-inventory-db-data + mountPath: "/var/lib/db" + securityContext: + privileged: false + restartPolicy: Always + terminationGracePeriodSeconds: 30 + dnsPolicy: ClusterFirst + securityContext: {} + schedulerName: default-scheduler + strategy: + type: RollingUpdate + rollingUpdate: + maxUnavailable: 25% + maxSurge: 25% + revisionHistoryLimit: 10 + progressDeadlineSeconds: 600 diff --git a/kubernetes/application-inventory/db-pvc.yml b/kubernetes/application-inventory/db-pvc.yml new file mode 100644 index 00000000..e2ddf10c --- /dev/null +++ b/kubernetes/application-inventory/db-pvc.yml @@ -0,0 +1,16 @@ +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: application-inventory-db + labels: + app.kubernetes.io/name: application-inventory-db + app.kubernetes.io/component: database + app.kubernetes.io/instance: application-inventory-db + app.kubernetes.io/part-of: tackle +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi + volumeMode: Filesystem \ No newline at end of file diff --git a/kubernetes/application-inventory/db-svc.yml b/kubernetes/application-inventory/db-svc.yml new file mode 100644 index 00000000..2eedecd9 --- /dev/null +++ b/kubernetes/application-inventory/db-svc.yml @@ -0,0 +1,21 @@ +kind: Service +apiVersion: v1 +metadata: + name: application-inventory-db + labels: + app.kubernetes.io/name: application-inventory-db + app.kubernetes.io/version: "10.6" + app.kubernetes.io/component: database + app.kubernetes.io/instance: application-inventory-db + app.kubernetes.io/part-of: tackle +spec: + ports: + - name: tcp + protocol: TCP + port: 5432 + targetPort: 5432 + selector: + app.kubernetes.io/name: application-inventory-db + app.kubernetes.io/version: "10.6" + type: ClusterIP + sessionAffinity: None diff --git a/kubernetes/application-inventory/deploy.yml b/kubernetes/application-inventory/deploy.yml new file mode 100644 index 00000000..11fd4ecc --- /dev/null +++ b/kubernetes/application-inventory/deploy.yml @@ -0,0 +1,77 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + annotations: + prometheus.io/port: "8080" + prometheus.io/scheme: http + prometheus.io/scrape: "true" + prometheus.io/path: "/q/metrics" + labels: + app.kubernetes.io/component: rest + app.kubernetes.io/name: tackle-application-inventory + app.kubernetes.io/part-of: tackle + name: tackle-application-inventory +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: tackle-application-inventory + app.kubernetes.io/part-of: tackle + template: + metadata: + annotations: + prometheus.io/port: "8080" + prometheus.io/scheme: http + prometheus.io/scrape: "true" + prometheus.io/path: "/q/metrics" + labels: + app.kubernetes.io/component: rest + app.kubernetes.io/name: tackle-application-inventory + app.kubernetes.io/part-of: tackle + spec: + containers: + - env: + - name: KUBERNETES_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: QUARKUS_DATASOURCE_USERNAME + value: application-inventory_username + - name: QUARKUS_DATASOURCE_PASSWORD + value: application-inventory_password + - name: QUARKUS_DATASOURCE_JDBC_URL + value: jdbc:postgresql://application-inventory-db:5432/application-inventory_db + - name: QUARKUS_OIDC_AUTH_SERVER_URL + value: http://keycloak:8080/auth/realms/konveyor + - name: QUARKUS_OIDC_CLIENT_ID + value: application-inventory-api + - name: QUARKUS_OIDC_CREDENTIALS_SECRET + value: secret + image: quay.io/konveyor/tackle-application-inventory:latest-native + imagePullPolicy: Always + livenessProbe: + failureThreshold: 3 + httpGet: + path: "/application-inventory/q/health/live" + port: 8080 + scheme: HTTP + initialDelaySeconds: 0 + periodSeconds: 30 + successThreshold: 1 + timeoutSeconds: 10 + name: tackle-application-inventory + ports: + - containerPort: 8080 + name: http + protocol: TCP + readinessProbe: + failureThreshold: 3 + httpGet: + path: "/application-inventory/q/health/ready" + port: 8080 + scheme: HTTP + initialDelaySeconds: 0 + periodSeconds: 30 + successThreshold: 1 + timeoutSeconds: 10 + resources: {} diff --git a/kubernetes/application-inventory/svc.yml b/kubernetes/application-inventory/svc.yml new file mode 100644 index 00000000..d1f33e6a --- /dev/null +++ b/kubernetes/application-inventory/svc.yml @@ -0,0 +1,23 @@ +apiVersion: v1 +kind: Service +metadata: + annotations: + prometheus.io/scheme: http + prometheus.io/scrape: 'true' + prometheus.io/path: "/q/metrics" + prometheus.io/port: '8080' + labels: + app.kubernetes.io/name: tackle-application-inventory + app.kubernetes.io/part-of: tackle + app.kubernetes.io/component: rest + app.openshift.io/runtime: quarkus + name: tackle-application-inventory +spec: + ports: + - name: http + port: 8080 + targetPort: 8080 + selector: + app.kubernetes.io/name: tackle-application-inventory + app.kubernetes.io/part-of: tackle + type: ClusterIP \ No newline at end of file diff --git a/kubernetes/controls/db-deploy.yml b/kubernetes/controls/db-deploy.yml new file mode 100644 index 00000000..c3e76a5d --- /dev/null +++ b/kubernetes/controls/db-deploy.yml @@ -0,0 +1,84 @@ +kind: Deployment +apiVersion: apps/v1 +metadata: + name: controls-db + labels: + app.kubernetes.io/name: controls-db + app.kubernetes.io/version: "10.6" + app.kubernetes.io/component: database + app.kubernetes.io/instance: controls-db + app.kubernetes.io/part-of: tackle +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: controls-db + app.kubernetes.io/version: "10.6" + template: + metadata: + labels: + app.kubernetes.io/name: controls-db + app.kubernetes.io/version: "10.6" + spec: + volumes: + - name: controls-db-data + persistentVolumeClaim: + claimName: controls-db + containers: + - name: postgres + image: postgres:10.6 + ports: + - containerPort: 5432 + protocol: TCP + env: + - name: POSTGRES_USER + value: controls_username + - name: POSTGRES_PASSWORD + value: controls_password + - name: POSTGRES_DB + value: controls_db + resources: {} + livenessProbe: + exec: + command: + - /bin/sh + - "-c" + - | + psql -U $POSTGRES_USER -d $POSTGRES_DB -c 'SELECT 1' + initialDelaySeconds: 60 + timeoutSeconds: 10 + periodSeconds: 10 + successThreshold: 1 + failureThreshold: 3 + readinessProbe: + exec: + command: + - /bin/sh + - "-c" + - | + psql -U $POSTGRES_USER -d $POSTGRES_DB -c 'SELECT 1' + initialDelaySeconds: 10 + timeoutSeconds: 1 + periodSeconds: 10 + successThreshold: 1 + failureThreshold: 3 + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + imagePullPolicy: IfNotPresent + volumeMounts: + - name: controls-db-data + mountPath: "/var/lib/db" + securityContext: + privileged: false + restartPolicy: Always + terminationGracePeriodSeconds: 30 + dnsPolicy: ClusterFirst + securityContext: {} + schedulerName: default-scheduler + strategy: + type: RollingUpdate + rollingUpdate: + maxUnavailable: 25% + maxSurge: 25% + revisionHistoryLimit: 10 + progressDeadlineSeconds: 600 diff --git a/kubernetes/controls/db-pvc.yml b/kubernetes/controls/db-pvc.yml new file mode 100644 index 00000000..f3ec4e04 --- /dev/null +++ b/kubernetes/controls/db-pvc.yml @@ -0,0 +1,16 @@ +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: controls-db + labels: + app.kubernetes.io/name: controls-db + app.kubernetes.io/component: database + app.kubernetes.io/instance: controls-db + app.kubernetes.io/part-of: tackle +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi + volumeMode: Filesystem \ No newline at end of file diff --git a/kubernetes/controls/db-svc.yml b/kubernetes/controls/db-svc.yml new file mode 100644 index 00000000..854e59fc --- /dev/null +++ b/kubernetes/controls/db-svc.yml @@ -0,0 +1,21 @@ +kind: Service +apiVersion: v1 +metadata: + name: controls-db + labels: + app.kubernetes.io/name: controls-db + app.kubernetes.io/version: "10.6" + app.kubernetes.io/component: database + app.kubernetes.io/instance: controls-db + app.kubernetes.io/part-of: tackle +spec: + ports: + - name: tcp + protocol: TCP + port: 5432 + targetPort: 5432 + selector: + app.kubernetes.io/name: controls-db + app.kubernetes.io/version: "10.6" + type: ClusterIP + sessionAffinity: None diff --git a/kubernetes/controls/deploy.yml b/kubernetes/controls/deploy.yml new file mode 100644 index 00000000..ea91a28e --- /dev/null +++ b/kubernetes/controls/deploy.yml @@ -0,0 +1,77 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + annotations: + prometheus.io/port: "8080" + prometheus.io/scheme: http + prometheus.io/scrape: "true" + prometheus.io/path: /q/metrics + labels: + app.kubernetes.io/component: rest + app.kubernetes.io/name: tackle-controls + app.kubernetes.io/part-of: tackle + name: tackle-controls +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: tackle-controls + app.kubernetes.io/part-of: tackle + template: + metadata: + annotations: + prometheus.io/port: "8080" + prometheus.io/scheme: http + prometheus.io/scrape: "true" + prometheus.io/path: /q/metrics + labels: + app.kubernetes.io/component: rest + app.kubernetes.io/name: tackle-controls + app.kubernetes.io/part-of: tackle + spec: + containers: + - env: + - name: KUBERNETES_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: QUARKUS_DATASOURCE_USERNAME + value: controls_username + - name: QUARKUS_DATASOURCE_PASSWORD + value: controls_password + - name: QUARKUS_DATASOURCE_JDBC_URL + value: jdbc:postgresql://controls-db:5432/controls_db + - name: QUARKUS_OIDC_AUTH_SERVER_URL + value: http://keycloak:8080/auth/realms/konveyor + - name: QUARKUS_OIDC_CLIENT_ID + value: controls-api + - name: QUARKUS_OIDC_CREDENTIALS_SECRET + value: secret + image: quay.io/konveyor/tackle-controls:latest-native + imagePullPolicy: Always + livenessProbe: + failureThreshold: 3 + httpGet: + path: /controls/q/health/live + port: 8080 + scheme: HTTP + initialDelaySeconds: 0 + periodSeconds: 30 + successThreshold: 1 + timeoutSeconds: 10 + name: tackle-controls + ports: + - containerPort: 8080 + name: http + protocol: TCP + readinessProbe: + failureThreshold: 3 + httpGet: + path: /controls/q/health/ready + port: 8080 + scheme: HTTP + initialDelaySeconds: 0 + periodSeconds: 30 + successThreshold: 1 + timeoutSeconds: 10 + resources: {} \ No newline at end of file diff --git a/kubernetes/controls/svc.yml b/kubernetes/controls/svc.yml new file mode 100644 index 00000000..0415bed9 --- /dev/null +++ b/kubernetes/controls/svc.yml @@ -0,0 +1,22 @@ +apiVersion: v1 +kind: Service +metadata: + annotations: + prometheus.io/port: "8080" + prometheus.io/scheme: http + prometheus.io/scrape: "true" + prometheus.io/path: /q/metrics + labels: + app.kubernetes.io/name: tackle-controls + app.kubernetes.io/part-of: tackle + app.kubernetes.io/component: rest + name: tackle-controls +spec: + ports: + - name: http + port: 8080 + targetPort: 8080 + selector: + app.kubernetes.io/name: tackle-controls + app.kubernetes.io/part-of: tackle + type: ClusterIP diff --git a/kubernetes/ing.yml b/kubernetes/ing.yml new file mode 100644 index 00000000..f22e5f9f --- /dev/null +++ b/kubernetes/ing.yml @@ -0,0 +1,34 @@ +kind: Ingress +apiVersion: networking.k8s.io/v1 +metadata: + name: tackle + labels: + app.kubernetes.io/name: tackle + app.kubernetes.io/component: application + app.kubernetes.io/instance: tackle + app.kubernetes.io/part-of: tackle +spec: + rules: + - http: + paths: + - path: /auth + pathType: ImplementationSpecific + backend: + service: + name: keycloak + port: + number: 8080 + - path: /controls + pathType: ImplementationSpecific + backend: + service: + name: tackle-controls + port: + number: 8080 + - path: /application-inventory + pathType: ImplementationSpecific + backend: + service: + name: tackle-application-inventory + port: + number: 8080 diff --git a/kubernetes/keycloak/cm.yml b/kubernetes/keycloak/cm.yml new file mode 100644 index 00000000..5bbd15a4 --- /dev/null +++ b/kubernetes/keycloak/cm.yml @@ -0,0 +1,2346 @@ +apiVersion: v1 +data: + konveyor-realm.json: | + { + "id": "konveyor", + "realm": "konveyor", + "notBefore": 0, + "revokeRefreshToken": false, + "refreshTokenMaxReuse": 0, + "accessTokenLifespan": 300, + "accessTokenLifespanForImplicitFlow": 900, + "ssoSessionIdleTimeout": 1800, + "ssoSessionMaxLifespan": 36000, + "ssoSessionIdleTimeoutRememberMe": 0, + "ssoSessionMaxLifespanRememberMe": 0, + "offlineSessionIdleTimeout": 2592000, + "offlineSessionMaxLifespanEnabled": false, + "offlineSessionMaxLifespan": 5184000, + "clientSessionIdleTimeout": 0, + "clientSessionMaxLifespan": 0, + "clientOfflineSessionIdleTimeout": 0, + "clientOfflineSessionMaxLifespan": 0, + "accessCodeLifespan": 60, + "accessCodeLifespanUserAction": 300, + "accessCodeLifespanLogin": 1800, + "actionTokenGeneratedByAdminLifespan": 43200, + "actionTokenGeneratedByUserLifespan": 300, + "enabled": true, + "sslRequired": "external", + "registrationAllowed": false, + "registrationEmailAsUsername": false, + "rememberMe": false, + "verifyEmail": false, + "loginWithEmailAllowed": true, + "duplicateEmailsAllowed": false, + "resetPasswordAllowed": false, + "editUsernameAllowed": false, + "bruteForceProtected": false, + "permanentLockout": false, + "maxFailureWaitSeconds": 900, + "minimumQuickLoginWaitSeconds": 60, + "waitIncrementSeconds": 60, + "quickLoginCheckMilliSeconds": 1000, + "maxDeltaTimeSeconds": 43200, + "failureFactor": 30, + "roles": { + "realm": [ + { + "id": "d723b5ff-6c33-4152-b0ac-3ad9c1b79e6c", + "name": "admin", + "composite": false, + "clientRole": false, + "containerId": "konveyor", + "attributes": {} + }, + { + "id": "88607edb-72b0-46fb-8d76-1a75a51a50f0", + "name": "user", + "composite": false, + "clientRole": false, + "containerId": "konveyor", + "attributes": {} + }, + { + "id": "85aa1467-987b-4a71-a7e1-92dffc90323b", + "name": "uma_authorization", + "description": "${role_uma_authorization}", + "composite": false, + "clientRole": false, + "containerId": "konveyor", + "attributes": {} + }, + { + "id": "ca0cb92d-22d8-4590-8935-22182d2848e3", + "name": "offline_access", + "description": "${role_offline-access}", + "composite": false, + "clientRole": false, + "containerId": "konveyor", + "attributes": {} + } + ], + "client": { + "realm-management": [ + { + "id": "6849a9ed-4c25-4cc9-88c8-609cd633f1c7", + "name": "query-groups", + "description": "${role_query-groups}", + "composite": false, + "clientRole": true, + "containerId": "7cd8f4cd-abf4-4d20-904f-7381a29a38b8", + "attributes": {} + }, + { + "id": "08320d88-a140-4511-a094-92eecffa2f31", + "name": "manage-events", + "description": "${role_manage-events}", + "composite": false, + "clientRole": true, + "containerId": "7cd8f4cd-abf4-4d20-904f-7381a29a38b8", + "attributes": {} + }, + { + "id": "e58675c2-c05c-427c-b920-a978a3928b73", + "name": "view-clients", + "description": "${role_view-clients}", + "composite": true, + "composites": { + "client": { + "realm-management": [ + "query-clients" + ] + } + }, + "clientRole": true, + "containerId": "7cd8f4cd-abf4-4d20-904f-7381a29a38b8", + "attributes": {} + }, + { + "id": "9a78c649-6529-477f-a1e0-36d3165407e2", + "name": "manage-authorization", + "description": "${role_manage-authorization}", + "composite": false, + "clientRole": true, + "containerId": "7cd8f4cd-abf4-4d20-904f-7381a29a38b8", + "attributes": {} + }, + { + "id": "227e0d33-7b83-45db-86d5-03467fe24147", + "name": "realm-admin", + "description": "${role_realm-admin}", + "composite": true, + "composites": { + "client": { + "realm-management": [ + "query-groups", + "manage-events", + "view-clients", + "manage-authorization", + "impersonation", + "query-clients", + "view-realm", + "manage-users", + "view-events", + "query-users", + "create-client", + "manage-identity-providers", + "view-identity-providers", + "view-users", + "query-realms", + "view-authorization", + "manage-clients", + "manage-realm" + ] + } + }, + "clientRole": true, + "containerId": "7cd8f4cd-abf4-4d20-904f-7381a29a38b8", + "attributes": {} + }, + { + "id": "f7c107c9-2aac-458a-8f12-93986cce61ab", + "name": "query-clients", + "description": "${role_query-clients}", + "composite": false, + "clientRole": true, + "containerId": "7cd8f4cd-abf4-4d20-904f-7381a29a38b8", + "attributes": {} + }, + { + "id": "b3a531d7-f745-469a-8a0e-a751d48b6d7b", + "name": "impersonation", + "description": "${role_impersonation}", + "composite": false, + "clientRole": true, + "containerId": "7cd8f4cd-abf4-4d20-904f-7381a29a38b8", + "attributes": {} + }, + { + "id": "7e6891b0-1f91-45c9-81d1-ba2fb825fc38", + "name": "view-realm", + "description": "${role_view-realm}", + "composite": false, + "clientRole": true, + "containerId": "7cd8f4cd-abf4-4d20-904f-7381a29a38b8", + "attributes": {} + }, + { + "id": "b4e357bf-bb32-4ee1-ac95-1ffc5ee927f6", + "name": "manage-users", + "description": "${role_manage-users}", + "composite": false, + "clientRole": true, + "containerId": "7cd8f4cd-abf4-4d20-904f-7381a29a38b8", + "attributes": {} + }, + { + "id": "724b6adf-ea10-45b0-a856-05f014f8aca6", + "name": "view-events", + "description": "${role_view-events}", + "composite": false, + "clientRole": true, + "containerId": "7cd8f4cd-abf4-4d20-904f-7381a29a38b8", + "attributes": {} + }, + { + "id": "f29ee958-a37f-428a-b316-669235df7e59", + "name": "query-users", + "description": "${role_query-users}", + "composite": false, + "clientRole": true, + "containerId": "7cd8f4cd-abf4-4d20-904f-7381a29a38b8", + "attributes": {} + }, + { + "id": "f2d6d0de-7ebc-4f0f-a156-f279570ad228", + "name": "create-client", + "description": "${role_create-client}", + "composite": false, + "clientRole": true, + "containerId": "7cd8f4cd-abf4-4d20-904f-7381a29a38b8", + "attributes": {} + }, + { + "id": "52025042-ac41-401b-9657-83d064d04084", + "name": "manage-identity-providers", + "description": "${role_manage-identity-providers}", + "composite": false, + "clientRole": true, + "containerId": "7cd8f4cd-abf4-4d20-904f-7381a29a38b8", + "attributes": {} + }, + { + "id": "850038e6-b323-423b-aab7-64788d8dcbea", + "name": "view-identity-providers", + "description": "${role_view-identity-providers}", + "composite": false, + "clientRole": true, + "containerId": "7cd8f4cd-abf4-4d20-904f-7381a29a38b8", + "attributes": {} + }, + { + "id": "629459d6-1e42-46bb-b313-dd3fa66aca5d", + "name": "view-users", + "description": "${role_view-users}", + "composite": true, + "composites": { + "client": { + "realm-management": [ + "query-groups", + "query-users" + ] + } + }, + "clientRole": true, + "containerId": "7cd8f4cd-abf4-4d20-904f-7381a29a38b8", + "attributes": {} + }, + { + "id": "e2c72797-82a7-440e-9cea-55f0219b7aaf", + "name": "view-authorization", + "description": "${role_view-authorization}", + "composite": false, + "clientRole": true, + "containerId": "7cd8f4cd-abf4-4d20-904f-7381a29a38b8", + "attributes": {} + }, + { + "id": "6d629082-9597-483c-85e3-349b3b6761e6", + "name": "query-realms", + "description": "${role_query-realms}", + "composite": false, + "clientRole": true, + "containerId": "7cd8f4cd-abf4-4d20-904f-7381a29a38b8", + "attributes": {} + }, + { + "id": "5c5f86a5-2f47-4a58-9ad9-c1b770b3f1e0", + "name": "manage-clients", + "description": "${role_manage-clients}", + "composite": false, + "clientRole": true, + "containerId": "7cd8f4cd-abf4-4d20-904f-7381a29a38b8", + "attributes": {} + }, + { + "id": "02b68098-a625-428f-8339-3053d4ab1ba4", + "name": "manage-realm", + "description": "${role_manage-realm}", + "composite": false, + "clientRole": true, + "containerId": "7cd8f4cd-abf4-4d20-904f-7381a29a38b8", + "attributes": {} + } + ], + "security-admin-console": [], + "controls-api": [ + { + "id": "d056105b-2d60-4415-addb-9639ac3bfd74", + "name": "uma_protection", + "composite": false, + "clientRole": true, + "containerId": "5cda179e-8443-4467-a488-292976d25bf1", + "attributes": {} + } + ], + "admin-cli": [], + "account-console": [], + "broker": [ + { + "id": "6c7bca9c-701c-4caf-9978-68211d766538", + "name": "read-token", + "description": "${role_read-token}", + "composite": false, + "clientRole": true, + "containerId": "e91a0a7f-f825-4155-abff-a547a9594d63", + "attributes": {} + } + ], + "account": [ + { + "id": "905b98ab-40a2-4f22-90e3-98a3475f8e7f", + "name": "manage-account-links", + "description": "${role_manage-account-links}", + "composite": false, + "clientRole": true, + "containerId": "466f7590-d495-402d-a955-08c54ae31385", + "attributes": {} + }, + { + "id": "e230efe8-767b-4903-8bb9-d612fc4d4c63", + "name": "view-consent", + "description": "${role_view-consent}", + "composite": false, + "clientRole": true, + "containerId": "466f7590-d495-402d-a955-08c54ae31385", + "attributes": {} + }, + { + "id": "1352f674-2227-4c5c-b687-c76d99e3acb6", + "name": "view-applications", + "description": "${role_view-applications}", + "composite": false, + "clientRole": true, + "containerId": "466f7590-d495-402d-a955-08c54ae31385", + "attributes": {} + }, + { + "id": "116701c3-049d-4bd3-95ad-ad838484844e", + "name": "manage-consent", + "description": "${role_manage-consent}", + "composite": true, + "composites": { + "client": { + "account": [ + "view-consent" + ] + } + }, + "clientRole": true, + "containerId": "466f7590-d495-402d-a955-08c54ae31385", + "attributes": {} + }, + { + "id": "791910d1-4a2f-46a2-9920-a61c83938a17", + "name": "view-profile", + "description": "${role_view-profile}", + "composite": false, + "clientRole": true, + "containerId": "466f7590-d495-402d-a955-08c54ae31385", + "attributes": {} + }, + { + "id": "0a046e35-6bf2-47e5-8ecb-fffbd2c05a2c", + "name": "manage-account", + "description": "${role_manage-account}", + "composite": true, + "composites": { + "client": { + "account": [ + "manage-account-links" + ] + } + }, + "clientRole": true, + "containerId": "466f7590-d495-402d-a955-08c54ae31385", + "attributes": {} + } + ] + } + }, + "groups": [], + "defaultRoles": [ + "uma_authorization", + "offline_access" + ], + "requiredCredentials": [ + "password" + ], + "otpPolicyType": "totp", + "otpPolicyAlgorithm": "HmacSHA1", + "otpPolicyInitialCounter": 0, + "otpPolicyDigits": 6, + "otpPolicyLookAheadWindow": 1, + "otpPolicyPeriod": 30, + "otpSupportedApplications": [ + "FreeOTP", + "Google Authenticator" + ], + "webAuthnPolicyRpEntityName": "keycloak", + "webAuthnPolicySignatureAlgorithms": [ + "ES256" + ], + "webAuthnPolicyRpId": "", + "webAuthnPolicyAttestationConveyancePreference": "not specified", + "webAuthnPolicyAuthenticatorAttachment": "not specified", + "webAuthnPolicyRequireResidentKey": "not specified", + "webAuthnPolicyUserVerificationRequirement": "not specified", + "webAuthnPolicyCreateTimeout": 0, + "webAuthnPolicyAvoidSameAuthenticatorRegister": false, + "webAuthnPolicyAcceptableAaguids": [], + "webAuthnPolicyPasswordlessRpEntityName": "keycloak", + "webAuthnPolicyPasswordlessSignatureAlgorithms": [ + "ES256" + ], + "webAuthnPolicyPasswordlessRpId": "", + "webAuthnPolicyPasswordlessAttestationConveyancePreference": "not specified", + "webAuthnPolicyPasswordlessAuthenticatorAttachment": "not specified", + "webAuthnPolicyPasswordlessRequireResidentKey": "not specified", + "webAuthnPolicyPasswordlessUserVerificationRequirement": "not specified", + "webAuthnPolicyPasswordlessCreateTimeout": 0, + "webAuthnPolicyPasswordlessAvoidSameAuthenticatorRegister": false, + "webAuthnPolicyPasswordlessAcceptableAaguids": [], + "users": [ + { + "id": "af134cab-f41c-4675-b141-205f975db679", + "username": "admin", + "enabled": true, + "totp": false, + "emailVerified": false, + "credentials": [ + { + "type": "password", + "hashedSaltedValue": "NICTtwsvSxJ5hL8hLAuleDUv9jwZcuXgxviMXvR++cciyPtiIEStEaJUyfA9DOir59awjPrHOumsclPVjNBplA==", + "salt": "T/2P5o5oxFJUEk68BRURRg==", + "hashIterations": 27500, + "counter": 0, + "algorithm": "pbkdf2-sha256", + "digits": 0, + "period": 0, + "createdDate": 1554245879354, + "config": {} + } + ], + "disableableCredentialTypes": [ + "password" + ], + "requiredActions": [], + "realmRoles": [ + "admin", + "user" + ], + "notBefore": 0, + "groups": [] + }, + { + "id": "eb4123a3-b722-4798-9af5-8957f823657a", + "username": "alice", + "enabled": true, + "totp": false, + "emailVerified": false, + "credentials": [ + { + "type": "password", + "hashedSaltedValue": "A3okqV2T/ybXTVEgKfosoSjP8Yc9IZbFP/SY4cEd6hag7TABQrQ6nUSuwagGt96l8cw1DTijO75PqX6uiTXMzw==", + "salt": "sl4mXx6T9FypPH/s9TngfQ==", + "hashIterations": 27500, + "counter": 0, + "algorithm": "pbkdf2-sha256", + "digits": 0, + "period": 0, + "createdDate": 1554245879116, + "config": {} + } + ], + "disableableCredentialTypes": [ + "password" + ], + "requiredActions": [], + "realmRoles": [ + "user" + ], + "notBefore": 0, + "groups": [] + }, + { + "id": "f2f78ee5-b6f9-4e7b-a837-8301a30a6d73", + "createdTimestamp": 1602936578977, + "username": "service-account-controls-api", + "enabled": true, + "totp": false, + "emailVerified": false, + "serviceAccountClientId": "controls-api", + "disableableCredentialTypes": [], + "requiredActions": [], + "realmRoles": [ + "uma_authorization", + "offline_access" + ], + "clientRoles": { + "controls-api": [ + "uma_protection" + ], + "account": [ + "manage-account", + "view-profile" + ] + }, + "notBefore": 0, + "groups": [] + } + ], + "scopeMappings": [ + { + "clientScope": "offline_access", + "roles": [ + "offline_access" + ] + } + ], + "clientScopeMappings": { + "account": [ + { + "client": "account-console", + "roles": [ + "manage-account" + ] + } + ] + }, + "clients": [ + { + "id": "466f7590-d495-402d-a955-08c54ae31385", + "clientId": "account", + "name": "${client_account}", + "rootUrl": "${authBaseUrl}", + "baseUrl": "/realms/konveyor/account/", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "secret": "0136c3ef-0dfd-4b13-a6d0-2c8b6358edec", + "defaultRoles": [ + "manage-account", + "view-profile" + ], + "redirectUris": [ + "/realms/konveyor/account/*" + ], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": false, + "publicClient": false, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": {}, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "defaultClientScopes": [ + "web-origins", + "role_list", + "roles", + "profile", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "f5256301-90fa-4e2c-9829-0adf0d2f828d", + "clientId": "account-console", + "name": "${client_account-console}", + "rootUrl": "${authBaseUrl}", + "baseUrl": "/realms/konveyor/account/", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "secret": "994a58fd-d98a-4403-9ff8-a6e9d078825f", + "redirectUris": [ + "/realms/konveyor/account/*" + ], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "pkce.code.challenge.method": "S256" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "protocolMappers": [ + { + "id": "e0267bcc-919b-4b4d-92ae-54fe779db0f5", + "name": "audience resolve", + "protocol": "openid-connect", + "protocolMapper": "oidc-audience-resolve-mapper", + "consentRequired": false, + "config": {} + } + ], + "defaultClientScopes": [ + "web-origins", + "role_list", + "roles", + "profile", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "0f7c2edf-9597-494e-8003-907342652b21", + "clientId": "admin-cli", + "name": "${client_admin-cli}", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "secret": "a951803a-79c7-46a6-8197-e32835286971", + "redirectUris": [], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": false, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": true, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": {}, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "defaultClientScopes": [ + "web-origins", + "role_list", + "roles", + "profile", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "e91a0a7f-f825-4155-abff-a547a9594d63", + "clientId": "broker", + "name": "${client_broker}", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "secret": "e1f7edd7-e15c-43b4-8736-ff8204d16836", + "redirectUris": [], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": false, + "publicClient": false, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": {}, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "defaultClientScopes": [ + "web-origins", + "role_list", + "roles", + "profile", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "7cd8f4cd-abf4-4d20-904f-7381a29a38b8", + "clientId": "realm-management", + "name": "${client_realm-management}", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "secret": "c41b709a-a012-4c69-89d7-4f926dba0619", + "redirectUris": [], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": true, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": false, + "publicClient": false, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": {}, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "defaultClientScopes": [ + "web-origins", + "role_list", + "roles", + "profile", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "407f46da-f770-4666-9147-2bcfc5c1caf6", + "clientId": "security-admin-console", + "name": "${client_security-admin-console}", + "rootUrl": "${authAdminUrl}", + "baseUrl": "/admin/konveyor/console/", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "secret": "e571b211-2550-475d-b87f-116ff54091ee", + "redirectUris": [ + "/admin/konveyor/console/*" + ], + "webOrigins": [ + "+" + ], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "pkce.code.challenge.method": "S256" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": false, + "nodeReRegistrationTimeout": 0, + "protocolMappers": [ + { + "id": "831ca78a-ea57-468f-a135-fc48068d0b78", + "name": "locale", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "locale", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "locale", + "jsonType.label": "String" + } + } + ], + "defaultClientScopes": [ + "web-origins", + "role_list", + "roles", + "profile", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + }, + { + "id": "5cda179e-8443-4467-a488-292976d25bf1", + "clientId": "controls-api", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "secret": "secret", + "redirectUris": [ + "/*" + ], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": true, + "serviceAccountsEnabled": false, + "publicClient": false, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "saml.assertion.signature": "false", + "saml.force.post.binding": "false", + "saml.multivalued.roles": "false", + "saml.encrypt": "false", + "backchannel.logout.revoke.offline.tokens": "false", + "saml.server.signature": "false", + "saml.server.signature.keyinfo.ext": "false", + "exclude.session.state.from.auth.response": "false", + "backchannel.logout.session.required": "true", + "client_credentials.use_refresh_token": "false", + "saml_force_name_id_format": "false", + "saml.client.signature": "false", + "tls.client.certificate.bound.access.tokens": "false", + "saml.authnstatement": "false", + "display.on.consent.screen": "false", + "saml.onetimeuse.condition": "false" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": true, + "nodeReRegistrationTimeout": -1, + "defaultClientScopes": [ + "web-origins", + "role_list", + "roles", + "profile", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ], + "access": { + "view": true, + "configure": true, + "manage": true + } + }, + { + "id": "065c4bcf-379e-4a83-99d7-5491176185e2", + "clientId": "application-inventory-api", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "secret": "secret", + "redirectUris": [ + "/*" + ], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": true, + "serviceAccountsEnabled": false, + "publicClient": false, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "saml.assertion.signature": "false", + "saml.force.post.binding": "false", + "saml.multivalued.roles": "false", + "saml.encrypt": "false", + "backchannel.logout.revoke.offline.tokens": "false", + "saml.server.signature": "false", + "saml.server.signature.keyinfo.ext": "false", + "exclude.session.state.from.auth.response": "false", + "backchannel.logout.session.required": "true", + "client_credentials.use_refresh_token": "false", + "saml_force_name_id_format": "false", + "saml.client.signature": "false", + "tls.client.certificate.bound.access.tokens": "false", + "saml.authnstatement": "false", + "display.on.consent.screen": "false", + "saml.onetimeuse.condition": "false" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": true, + "nodeReRegistrationTimeout": -1, + "defaultClientScopes": [ + "web-origins", + "role_list", + "roles", + "profile", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ], + "access": { + "view": true, + "configure": true, + "manage": true + } + }, + { + "id": "7f4a9ed7-3554-4aef-955a-a5737fb942f3", + "clientId": "pathfinder-api", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "secret": "secret", + "redirectUris": [ + "/*" + ], + "webOrigins": [], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": true, + "serviceAccountsEnabled": false, + "publicClient": false, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "saml.assertion.signature": "false", + "saml.force.post.binding": "false", + "saml.multivalued.roles": "false", + "saml.encrypt": "false", + "backchannel.logout.revoke.offline.tokens": "false", + "saml.server.signature": "false", + "saml.server.signature.keyinfo.ext": "false", + "exclude.session.state.from.auth.response": "false", + "backchannel.logout.session.required": "true", + "client_credentials.use_refresh_token": "false", + "saml_force_name_id_format": "false", + "saml.client.signature": "false", + "tls.client.certificate.bound.access.tokens": "false", + "saml.authnstatement": "false", + "display.on.consent.screen": "false", + "saml.onetimeuse.condition": "false" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": true, + "nodeReRegistrationTimeout": -1, + "defaultClientScopes": [ + "web-origins", + "role_list", + "roles", + "profile", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ], + "access": { + "view": true, + "configure": true, + "manage": true + } + }, + { + "id": "695da74e-39ca-4e46-a2b6-6a673f92d4e2", + "clientId": "tackle-ui", + "surrogateAuthRequired": false, + "enabled": true, + "alwaysDisplayInConsole": false, + "clientAuthenticatorType": "client-secret", + "secret": "**********", + "redirectUris": [ + "http://localhost:3000/*", + "http://localhost:3001/*" + ], + "webOrigins": [ + "http://localhost:3000", + "http://localhost:3001" + ], + "notBefore": 0, + "bearerOnly": false, + "consentRequired": false, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": true, + "serviceAccountsEnabled": false, + "publicClient": true, + "frontchannelLogout": false, + "protocol": "openid-connect", + "attributes": { + "backchannel.logout.session.required": "true", + "backchannel.logout.revoke.offline.tokens": "false" + }, + "authenticationFlowBindingOverrides": {}, + "fullScopeAllowed": true, + "nodeReRegistrationTimeout": -1, + "defaultClientScopes": [ + "web-origins", + "role_list", + "roles", + "profile", + "email" + ], + "optionalClientScopes": [ + "address", + "phone", + "offline_access", + "microprofile-jwt" + ] + } + ], + "clientScopes": [ + { + "id": "7ad4c83f-7793-470b-b01d-b8d4b6e49941", + "name": "address", + "description": "OpenID Connect built-in scope: address", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "true", + "display.on.consent.screen": "true", + "consent.screen.text": "${addressScopeConsentText}" + }, + "protocolMappers": [ + { + "id": "adbc4487-d95b-4567-a36b-629ac3b00a36", + "name": "address", + "protocol": "openid-connect", + "protocolMapper": "oidc-address-mapper", + "consentRequired": false, + "config": { + "user.attribute.formatted": "formatted", + "user.attribute.country": "country", + "user.attribute.postal_code": "postal_code", + "userinfo.token.claim": "true", + "user.attribute.street": "street", + "id.token.claim": "true", + "user.attribute.region": "region", + "access.token.claim": "true", + "user.attribute.locality": "locality" + } + } + ] + }, + { + "id": "f06793e3-9c45-49b7-ad5b-08c14e2be29f", + "name": "email", + "description": "OpenID Connect built-in scope: email", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "true", + "display.on.consent.screen": "true", + "consent.screen.text": "${emailScopeConsentText}" + }, + "protocolMappers": [ + { + "id": "1516caf6-6a5a-482d-8186-9c3ec9b5c874", + "name": "email verified", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-property-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "emailVerified", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "email_verified", + "jsonType.label": "boolean" + } + }, + { + "id": "0ba3782c-9f7a-4ced-9e4e-a8145d23bf6c", + "name": "email", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-property-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "email", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "email", + "jsonType.label": "String" + } + } + ] + }, + { + "id": "3873fc26-b5ef-457c-aab2-a1157b05db4d", + "name": "microprofile-jwt", + "description": "Microprofile - JWT built-in scope", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "true", + "display.on.consent.screen": "false" + }, + "protocolMappers": [ + { + "id": "33549263-f0f5-4807-8835-7f8e4684c0ef", + "name": "upn", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-property-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "username", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "upn", + "jsonType.label": "String" + } + }, + { + "id": "f04e99a6-cca0-4acc-ad00-d2a9bbd26ff2", + "name": "groups", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-realm-role-mapper", + "consentRequired": false, + "config": { + "multivalued": "true", + "user.attribute": "foo", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "groups", + "jsonType.label": "String" + } + } + ] + }, + { + "id": "cedfca34-d051-44e3-8698-1e4d82f31ea1", + "name": "offline_access", + "description": "OpenID Connect built-in scope: offline_access", + "protocol": "openid-connect", + "attributes": { + "consent.screen.text": "${offlineAccessScopeConsentText}", + "display.on.consent.screen": "true" + } + }, + { + "id": "876e7269-3aab-4252-b041-88a02f2fc3b5", + "name": "phone", + "description": "OpenID Connect built-in scope: phone", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "true", + "display.on.consent.screen": "true", + "consent.screen.text": "${phoneScopeConsentText}" + }, + "protocolMappers": [ + { + "id": "b8308a16-b44f-43c6-aab7-12d624fe82ad", + "name": "phone number verified", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "phoneNumberVerified", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "phone_number_verified", + "jsonType.label": "boolean" + } + }, + { + "id": "e87fbc27-2c39-429b-9807-93b95241eab2", + "name": "phone number", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "phoneNumber", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "phone_number", + "jsonType.label": "String" + } + } + ] + }, + { + "id": "cf6392e7-574e-44da-b143-7c811574b237", + "name": "profile", + "description": "OpenID Connect built-in scope: profile", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "true", + "display.on.consent.screen": "true", + "consent.screen.text": "${profileScopeConsentText}" + }, + "protocolMappers": [ + { + "id": "1a497de4-3929-4e45-9373-8dd4b9c92d31", + "name": "family name", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-property-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "lastName", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "family_name", + "jsonType.label": "String" + } + }, + { + "id": "6200624f-c90d-4aaf-b521-7b8435002a09", + "name": "picture", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "picture", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "picture", + "jsonType.label": "String" + } + }, + { + "id": "1cf2dc37-1836-4180-8b2b-06aef384bfca", + "name": "updated at", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "updatedAt", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "updated_at", + "jsonType.label": "String" + } + }, + { + "id": "864f324b-7b71-4cff-8a35-e08b3063fd40", + "name": "full name", + "protocol": "openid-connect", + "protocolMapper": "oidc-full-name-mapper", + "consentRequired": false, + "config": { + "id.token.claim": "true", + "access.token.claim": "true", + "userinfo.token.claim": "true" + } + }, + { + "id": "5041e8d2-adb9-4814-8af8-4aee25ca3395", + "name": "gender", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "gender", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "gender", + "jsonType.label": "String" + } + }, + { + "id": "a8707020-de49-4801-ba18-b875ed9c5aaa", + "name": "zoneinfo", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "zoneinfo", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "zoneinfo", + "jsonType.label": "String" + } + }, + { + "id": "42659871-244a-454a-b231-0c15348dee42", + "name": "locale", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "locale", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "locale", + "jsonType.label": "String" + } + }, + { + "id": "6bfd6d10-70a9-488c-8306-c1288709b53b", + "name": "username", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-property-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "username", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "preferred_username", + "jsonType.label": "String" + } + }, + { + "id": "9db1df0f-fa93-48be-b97f-a3b6414ab3f3", + "name": "profile", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "profile", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "profile", + "jsonType.label": "String" + } + }, + { + "id": "7e36717b-3b03-4e97-b8ac-c9e682f5cb4c", + "name": "birthdate", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "birthdate", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "birthdate", + "jsonType.label": "String" + } + }, + { + "id": "6cba0b69-c17a-4bbe-b55c-cabe48c61571", + "name": "given name", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-property-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "firstName", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "given_name", + "jsonType.label": "String" + } + }, + { + "id": "e57fce2e-b7b8-4665-9e17-755d85aeccc0", + "name": "nickname", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "nickname", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "nickname", + "jsonType.label": "String" + } + }, + { + "id": "fd4aa449-c66f-4172-ae30-fa9e9ad82fe0", + "name": "website", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "website", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "website", + "jsonType.label": "String" + } + }, + { + "id": "4d8e0ac0-7d66-45cb-bbf7-2e2b49cbf2a5", + "name": "middle name", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-attribute-mapper", + "consentRequired": false, + "config": { + "userinfo.token.claim": "true", + "user.attribute": "middleName", + "id.token.claim": "true", + "access.token.claim": "true", + "claim.name": "middle_name", + "jsonType.label": "String" + } + } + ] + }, + { + "id": "1d70dda3-b20c-483a-b08d-8d20407df7a7", + "name": "role_list", + "description": "SAML role list", + "protocol": "saml", + "attributes": { + "consent.screen.text": "${samlRoleListScopeConsentText}", + "display.on.consent.screen": "true" + }, + "protocolMappers": [ + { + "id": "f96d90e9-c464-4d6f-b0c5-4d36763ba0fb", + "name": "role list", + "protocol": "saml", + "protocolMapper": "saml-role-list-mapper", + "consentRequired": false, + "config": { + "single": "false", + "attribute.nameformat": "Basic", + "attribute.name": "Role" + } + } + ] + }, + { + "id": "cb6059d6-339d-4e0f-9591-223935104f97", + "name": "roles", + "description": "OpenID Connect scope for add user roles to the access token", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "false", + "display.on.consent.screen": "true", + "consent.screen.text": "${rolesScopeConsentText}" + }, + "protocolMappers": [ + { + "id": "3f1bb88d-a3e7-4472-9763-1c186514f3d2", + "name": "realm roles", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-realm-role-mapper", + "consentRequired": false, + "config": { + "multivalued": "true", + "user.attribute": "foo", + "access.token.claim": "true", + "claim.name": "realm_access.roles", + "jsonType.label": "String" + } + }, + { + "id": "6c36c6da-fcd0-4578-9704-5b245b40ce0a", + "name": "audience resolve", + "protocol": "openid-connect", + "protocolMapper": "oidc-audience-resolve-mapper", + "consentRequired": false, + "config": {} + }, + { + "id": "986c6019-d84a-4a7f-a54d-da9da869b462", + "name": "client roles", + "protocol": "openid-connect", + "protocolMapper": "oidc-usermodel-client-role-mapper", + "consentRequired": false, + "config": { + "multivalued": "true", + "user.attribute": "foo", + "access.token.claim": "true", + "claim.name": "resource_access.${client_id}.roles", + "jsonType.label": "String" + } + } + ] + }, + { + "id": "915b79ce-9d2f-4c19-8fac-12924bf19891", + "name": "web-origins", + "description": "OpenID Connect scope for add allowed web origins to the access token", + "protocol": "openid-connect", + "attributes": { + "include.in.token.scope": "false", + "display.on.consent.screen": "false", + "consent.screen.text": "" + }, + "protocolMappers": [ + { + "id": "d7cde5d0-4c14-42ca-95ac-bcc07fcbbdb4", + "name": "allowed web origins", + "protocol": "openid-connect", + "protocolMapper": "oidc-allowed-origins-mapper", + "consentRequired": false, + "config": {} + } + ] + } + ], + "defaultDefaultClientScopes": [ + "role_list", + "web-origins", + "roles", + "profile", + "email" + ], + "defaultOptionalClientScopes": [ + "microprofile-jwt", + "address", + "phone", + "offline_access" + ], + "browserSecurityHeaders": { + "contentSecurityPolicyReportOnly": "", + "xContentTypeOptions": "nosniff", + "xRobotsTag": "none", + "xFrameOptions": "SAMEORIGIN", + "contentSecurityPolicy": "frame-src 'self'; frame-ancestors 'self'; object-src 'none';", + "xXSSProtection": "1; mode=block", + "strictTransportSecurity": "max-age=31536000; includeSubDomains" + }, + "smtpServer": {}, + "eventsEnabled": false, + "eventsListeners": [ + "jboss-logging" + ], + "enabledEventTypes": [], + "adminEventsEnabled": false, + "adminEventsDetailsEnabled": false, + "components": { + "org.keycloak.services.clientregistration.policy.ClientRegistrationPolicy": [ + { + "id": "3e91f878-e4bd-4c0f-b320-4cab942d9ad1", + "name": "Allowed Client Scopes", + "providerId": "allowed-client-templates", + "subType": "anonymous", + "subComponents": {}, + "config": { + "allow-default-scopes": [ + "true" + ] + } + }, + { + "id": "183b6fda-b761-4612-a0d4-acea8dd9d98a", + "name": "Allowed Protocol Mapper Types", + "providerId": "allowed-protocol-mappers", + "subType": "authenticated", + "subComponents": {}, + "config": { + "allowed-protocol-mapper-types": [ + "saml-user-attribute-mapper", + "oidc-address-mapper", + "oidc-usermodel-attribute-mapper", + "oidc-full-name-mapper", + "oidc-usermodel-property-mapper", + "saml-role-list-mapper", + "saml-user-property-mapper", + "oidc-sha256-pairwise-sub-mapper" + ] + } + }, + { + "id": "b75b53d5-2afa-464f-8624-2de149656a14", + "name": "Trusted Hosts", + "providerId": "trusted-hosts", + "subType": "anonymous", + "subComponents": {}, + "config": { + "host-sending-registration-request-must-match": [ + "true" + ], + "client-uris-must-match": [ + "true" + ] + } + }, + { + "id": "d491ad5e-534a-4492-a168-780b3314f8a0", + "name": "Consent Required", + "providerId": "consent-required", + "subType": "anonymous", + "subComponents": {}, + "config": {} + }, + { + "id": "ffeec36f-9ae2-4ef3-ae49-64c43cfab0a5", + "name": "Max Clients Limit", + "providerId": "max-clients", + "subType": "anonymous", + "subComponents": {}, + "config": { + "max-clients": [ + "200" + ] + } + }, + { + "id": "47a66c7c-373f-487d-bfb2-acd7ab389339", + "name": "Full Scope Disabled", + "providerId": "scope", + "subType": "anonymous", + "subComponents": {}, + "config": {} + }, + { + "id": "ae20dd81-3850-44cb-bd4a-1fee7d5a285e", + "name": "Allowed Protocol Mapper Types", + "providerId": "allowed-protocol-mappers", + "subType": "anonymous", + "subComponents": {}, + "config": { + "allowed-protocol-mapper-types": [ + "saml-user-attribute-mapper", + "oidc-usermodel-attribute-mapper", + "saml-role-list-mapper", + "oidc-sha256-pairwise-sub-mapper", + "oidc-full-name-mapper", + "saml-user-property-mapper", + "oidc-usermodel-property-mapper", + "oidc-address-mapper" + ] + } + }, + { + "id": "a4547fd0-1a1f-4722-aff0-2c49c4608a32", + "name": "Allowed Client Scopes", + "providerId": "allowed-client-templates", + "subType": "authenticated", + "subComponents": {}, + "config": { + "allow-default-scopes": [ + "true" + ] + } + } + ], + "org.keycloak.keys.KeyProvider": [ + { + "id": "263a7924-21c7-4ab2-9a72-dbad9a309eaa", + "name": "aes-generated", + "providerId": "aes-generated", + "subComponents": {}, + "config": { + "priority": [ + "100" + ] + } + }, + { + "id": "f9670a25-1608-4bd6-b089-0170b0edf4d9", + "name": "hmac-generated", + "providerId": "hmac-generated", + "subComponents": {}, + "config": { + "priority": [ + "100" + ], + "algorithm": [ + "HS256" + ] + } + }, + { + "id": "da59404c-a6d8-428e-b8a1-c99d74a9ea72", + "name": "rsa-generated", + "providerId": "rsa-generated", + "subComponents": {}, + "config": { + "priority": [ + "100" + ] + } + } + ] + }, + "internationalizationEnabled": false, + "supportedLocales": [], + "authenticationFlows": [ + { + "id": "79af7e20-fd58-4dc2-9313-a7003f0cb1f7", + "alias": "Account verification options", + "description": "Method with which to verity the existing account", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "idp-email-verification", + "requirement": "ALTERNATIVE", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "requirement": "ALTERNATIVE", + "priority": 20, + "flowAlias": "Verify Existing Account by Re-authentication", + "userSetupAllowed": false, + "autheticatorFlow": true + } + ] + }, + { + "id": "84b80847-d734-442f-883f-cd24747cd878", + "alias": "Authentication Options", + "description": "Authentication options.", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "basic-auth", + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "basic-auth-otp", + "requirement": "DISABLED", + "priority": 20, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "auth-spnego", + "requirement": "DISABLED", + "priority": 30, + "userSetupAllowed": false, + "autheticatorFlow": false + } + ] + }, + { + "id": "77bfc179-e474-4d49-b748-b33964b27e41", + "alias": "Browser - Conditional OTP", + "description": "Flow to determine if the OTP is required for the authentication", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "conditional-user-configured", + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "auth-otp-form", + "requirement": "REQUIRED", + "priority": 20, + "userSetupAllowed": false, + "autheticatorFlow": false + } + ] + }, + { + "id": "71a5e6cf-6bce-45f7-800c-4860fb6b8a0a", + "alias": "Direct Grant - Conditional OTP", + "description": "Flow to determine if the OTP is required for the authentication", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "conditional-user-configured", + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "direct-grant-validate-otp", + "requirement": "REQUIRED", + "priority": 20, + "userSetupAllowed": false, + "autheticatorFlow": false + } + ] + }, + { + "id": "18ab230f-b431-45f3-89d7-31712300a568", + "alias": "First broker login - Conditional OTP", + "description": "Flow to determine if the OTP is required for the authentication", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "conditional-user-configured", + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "auth-otp-form", + "requirement": "REQUIRED", + "priority": 20, + "userSetupAllowed": false, + "autheticatorFlow": false + } + ] + }, + { + "id": "0f2e4cab-b078-4833-9330-5ffbe055279b", + "alias": "Handle Existing Account", + "description": "Handle what to do if there is existing account with same email/username like authenticated identity provider", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "idp-confirm-link", + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "requirement": "REQUIRED", + "priority": 20, + "flowAlias": "Account verification options", + "userSetupAllowed": false, + "autheticatorFlow": true + } + ] + }, + { + "id": "4e9af401-af96-44b8-a5bc-d16462b3f366", + "alias": "Reset - Conditional OTP", + "description": "Flow to determine if the OTP should be reset or not. Set to REQUIRED to force.", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "conditional-user-configured", + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "reset-otp", + "requirement": "REQUIRED", + "priority": 20, + "userSetupAllowed": false, + "autheticatorFlow": false + } + ] + }, + { + "id": "b31fb78e-fc01-4f55-a29b-87e31849dd7a", + "alias": "User creation or linking", + "description": "Flow for the existing/non-existing user alternatives", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticatorConfig": "create unique user config", + "authenticator": "idp-create-user-if-unique", + "requirement": "ALTERNATIVE", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "requirement": "ALTERNATIVE", + "priority": 20, + "flowAlias": "Handle Existing Account", + "userSetupAllowed": false, + "autheticatorFlow": true + } + ] + }, + { + "id": "a016ba60-5add-4bb7-a077-843f58d1c333", + "alias": "Verify Existing Account by Re-authentication", + "description": "Reauthentication of existing account", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "idp-username-password-form", + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "requirement": "CONDITIONAL", + "priority": 20, + "flowAlias": "First broker login - Conditional OTP", + "userSetupAllowed": false, + "autheticatorFlow": true + } + ] + }, + { + "id": "33b06dc1-001a-4621-81a3-1f7c0f20665a", + "alias": "browser", + "description": "browser based authentication", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "auth-cookie", + "requirement": "ALTERNATIVE", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "auth-spnego", + "requirement": "DISABLED", + "priority": 20, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "identity-provider-redirector", + "requirement": "ALTERNATIVE", + "priority": 25, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "requirement": "ALTERNATIVE", + "priority": 30, + "flowAlias": "forms", + "userSetupAllowed": false, + "autheticatorFlow": true + } + ] + }, + { + "id": "50aa4aeb-3f2b-4fbc-996c-aab5951e3676", + "alias": "clients", + "description": "Base authentication for clients", + "providerId": "client-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "client-secret", + "requirement": "ALTERNATIVE", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "client-jwt", + "requirement": "ALTERNATIVE", + "priority": 20, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "client-secret-jwt", + "requirement": "ALTERNATIVE", + "priority": 30, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "client-x509", + "requirement": "ALTERNATIVE", + "priority": 40, + "userSetupAllowed": false, + "autheticatorFlow": false + } + ] + }, + { + "id": "aedd580b-9c1d-4c53-9c8f-447d6497b682", + "alias": "direct grant", + "description": "OpenID Connect Resource Owner Grant", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "direct-grant-validate-username", + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "direct-grant-validate-password", + "requirement": "REQUIRED", + "priority": 20, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "requirement": "CONDITIONAL", + "priority": 30, + "flowAlias": "Direct Grant - Conditional OTP", + "userSetupAllowed": false, + "autheticatorFlow": true + } + ] + }, + { + "id": "a1436eea-651b-4e9b-99b8-6b7c511b04b6", + "alias": "docker auth", + "description": "Used by Docker clients to authenticate against the IDP", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "docker-http-basic-authenticator", + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + } + ] + }, + { + "id": "9a35d938-cf17-4601-aa4c-87324b86f830", + "alias": "first broker login", + "description": "Actions taken after first broker login with identity provider account, which is not yet linked to any Keycloak account", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticatorConfig": "review profile config", + "authenticator": "idp-review-profile", + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "requirement": "REQUIRED", + "priority": 20, + "flowAlias": "User creation or linking", + "userSetupAllowed": false, + "autheticatorFlow": true + } + ] + }, + { + "id": "d75b41c7-a3cb-4f8e-96ff-47ea426e2bb6", + "alias": "forms", + "description": "Username, password, otp and other auth forms.", + "providerId": "basic-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "auth-username-password-form", + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "requirement": "CONDITIONAL", + "priority": 20, + "flowAlias": "Browser - Conditional OTP", + "userSetupAllowed": false, + "autheticatorFlow": true + } + ] + }, + { + "id": "6e6c98a8-18f4-4ca6-bc58-da58d743f765", + "alias": "http challenge", + "description": "An authentication flow based on challenge-response HTTP Authentication Schemes", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "no-cookie-redirect", + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "requirement": "REQUIRED", + "priority": 20, + "flowAlias": "Authentication Options", + "userSetupAllowed": false, + "autheticatorFlow": true + } + ] + }, + { + "id": "ecf34725-8dbd-43b2-b5e9-20fe6964657a", + "alias": "registration", + "description": "registration flow", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "registration-page-form", + "requirement": "REQUIRED", + "priority": 10, + "flowAlias": "registration form", + "userSetupAllowed": false, + "autheticatorFlow": true + } + ] + }, + { + "id": "ec2cd88f-5511-4f7d-b6cf-c022cebca4ef", + "alias": "registration form", + "description": "registration form", + "providerId": "form-flow", + "topLevel": false, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "registration-user-creation", + "requirement": "REQUIRED", + "priority": 20, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "registration-profile-action", + "requirement": "REQUIRED", + "priority": 40, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "registration-password-action", + "requirement": "REQUIRED", + "priority": 50, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "registration-recaptcha-action", + "requirement": "DISABLED", + "priority": 60, + "userSetupAllowed": false, + "autheticatorFlow": false + } + ] + }, + { + "id": "93fff189-ed75-4326-a110-2aae42f59e91", + "alias": "reset credentials", + "description": "Reset credentials for a user if they forgot their password or something", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "reset-credentials-choose-user", + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "reset-credential-email", + "requirement": "REQUIRED", + "priority": 20, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "authenticator": "reset-password", + "requirement": "REQUIRED", + "priority": 30, + "userSetupAllowed": false, + "autheticatorFlow": false + }, + { + "requirement": "CONDITIONAL", + "priority": 40, + "flowAlias": "Reset - Conditional OTP", + "userSetupAllowed": false, + "autheticatorFlow": true + } + ] + }, + { + "id": "76d4a83e-6fde-447c-9111-05bacfba27c0", + "alias": "saml ecp", + "description": "SAML ECP Profile Authentication Flow", + "providerId": "basic-flow", + "topLevel": true, + "builtIn": true, + "authenticationExecutions": [ + { + "authenticator": "http-basic-authenticator", + "requirement": "REQUIRED", + "priority": 10, + "userSetupAllowed": false, + "autheticatorFlow": false + } + ] + } + ], + "authenticatorConfig": [ + { + "id": "e27c12d6-18ad-4c83-b601-8e3166242be3", + "alias": "create unique user config", + "config": { + "require.password.update.after.registration": "false" + } + }, + { + "id": "4242993c-47b3-4357-9e8d-9864fcc0123a", + "alias": "review profile config", + "config": { + "update.profile.on.first.login": "missing" + } + } + ], + "requiredActions": [ + { + "alias": "CONFIGURE_TOTP", + "name": "Configure OTP", + "providerId": "CONFIGURE_TOTP", + "enabled": true, + "defaultAction": false, + "priority": 10, + "config": {} + }, + { + "alias": "terms_and_conditions", + "name": "Terms and Conditions", + "providerId": "terms_and_conditions", + "enabled": false, + "defaultAction": false, + "priority": 20, + "config": {} + }, + { + "alias": "UPDATE_PASSWORD", + "name": "Update Password", + "providerId": "UPDATE_PASSWORD", + "enabled": true, + "defaultAction": false, + "priority": 30, + "config": {} + }, + { + "alias": "UPDATE_PROFILE", + "name": "Update Profile", + "providerId": "UPDATE_PROFILE", + "enabled": true, + "defaultAction": false, + "priority": 40, + "config": {} + }, + { + "alias": "VERIFY_EMAIL", + "name": "Verify Email", + "providerId": "VERIFY_EMAIL", + "enabled": true, + "defaultAction": false, + "priority": 50, + "config": {} + }, + { + "alias": "update_user_locale", + "name": "Update User Locale", + "providerId": "update_user_locale", + "enabled": true, + "defaultAction": false, + "priority": 1000, + "config": {} + } + ], + "browserFlow": "browser", + "registrationFlow": "registration", + "directGrantFlow": "direct grant", + "resetCredentialsFlow": "reset credentials", + "clientAuthenticationFlow": "clients", + "dockerAuthenticationFlow": "docker auth", + "attributes": {}, + "keycloakVersion": "11.0.2", + "userManagedAccessAllowed": false + } +kind: ConfigMap +metadata: + name: keycloak-realm + labels: + app.kubernetes.io/name: keycloak + app.kubernetes.io/component: sso + app.kubernetes.io/instance: keycloak + app.kubernetes.io/part-of: tackle diff --git a/kubernetes/keycloak/db-deploy.yml b/kubernetes/keycloak/db-deploy.yml new file mode 100644 index 00000000..0f6b8164 --- /dev/null +++ b/kubernetes/keycloak/db-deploy.yml @@ -0,0 +1,82 @@ +kind: Deployment +apiVersion: apps/v1 +metadata: + name: keycloak-db + labels: + app.kubernetes.io/name: keycloak-db + app.kubernetes.io/version: "10.6" + app.kubernetes.io/component: database + app.kubernetes.io/instance: keycloak-db + app.kubernetes.io/part-of: tackle +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: keycloak-db + app.kubernetes.io/version: "10.6" + template: + metadata: + labels: + app.kubernetes.io/name: keycloak-db + app.kubernetes.io/version: "10.6" + spec: + volumes: + - name: keycloak-db-data + persistentVolumeClaim: + claimName: keycloak-db + containers: + - name: postgres + image: postgres:10.6 + ports: + - containerPort: 5432 + protocol: TCP + env: + - name: POSTGRES_USER + value: keycloak_username + - name: POSTGRES_PASSWORD + value: keycloak_password + - name: POSTGRES_DB + value: keycloak_db + resources: {} + livenessProbe: + exec: + command: + - "/bin/sh" + - "-c" + - "psql -U $POSTGRES_USER -d $POSTGRES_DB -c 'SELECT 1'" + initialDelaySeconds: 60 + timeoutSeconds: 10 + periodSeconds: 10 + successThreshold: 1 + failureThreshold: 3 + readinessProbe: + exec: + command: + - "/bin/sh" + - "-c" + - "psql -U $POSTGRES_USER -d $POSTGRES_DB -c 'SELECT 1'" + initialDelaySeconds: 10 + timeoutSeconds: 1 + periodSeconds: 10 + successThreshold: 1 + failureThreshold: 3 + terminationMessagePath: "/dev/termination-log" + terminationMessagePolicy: File + imagePullPolicy: IfNotPresent + volumeMounts: + - name: keycloak-db-data + mountPath: "/var/lib/db" + securityContext: + privileged: false + restartPolicy: Always + terminationGracePeriodSeconds: 30 + dnsPolicy: ClusterFirst + securityContext: {} + schedulerName: default-scheduler + strategy: + type: RollingUpdate + rollingUpdate: + maxUnavailable: 25% + maxSurge: 25% + revisionHistoryLimit: 10 + progressDeadlineSeconds: 600 diff --git a/kubernetes/keycloak/db-pvc.yml b/kubernetes/keycloak/db-pvc.yml new file mode 100644 index 00000000..e2953ea7 --- /dev/null +++ b/kubernetes/keycloak/db-pvc.yml @@ -0,0 +1,16 @@ +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: keycloak-db + labels: + app.kubernetes.io/name: keycloak-db + app.kubernetes.io/component: database + app.kubernetes.io/instance: keycloak-db + app.kubernetes.io/part-of: tackle +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi + volumeMode: Filesystem \ No newline at end of file diff --git a/kubernetes/keycloak/db-svc.yml b/kubernetes/keycloak/db-svc.yml new file mode 100644 index 00000000..a05642ce --- /dev/null +++ b/kubernetes/keycloak/db-svc.yml @@ -0,0 +1,21 @@ +kind: Service +apiVersion: v1 +metadata: + name: keycloak-db + labels: + app.kubernetes.io/name: keycloak-db + app.kubernetes.io/version: '10.6' + app.kubernetes.io/component: database + app.kubernetes.io/instance: keycloak-db + app.kubernetes.io/part-of: tackle +spec: + ports: + - name: tcp + protocol: TCP + port: 5432 + targetPort: 5432 + selector: + app.kubernetes.io/name: keycloak-db + app.kubernetes.io/version: '10.6' + type: ClusterIP + sessionAffinity: None \ No newline at end of file diff --git a/kubernetes/keycloak/deploy.yml b/kubernetes/keycloak/deploy.yml new file mode 100644 index 00000000..29ac417e --- /dev/null +++ b/kubernetes/keycloak/deploy.yml @@ -0,0 +1,72 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: keycloak + labels: + app.kubernetes.io/name: keycloak + app.kubernetes.io/component: sso + app.kubernetes.io/instance: keycloak + app.kubernetes.io/part-of: tackle +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: keycloak + template: + metadata: + labels: + app.kubernetes.io/name: keycloak + spec: + volumes: + - name: config-volume + configMap: + name: keycloak-realm + containers: + - name: keycloak + image: quay.io/keycloak/keycloak:12.0.4 + env: + - name: KEYCLOAK_USER + value: "admin" + - name: KEYCLOAK_PASSWORD + value: "admin" + - name: PROXY_ADDRESS_FORWARDING + value: "true" + - name: KEYCLOAK_IMPORT + value: /etc/config/konveyor-realm.json + - name: DB_VENDOR + value: postgres + - name: DB_ADDR + value: keycloak-db + - name: DB_DATABASE + value: keycloak_db + - name: DB_USER + value: keycloak_username + - name: DB_PASSWORD + value: keycloak_password + ports: + - name: http + containerPort: 8080 + - name: https + containerPort: 8443 + volumeMounts: + - name: config-volume + mountPath: /etc/config + readinessProbe: + httpGet: + path: /auth/realms/master + port: 8080 + initialDelaySeconds: 60 + timeoutSeconds: 1 + periodSeconds: 10 + successThreshold: 1 + failureThreshold: 6 + livenessProbe: + httpGet: + path: /auth/realms/master + port: 8080 + initialDelaySeconds: 120 + timeoutSeconds: 1 + periodSeconds: 10 + successThreshold: 1 + failureThreshold: 6 + resources: {} diff --git a/kubernetes/keycloak/svc.yml b/kubernetes/keycloak/svc.yml new file mode 100644 index 00000000..e7f4b0d6 --- /dev/null +++ b/kubernetes/keycloak/svc.yml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: keycloak + labels: + app.kubernetes.io/name: keycloak + app.kubernetes.io/component: sso + app.kubernetes.io/instance: keycloak + app.kubernetes.io/part-of: tackle +spec: + ports: + - name: http + port: 8080 + targetPort: 8080 + selector: + app.kubernetes.io/name: keycloak \ No newline at end of file diff --git a/kubernetes/start-minikube.sh b/kubernetes/start-minikube.sh new file mode 100755 index 00000000..8ea02bdb --- /dev/null +++ b/kubernetes/start-minikube.sh @@ -0,0 +1,5 @@ + +# kubectl delete ns tackle +# kubectl create ns tackle + +kubectl create -f kubernetes/keycloak/ -n tackle \ No newline at end of file diff --git a/kubernetes/ui/deploy.yml b/kubernetes/ui/deploy.yml new file mode 100644 index 00000000..29a6639b --- /dev/null +++ b/kubernetes/ui/deploy.yml @@ -0,0 +1,73 @@ +kind: Deployment +apiVersion: apps/v1 +metadata: + name: tackle-ui + labels: + app.kubernetes.io/name: tackle-ui + app.kubernetes.io/component: ui + app.kubernetes.io/instance: tackle-ui + app.kubernetes.io/part-of: tackle +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: tackle-ui + app.kubernetes.io/instance: tackle-ui + app.kubernetes.io/part-of: tackle + template: + metadata: + labels: + app.kubernetes.io/name: tackle-ui + app.kubernetes.io/instance: tackle-ui + app.kubernetes.io/part-of: tackle + spec: + containers: + - name: tackle-ui + image: quay.io/konveyor/tackle-ui:main + ports: + - containerPort: 8080 + protocol: TCP + - containerPort: 8443 + protocol: TCP + env: + - name: CONTROLS_API_URL + value: "http://tackle-controls:8080" + - name: APPLICATION_INVENTORY_API_URL + value: "http://tackle-application-inventory:8080" + - name: SSO_REALM + value: quarkus + - name: SSO_CLIENT_ID + value: tackle-ui + - name: SSO_SERVER_URL + value: "http://keycloak:8080" + livenessProbe: + exec: + command: + - /bin/sh + - -c + - "[ -f /run/nginx.pid ] && ps -A | grep nginx" + initialDelaySeconds: 10 + periodSeconds: 5 + readinessProbe: + httpGet: + scheme: HTTP + path: / + port: 8080 + initialDelaySeconds: 10 + periodSeconds: 5 + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + imagePullPolicy: Always + restartPolicy: Always + terminationGracePeriodSeconds: 30 + dnsPolicy: ClusterFirst + securityContext: {} + schedulerName: default-scheduler + strategy: + type: RollingUpdate + rollingUpdate: + maxUnavailable: 25% + maxSurge: 25% + revisionHistoryLimit: 10 + progressDeadlineSeconds: 600 diff --git a/kubernetes/ui/svc.yml b/kubernetes/ui/svc.yml new file mode 100644 index 00000000..0aca5fb3 --- /dev/null +++ b/kubernetes/ui/svc.yml @@ -0,0 +1,17 @@ +kind: Service +apiVersion: v1 +metadata: + name: tackle-ui + labels: + app.kubernetes.io/name: tackle-ui + app.kubernetes.io/component: ui + app.kubernetes.io/instance: tackle-ui + app.kubernetes.io/part-of: tackle +spec: + ports: + - name: 8080-tcp + protocol: TCP + port: 8080 + targetPort: 8080 + selector: + app.kubernetes.io/name: tackle-ui \ No newline at end of file diff --git a/public/keycloak.json b/public/keycloak.json index dde90ff0..35df1f3d 100644 --- a/public/keycloak.json +++ b/public/keycloak.json @@ -1,6 +1,6 @@ { "realm": "konveyor", - "auth-server-url": "http://localhost:8180/auth/", + "auth-server-url": "http://192.168.99.113/auth", "resource": "tackle-ui", "public-client": true } diff --git a/src/setupProxy.js b/src/setupProxy.js index 9afb9767..d39c5fc6 100644 --- a/src/setupProxy.js +++ b/src/setupProxy.js @@ -1,10 +1,16 @@ const { createProxyMiddleware } = require("http-proxy-middleware"); +const TACKLE_CONTROLS_HOST = + process.env.CONTROLS_URL || "http://localhost:8081"; +const TACKLE_APPLICATION_INVENTORY_HOST = + process.env.CONTROLS_URL || "http://localhost:8082"; + module.exports = function (app) { app.use( "/api/controls", createProxyMiddleware({ - target: "http://localhost:8081", + target: TACKLE_CONTROLS_HOST, + secure: false, changeOrigin: true, pathRewrite: { "^/api/controls": "/controls", @@ -15,7 +21,8 @@ module.exports = function (app) { app.use( "/api/application-inventory", createProxyMiddleware({ - target: "http://localhost:8082", + target: TACKLE_APPLICATION_INVENTORY_HOST, + secure: false, changeOrigin: true, pathRewrite: { "^/api/application-inventory": "/application-inventory", From 75571f10fbf1ebc6c69a243c1e33facd55c2a65f Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Fri, 19 Mar 2021 20:02:56 +0100 Subject: [PATCH 02/43] add minikube --- .github/workflows/ci-actions.yml | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index d740eff2..895907dc 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - minikube pull_request: branches: - main @@ -171,20 +172,21 @@ jobs: kubectl create -f kubernetes/application-inventory -n tackle kubectl wait deployment/tackle-application-inventory --for condition=available --timeout=0 -n tackle - # export TACKLE_CONTROLS_HOST=$(minikube ip) - # export TACKLE_APPLICATION_INVENTORY_HOST=$(minikube ip) + export TACKLE_INGRESS_IP=$(kubectl get ingress tackle -o json -n tackle | jq -r ".status.loadBalancer.ingress[].ip") + export TACKLE_CONTROLS_HOST=$TACKLE_INGRESS_IP + export TACKLE_APPLICATION_INVENTORY_HOST=$TACKLE_INGRESS_IP - # - name: Cypress run - # uses: cypress-io/github-action@v2 - # with: - # record: false - # start: yarn run ui:start - # wait-on: "http://localhost:3000" - # wait-on-timeout: 120 - # config: pageLoadTimeout=100000 - # browser: ${{ matrix.browser }} - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Cypress run + uses: cypress-io/github-action@v2 + with: + record: false + start: yarn run ui:start + wait-on: "http://localhost:3000" + wait-on-timeout: 120 + config: pageLoadTimeout=100000 + browser: ${{ matrix.browser }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # - uses: actions/upload-artifact@v1 # if: failure() # with: From 3a47f57311988a8de9eae065745cb2b8c2c56adb Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Fri, 19 Mar 2021 20:14:07 +0100 Subject: [PATCH 03/43] fix timeouts --- .github/workflows/ci-actions.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index 895907dc..d81a830f 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -164,17 +164,17 @@ jobs: kubectl create -f kubernetes/ing.yml -n tackle kubectl create -f kubernetes/keycloak -n tackle - kubectl wait deployment/keycloak --for condition=available --timeout=0 -n tackle + kubectl wait deployment/keycloak --for condition=available --timeout=-1 -n tackle kubectl create -f kubernetes/controls -n tackle - kubectl wait deployment/tackle-controls --for condition=available --timeout=0 -n tackle + kubectl wait deployment/tackle-controls --for condition=available --timeout=-1 -n tackle kubectl create -f kubernetes/application-inventory -n tackle - kubectl wait deployment/tackle-application-inventory --for condition=available --timeout=0 -n tackle + kubectl wait deployment/tackle-application-inventory --for condition=available --timeout=-1 -n tackle export TACKLE_INGRESS_IP=$(kubectl get ingress tackle -o json -n tackle | jq -r ".status.loadBalancer.ingress[].ip") - export TACKLE_CONTROLS_HOST=$TACKLE_INGRESS_IP - export TACKLE_APPLICATION_INVENTORY_HOST=$TACKLE_INGRESS_IP + export TACKLE_CONTROLS_HOST=https://$TACKLE_INGRESS_IP + export TACKLE_APPLICATION_INVENTORY_HOST=https://$TACKLE_INGRESS_IP - name: Cypress run uses: cypress-io/github-action@v2 From 7bad1eb013b35b9b182d25ed0f8efaca68f31213 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Fri, 19 Mar 2021 20:15:10 +0100 Subject: [PATCH 04/43] Fix wait --- .github/workflows/ci-actions.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index d81a830f..e3ae38f1 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -164,13 +164,13 @@ jobs: kubectl create -f kubernetes/ing.yml -n tackle kubectl create -f kubernetes/keycloak -n tackle - kubectl wait deployment/keycloak --for condition=available --timeout=-1 -n tackle + kubectl wait deployment/keycloak --for condition=available --timeout=-1s -n tackle kubectl create -f kubernetes/controls -n tackle - kubectl wait deployment/tackle-controls --for condition=available --timeout=-1 -n tackle + kubectl wait deployment/tackle-controls --for condition=available --timeout=-1s -n tackle kubectl create -f kubernetes/application-inventory -n tackle - kubectl wait deployment/tackle-application-inventory --for condition=available --timeout=-1 -n tackle + kubectl wait deployment/tackle-application-inventory --for condition=available --timeout=-1s -n tackle export TACKLE_INGRESS_IP=$(kubectl get ingress tackle -o json -n tackle | jq -r ".status.loadBalancer.ingress[].ip") export TACKLE_CONTROLS_HOST=https://$TACKLE_INGRESS_IP From b742f4cf7adf987c20b4de2b399dc6522cf30afc Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Fri, 19 Mar 2021 20:31:18 +0100 Subject: [PATCH 05/43] Add echo --- .github/workflows/ci-actions.yml | 42 ++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index e3ae38f1..7be86ec4 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -149,10 +149,10 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - - name: Build - run: | - yarn install - yarn build:instrumentation + # - name: Build + # run: | + # yarn install + # yarn build:instrumentation - name: Setup Minikube uses: manusa/actions-setup-minikube@v2.3.1 with: @@ -161,32 +161,42 @@ jobs: - name: Deploy Tackle run: | kubectl create ns tackle + + echo "Creating ingress..." kubectl create -f kubernetes/ing.yml -n tackle + echo "Deploying Keycloak..." kubectl create -f kubernetes/keycloak -n tackle kubectl wait deployment/keycloak --for condition=available --timeout=-1s -n tackle - + + echo "Deploying Tackle controls..." kubectl create -f kubernetes/controls -n tackle kubectl wait deployment/tackle-controls --for condition=available --timeout=-1s -n tackle + echo "Deploying Tackle application inventory..." kubectl create -f kubernetes/application-inventory -n tackle kubectl wait deployment/tackle-application-inventory --for condition=available --timeout=-1s -n tackle + kubectl get ingress tackle -o json -n tackle + export TACKLE_INGRESS_IP=$(kubectl get ingress tackle -o json -n tackle | jq -r ".status.loadBalancer.ingress[].ip") export TACKLE_CONTROLS_HOST=https://$TACKLE_INGRESS_IP export TACKLE_APPLICATION_INVENTORY_HOST=https://$TACKLE_INGRESS_IP + + echo TACKLE_INGRESS_IP=$(TACKLE_INGRESS_IP) + echo TACKLE_APPLICATION_INVENTORY_HOST=$(TACKLE_APPLICATION_INVENTORY_HOST) - - name: Cypress run - uses: cypress-io/github-action@v2 - with: - record: false - start: yarn run ui:start - wait-on: "http://localhost:3000" - wait-on-timeout: 120 - config: pageLoadTimeout=100000 - browser: ${{ matrix.browser }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # - name: Cypress run + # uses: cypress-io/github-action@v2 + # with: + # record: false + # start: yarn run ui:start + # wait-on: "http://localhost:3000" + # wait-on-timeout: 120 + # config: pageLoadTimeout=100000 + # browser: ${{ matrix.browser }} + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # - uses: actions/upload-artifact@v1 # if: failure() # with: From 46cd09f61f0c52ae173ce9c249cec85c01a86546 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Fri, 19 Mar 2021 20:42:57 +0100 Subject: [PATCH 06/43] Add addons ingress --- .github/workflows/ci-actions.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index 7be86ec4..9c0e7a64 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -158,6 +158,7 @@ jobs: with: minikube version: "v1.18.1" kubernetes version: "v1.20.5" + start args: "--addons ingress" - name: Deploy Tackle run: | kubectl create ns tackle From 5a5e1ab0d7d208552c4e4c30b31754b345d59705 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Fri, 19 Mar 2021 20:50:40 +0100 Subject: [PATCH 07/43] ingress fix --- .github/workflows/ci-actions.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index 9c0e7a64..836ccda0 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -162,10 +162,7 @@ jobs: - name: Deploy Tackle run: | kubectl create ns tackle - - echo "Creating ingress..." - kubectl create -f kubernetes/ing.yml -n tackle - + echo "Deploying Keycloak..." kubectl create -f kubernetes/keycloak -n tackle kubectl wait deployment/keycloak --for condition=available --timeout=-1s -n tackle @@ -178,6 +175,9 @@ jobs: kubectl create -f kubernetes/application-inventory -n tackle kubectl wait deployment/tackle-application-inventory --for condition=available --timeout=-1s -n tackle + echo "Creating ingress" + kubectl create -f kubernetes/ing.yml -n tackle + kubectl get ingress tackle -o json -n tackle export TACKLE_INGRESS_IP=$(kubectl get ingress tackle -o json -n tackle | jq -r ".status.loadBalancer.ingress[].ip") From db1991307dd7132d95d19e946282455cee590e96 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Fri, 19 Mar 2021 20:53:22 +0100 Subject: [PATCH 08/43] Second fix --- .github/workflows/ci-actions.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index 836ccda0..54be4017 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -158,11 +158,14 @@ jobs: with: minikube version: "v1.18.1" kubernetes version: "v1.20.5" - start args: "--addons ingress" + start args: "--addons=registry --addons=ingress" - name: Deploy Tackle run: | kubectl create ns tackle + echo "Creating ingress" + kubectl create -f kubernetes/ing.yml -n tackle + echo "Deploying Keycloak..." kubectl create -f kubernetes/keycloak -n tackle kubectl wait deployment/keycloak --for condition=available --timeout=-1s -n tackle @@ -173,11 +176,8 @@ jobs: echo "Deploying Tackle application inventory..." kubectl create -f kubernetes/application-inventory -n tackle - kubectl wait deployment/tackle-application-inventory --for condition=available --timeout=-1s -n tackle + kubectl wait deployment/tackle-application-inventory --for condition=available --timeout=-1s -n tackle - echo "Creating ingress" - kubectl create -f kubernetes/ing.yml -n tackle - kubectl get ingress tackle -o json -n tackle export TACKLE_INGRESS_IP=$(kubectl get ingress tackle -o json -n tackle | jq -r ".status.loadBalancer.ingress[].ip") From e5ccb6a85b019097cf44beae4f64db1645ff463f Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Fri, 19 Mar 2021 20:58:05 +0100 Subject: [PATCH 09/43] CHange versions --- .github/workflows/ci-actions.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index 54be4017..e77f3661 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -156,25 +156,20 @@ jobs: - name: Setup Minikube uses: manusa/actions-setup-minikube@v2.3.1 with: - minikube version: "v1.18.1" - kubernetes version: "v1.20.5" - start args: "--addons=registry --addons=ingress" + minikube version: v1.9.2 + kubernetes version: v1.18.2 + start args: '--addons=registry --addons=ingress' - name: Deploy Tackle run: | kubectl create ns tackle - - echo "Creating ingress" kubectl create -f kubernetes/ing.yml -n tackle - - echo "Deploying Keycloak..." + kubectl create -f kubernetes/keycloak -n tackle kubectl wait deployment/keycloak --for condition=available --timeout=-1s -n tackle - echo "Deploying Tackle controls..." kubectl create -f kubernetes/controls -n tackle kubectl wait deployment/tackle-controls --for condition=available --timeout=-1s -n tackle - echo "Deploying Tackle application inventory..." kubectl create -f kubernetes/application-inventory -n tackle kubectl wait deployment/tackle-application-inventory --for condition=available --timeout=-1s -n tackle From 4043b9cd9e4fe041a16a626594fd473a4af286da Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Fri, 19 Mar 2021 21:01:15 +0100 Subject: [PATCH 10/43] Verify minikube --- .github/workflows/ci-actions.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index e77f3661..22bb93a8 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -159,6 +159,12 @@ jobs: minikube version: v1.9.2 kubernetes version: v1.18.2 start args: '--addons=registry --addons=ingress' + - name: Validate Minikube + run: minikube status | grep Running + - name: Validate Cluster + run: kubectl get nodes + - name: Validate enabled addon in arg + run: minikube addons list -o json | jq '.registry.Status' | grep enabled - name: Deploy Tackle run: | kubectl create ns tackle From 95782e0e3d2b005ffd9f8102729c424dbfb0ee9d Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Fri, 19 Mar 2021 21:05:50 +0100 Subject: [PATCH 11/43] change laptop vers --- .github/workflows/ci-actions.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index 22bb93a8..f6174201 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -156,8 +156,8 @@ jobs: - name: Setup Minikube uses: manusa/actions-setup-minikube@v2.3.1 with: - minikube version: v1.9.2 - kubernetes version: v1.18.2 + minikube version: v1.17.1 + kubernetes version: v1.20.2 start args: '--addons=registry --addons=ingress' - name: Validate Minikube run: minikube status | grep Running From 1d4361cd7fa26c2f0a1f49aec91f05b8e2b1fbe5 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Fri, 19 Mar 2021 21:11:49 +0100 Subject: [PATCH 12/43] change driver --- .github/workflows/ci-actions.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index f6174201..82bfb89c 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -158,6 +158,7 @@ jobs: with: minikube version: v1.17.1 kubernetes version: v1.20.2 + driver: docker start args: '--addons=registry --addons=ingress' - name: Validate Minikube run: minikube status | grep Running From 6d5bf22210297de97ddf9d374d99967683c92416 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Fri, 19 Mar 2021 21:18:28 +0100 Subject: [PATCH 13/43] Change order --- .github/workflows/ci-actions.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index 82bfb89c..1095a43d 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -169,7 +169,6 @@ jobs: - name: Deploy Tackle run: | kubectl create ns tackle - kubectl create -f kubernetes/ing.yml -n tackle kubectl create -f kubernetes/keycloak -n tackle kubectl wait deployment/keycloak --for condition=available --timeout=-1s -n tackle @@ -180,6 +179,8 @@ jobs: kubectl create -f kubernetes/application-inventory -n tackle kubectl wait deployment/tackle-application-inventory --for condition=available --timeout=-1s -n tackle + kubectl create -f kubernetes/ing.yml -n tackle + kubectl get ingress tackle -o json -n tackle export TACKLE_INGRESS_IP=$(kubectl get ingress tackle -o json -n tackle | jq -r ".status.loadBalancer.ingress[].ip") From 7dd8703d578e4b6da709160f341dd4f422fd2af3 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Fri, 19 Mar 2021 21:34:37 +0100 Subject: [PATCH 14/43] custom bash --- .github/workflows/ci-actions.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index 1095a43d..719215a4 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -180,16 +180,18 @@ jobs: kubectl wait deployment/tackle-application-inventory --for condition=available --timeout=-1s -n tackle kubectl create -f kubernetes/ing.yml -n tackle - + kubectl get ingress tackle -o json -n tackle - export TACKLE_INGRESS_IP=$(kubectl get ingress tackle -o json -n tackle | jq -r ".status.loadBalancer.ingress[].ip") - export TACKLE_CONTROLS_HOST=https://$TACKLE_INGRESS_IP - export TACKLE_APPLICATION_INVENTORY_HOST=https://$TACKLE_INGRESS_IP + # export TACKLE_INGRESS_IP=$(kubectl get ingress tackle -o json -n tackle | jq -r ".status.loadBalancer.ingress[].ip") + # export TACKLE_CONTROLS_HOST=https://$TACKLE_INGRESS_IP + # export TACKLE_APPLICATION_INVENTORY_HOST=https://$TACKLE_INGRESS_IP - echo TACKLE_INGRESS_IP=$(TACKLE_INGRESS_IP) - echo TACKLE_APPLICATION_INVENTORY_HOST=$(TACKLE_APPLICATION_INVENTORY_HOST) + # echo TACKLE_INGRESS_IP=$(TACKLE_INGRESS_IP) + # echo TACKLE_APPLICATION_INVENTORY_HOST=$(TACKLE_APPLICATION_INVENTORY_HOST) + - name: Ingress + run: bash -c 'external_ip=""; while [ -z $external_ip ]; do echo "Waiting for end point..."; external_ip=$(kubectl get ingress tackle --template="{{range .status.loadBalancer.ingress}}{{.ip}}{{end}}" -n tackle); [ -z "$external_ip" ] && sleep 10; done; echo "End point ready-" && echo $external_ip; export endpoint=$external_ip' # - name: Cypress run # uses: cypress-io/github-action@v2 # with: From 30f279ffc6c0ee0ed0629c202572596701c96f04 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Fri, 19 Mar 2021 21:52:40 +0100 Subject: [PATCH 15/43] Test env --- .github/workflows/ci-actions.yml | 67 ++++++++++++++------------- .github/workflows/test-containers.yml | 32 ------------- 2 files changed, 36 insertions(+), 63 deletions(-) delete mode 100644 .github/workflows/test-containers.yml diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index 719215a4..8c1904ef 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -149,49 +149,54 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + - name: a + run: echo "TACKLE_CONTROLS_HOST=yellow" >> $GITHUB_ENV + - name: b + run: echo $TACKLE_CONTROLS_HOST + # - name: Build # run: | # yarn install # yarn build:instrumentation - - name: Setup Minikube - uses: manusa/actions-setup-minikube@v2.3.1 - with: - minikube version: v1.17.1 - kubernetes version: v1.20.2 - driver: docker - start args: '--addons=registry --addons=ingress' - - name: Validate Minikube - run: minikube status | grep Running - - name: Validate Cluster - run: kubectl get nodes - - name: Validate enabled addon in arg - run: minikube addons list -o json | jq '.registry.Status' | grep enabled - - name: Deploy Tackle - run: | - kubectl create ns tackle + # - name: Setup Minikube + # uses: manusa/actions-setup-minikube@v2.3.1 + # with: + # minikube version: v1.17.1 + # kubernetes version: v1.20.2 + # driver: docker + # start args: '--addons=registry --addons=ingress' + # - name: Validate Minikube + # run: minikube status | grep Running + # - name: Validate Cluster + # run: kubectl get nodes + # - name: Validate enabled addon in arg + # run: minikube addons list -o json | jq '.registry.Status' | grep enabled + # - name: Deploy Tackle + # run: | + # kubectl create ns tackle - kubectl create -f kubernetes/keycloak -n tackle - kubectl wait deployment/keycloak --for condition=available --timeout=-1s -n tackle + # kubectl create -f kubernetes/keycloak -n tackle + # kubectl wait deployment/keycloak --for condition=available --timeout=-1s -n tackle - kubectl create -f kubernetes/controls -n tackle - kubectl wait deployment/tackle-controls --for condition=available --timeout=-1s -n tackle + # kubectl create -f kubernetes/controls -n tackle + # kubectl wait deployment/tackle-controls --for condition=available --timeout=-1s -n tackle - kubectl create -f kubernetes/application-inventory -n tackle - kubectl wait deployment/tackle-application-inventory --for condition=available --timeout=-1s -n tackle + # kubectl create -f kubernetes/application-inventory -n tackle + # kubectl wait deployment/tackle-application-inventory --for condition=available --timeout=-1s -n tackle - kubectl create -f kubernetes/ing.yml -n tackle + # kubectl create -f kubernetes/ing.yml -n tackle - kubectl get ingress tackle -o json -n tackle + # kubectl get ingress tackle -o json -n tackle - # export TACKLE_INGRESS_IP=$(kubectl get ingress tackle -o json -n tackle | jq -r ".status.loadBalancer.ingress[].ip") - # export TACKLE_CONTROLS_HOST=https://$TACKLE_INGRESS_IP - # export TACKLE_APPLICATION_INVENTORY_HOST=https://$TACKLE_INGRESS_IP + # # export TACKLE_INGRESS_IP=$(kubectl get ingress tackle -o json -n tackle | jq -r ".status.loadBalancer.ingress[].ip") + # # export TACKLE_CONTROLS_HOST=https://$TACKLE_INGRESS_IP + # # export TACKLE_APPLICATION_INVENTORY_HOST=https://$TACKLE_INGRESS_IP - # echo TACKLE_INGRESS_IP=$(TACKLE_INGRESS_IP) - # echo TACKLE_APPLICATION_INVENTORY_HOST=$(TACKLE_APPLICATION_INVENTORY_HOST) + # # echo TACKLE_INGRESS_IP=$(TACKLE_INGRESS_IP) + # # echo TACKLE_APPLICATION_INVENTORY_HOST=$(TACKLE_APPLICATION_INVENTORY_HOST) - - name: Ingress - run: bash -c 'external_ip=""; while [ -z $external_ip ]; do echo "Waiting for end point..."; external_ip=$(kubectl get ingress tackle --template="{{range .status.loadBalancer.ingress}}{{.ip}}{{end}}" -n tackle); [ -z "$external_ip" ] && sleep 10; done; echo "End point ready-" && echo $external_ip; export endpoint=$external_ip' + # - name: Ingress + # run: bash -c 'external_ip=""; while [ -z $external_ip ]; do echo "Waiting for end point..."; external_ip=$(kubectl get ingress tackle --template="{{range .status.loadBalancer.ingress}}{{.ip}}{{end}}" -n tackle); [ -z "$external_ip" ] && sleep 10; done; echo "End point ready-" && echo $external_ip; export endpoint=$external_ip' # - name: Cypress run # uses: cypress-io/github-action@v2 # with: diff --git a/.github/workflows/test-containers.yml b/.github/workflows/test-containers.yml deleted file mode 100644 index 168ae7e1..00000000 --- a/.github/workflows/test-containers.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Test containers - -on: [push] - -jobs: - container-images: - if: ${{ github.event_name != 'pull_request' && github.repository_owner != 'konveyor' }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Use Node.js - uses: actions/setup-node@v1 - with: - node-version: 12.x - - name: Build - run: | - yarn install - yarn build - - name: Extract branch name - shell: bash - run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" - id: extract_branch - - name: Push to GitHub Packages - uses: elgohr/Publish-Docker-Github-Action@3.02 - with: - registry: docker.pkg.github.com - name: ${{ github.repository_owner }}/${{ github.event.repository.name }}/tackle-ui - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - dockerfile: Dockerfile - snapshot: false - tags: "${{ steps.extract_branch.outputs.branch }}" From e47fa9a7ac53a85de8511e17dd43ad87eb298c09 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Fri, 19 Mar 2021 21:57:10 +0100 Subject: [PATCH 16/43] test yarn --- .github/workflows/ci-actions.yml | 11 ++++++----- server.js | 31 ++++++++++++++++--------------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index 8c1904ef..25a47cad 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -129,9 +129,7 @@ jobs: # with: # name: e2e-screenshots-${{ matrix.os }}-${{ matrix.browser }} # path: cypress/screenshots - # - uses: actions/upload-artifact@v1 - # if: always() - # with: + # - uses: actions/upload-artifact@v1 # if: always() # with: # name: e2e-videos-${{ matrix.os }}-${{ matrix.browser }} # path: cypress/videos # - uses: codecov/codecov-action@v1 @@ -149,10 +147,13 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + - run: yarn install - name: a - run: echo "TACKLE_CONTROLS_HOST=yellow" >> $GITHUB_ENV + run: echo "CONTROLS_URL=192.168.1.6" >> $GITHUB_ENV - name: b - run: echo $TACKLE_CONTROLS_HOST + run: | + echo $CONTROLS_URL + yarn run ui:start # - name: Build # run: | diff --git a/server.js b/server.js index 2d6e3fb0..e12aabaf 100644 --- a/server.js +++ b/server.js @@ -1,21 +1,22 @@ -const express = require("express"); -const path = require("path"); -const app = express(), bodyParser = require("body-parser"); +console.log(process.env.CONTROLS_URL); +// const express = require("express"); +// const path = require("path"); +// const app = express(), bodyParser = require("body-parser"); -const setupProxy = require('./src/setupProxy'); +// const setupProxy = require('./src/setupProxy'); -port = 3000; +// port = 3000; -setupProxy(app); +// setupProxy(app); -app.use(bodyParser.json()); -app.use(express.static(path.join(__dirname, "build"))); +// app.use(bodyParser.json()); +// app.use(express.static(path.join(__dirname, "build"))); -// Handles any requests that don't match the ones above -app.get("*", (req, res) => { - res.sendFile(path.join(__dirname, "/build/index.html")); -}); +// // Handles any requests that don't match the ones above +// app.get("*", (req, res) => { +// res.sendFile(path.join(__dirname, "/build/index.html")); +// }); -app.listen(port, () => { - console.log(`Server listening on the port::${port}`); -}); +// app.listen(port, () => { +// console.log(`Server listening on the port::${port}`); +// }); From 28a74a790338673feded62309ac7013de47afa4b Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Fri, 19 Mar 2021 22:09:29 +0100 Subject: [PATCH 17/43] Add ok --- .github/workflows/ci-actions.yml | 102 +++++++++++++++---------------- server.js | 31 +++++----- src/setupProxy.js | 7 ++- 3 files changed, 69 insertions(+), 71 deletions(-) diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index 25a47cad..c6ffca81 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -147,68 +147,62 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - - run: yarn install - - name: a - run: echo "CONTROLS_URL=192.168.1.6" >> $GITHUB_ENV - - name: b - run: | - echo $CONTROLS_URL - yarn run ui:start + # - run: yarn install + # - name: a + # run: echo "CONTROLS_URL=192.168.1.6" >> $GITHUB_ENV - # - name: Build - # run: | - # yarn install - # yarn build:instrumentation - # - name: Setup Minikube - # uses: manusa/actions-setup-minikube@v2.3.1 - # with: - # minikube version: v1.17.1 - # kubernetes version: v1.20.2 - # driver: docker - # start args: '--addons=registry --addons=ingress' - # - name: Validate Minikube - # run: minikube status | grep Running - # - name: Validate Cluster - # run: kubectl get nodes - # - name: Validate enabled addon in arg - # run: minikube addons list -o json | jq '.registry.Status' | grep enabled - # - name: Deploy Tackle - # run: | - # kubectl create ns tackle + - name: Build + run: | + yarn install + yarn build:instrumentation + - name: Setup Minikube + uses: manusa/actions-setup-minikube@v2.3.1 + with: + minikube version: v1.17.1 + kubernetes version: v1.20.2 + driver: docker + start args: '--addons=registry --addons=ingress' + - name: Validate Minikube + run: minikube status | grep Running + - name: Validate Cluster + run: kubectl get nodes + - name: Validate enabled addon in arg + run: minikube addons list -o json | jq '.registry.Status' | grep enabled + - name: Deploy Tackle + run: | + kubectl create ns tackle - # kubectl create -f kubernetes/keycloak -n tackle - # kubectl wait deployment/keycloak --for condition=available --timeout=-1s -n tackle + kubectl create -f kubernetes/keycloak -n tackle + kubectl wait deployment/keycloak --for condition=available --timeout=-1s -n tackle - # kubectl create -f kubernetes/controls -n tackle - # kubectl wait deployment/tackle-controls --for condition=available --timeout=-1s -n tackle + kubectl create -f kubernetes/controls -n tackle + kubectl wait deployment/tackle-controls --for condition=available --timeout=-1s -n tackle - # kubectl create -f kubernetes/application-inventory -n tackle - # kubectl wait deployment/tackle-application-inventory --for condition=available --timeout=-1s -n tackle + kubectl create -f kubernetes/application-inventory -n tackle + kubectl wait deployment/tackle-application-inventory --for condition=available --timeout=-1s -n tackle - # kubectl create -f kubernetes/ing.yml -n tackle + kubectl create -f kubernetes/ing.yml -n tackle - # kubectl get ingress tackle -o json -n tackle - - # # export TACKLE_INGRESS_IP=$(kubectl get ingress tackle -o json -n tackle | jq -r ".status.loadBalancer.ingress[].ip") - # # export TACKLE_CONTROLS_HOST=https://$TACKLE_INGRESS_IP - # # export TACKLE_APPLICATION_INVENTORY_HOST=https://$TACKLE_INGRESS_IP + # export TACKLE_INGRESS_IP=$(kubectl get ingress tackle -o json -n tackle | jq -r ".status.loadBalancer.ingress[].ip") + # export TACKLE_CONTROLS_HOST=https://$TACKLE_INGRESS_IP + # export TACKLE_APPLICATION_INVENTORY_HOST=https://$TACKLE_INGRESS_IP - # # echo TACKLE_INGRESS_IP=$(TACKLE_INGRESS_IP) - # # echo TACKLE_APPLICATION_INVENTORY_HOST=$(TACKLE_APPLICATION_INVENTORY_HOST) + # echo TACKLE_INGRESS_IP=$(TACKLE_INGRESS_IP) + # echo TACKLE_APPLICATION_INVENTORY_HOST=$(TACKLE_APPLICATION_INVENTORY_HOST) - # - name: Ingress - # run: bash -c 'external_ip=""; while [ -z $external_ip ]; do echo "Waiting for end point..."; external_ip=$(kubectl get ingress tackle --template="{{range .status.loadBalancer.ingress}}{{.ip}}{{end}}" -n tackle); [ -z "$external_ip" ] && sleep 10; done; echo "End point ready-" && echo $external_ip; export endpoint=$external_ip' - # - name: Cypress run - # uses: cypress-io/github-action@v2 - # with: - # record: false - # start: yarn run ui:start - # wait-on: "http://localhost:3000" - # wait-on-timeout: 120 - # config: pageLoadTimeout=100000 - # browser: ${{ matrix.browser }} - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Ingress + run: bash -c 'external_ip=""; while [ -z $external_ip ]; do echo "Waiting for end point..."; external_ip=$(kubectl get ingress tackle --template="{{range .status.loadBalancer.ingress}}{{.ip}}{{end}}" -n tackle); [ -z "$external_ip" ] && sleep 10; done; echo "End point ready-" && echo $external_ip; export endpoint=$external_ip; echo "CONTROLS_URL=https://$external_ip" >> $GITHUB_ENV && echo "APPLICATION_INVENTORY_URL=https://$external_ip" >> $GITHUB_ENV' + - name: Cypress run + uses: cypress-io/github-action@v2 + with: + record: false + start: yarn run ui:start + wait-on: "http://localhost:3000" + wait-on-timeout: 120 + config: pageLoadTimeout=100000 + browser: ${{ matrix.browser }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # - uses: actions/upload-artifact@v1 # if: failure() # with: diff --git a/server.js b/server.js index e12aabaf..2d6e3fb0 100644 --- a/server.js +++ b/server.js @@ -1,22 +1,21 @@ -console.log(process.env.CONTROLS_URL); -// const express = require("express"); -// const path = require("path"); -// const app = express(), bodyParser = require("body-parser"); +const express = require("express"); +const path = require("path"); +const app = express(), bodyParser = require("body-parser"); -// const setupProxy = require('./src/setupProxy'); +const setupProxy = require('./src/setupProxy'); -// port = 3000; +port = 3000; -// setupProxy(app); +setupProxy(app); -// app.use(bodyParser.json()); -// app.use(express.static(path.join(__dirname, "build"))); +app.use(bodyParser.json()); +app.use(express.static(path.join(__dirname, "build"))); -// // Handles any requests that don't match the ones above -// app.get("*", (req, res) => { -// res.sendFile(path.join(__dirname, "/build/index.html")); -// }); +// Handles any requests that don't match the ones above +app.get("*", (req, res) => { + res.sendFile(path.join(__dirname, "/build/index.html")); +}); -// app.listen(port, () => { -// console.log(`Server listening on the port::${port}`); -// }); +app.listen(port, () => { + console.log(`Server listening on the port::${port}`); +}); diff --git a/src/setupProxy.js b/src/setupProxy.js index d39c5fc6..0c676d2b 100644 --- a/src/setupProxy.js +++ b/src/setupProxy.js @@ -3,7 +3,12 @@ const { createProxyMiddleware } = require("http-proxy-middleware"); const TACKLE_CONTROLS_HOST = process.env.CONTROLS_URL || "http://localhost:8081"; const TACKLE_APPLICATION_INVENTORY_HOST = - process.env.CONTROLS_URL || "http://localhost:8082"; + process.env.APPLICATION_INVENTORY_URL || "http://localhost:8082"; + +console.log("Using TACKLE_CONTROLS_HOST=" + TACKLE_CONTROLS_HOST); +console.log( + "Using TACKLE_APPLICATION_INVENTORY_HOST=" + TACKLE_APPLICATION_INVENTORY_HOST +); module.exports = function (app) { app.use( From ef901146a5815623aaeb873d97a05abae27205a6 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Fri, 19 Mar 2021 22:34:03 +0100 Subject: [PATCH 18/43] Set keycloak env --- .github/workflows/ci-actions.yml | 13 +++---------- public/keycloak.json.k8s.template | 6 ++++++ 2 files changed, 9 insertions(+), 10 deletions(-) create mode 100644 public/keycloak.json.k8s.template diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index c6ffca81..c6271050 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -182,16 +182,9 @@ jobs: kubectl wait deployment/tackle-application-inventory --for condition=available --timeout=-1s -n tackle kubectl create -f kubernetes/ing.yml -n tackle - - # export TACKLE_INGRESS_IP=$(kubectl get ingress tackle -o json -n tackle | jq -r ".status.loadBalancer.ingress[].ip") - # export TACKLE_CONTROLS_HOST=https://$TACKLE_INGRESS_IP - # export TACKLE_APPLICATION_INVENTORY_HOST=https://$TACKLE_INGRESS_IP - - # echo TACKLE_INGRESS_IP=$(TACKLE_INGRESS_IP) - # echo TACKLE_APPLICATION_INVENTORY_HOST=$(TACKLE_APPLICATION_INVENTORY_HOST) - - - name: Ingress - run: bash -c 'external_ip=""; while [ -z $external_ip ]; do echo "Waiting for end point..."; external_ip=$(kubectl get ingress tackle --template="{{range .status.loadBalancer.ingress}}{{.ip}}{{end}}" -n tackle); [ -z "$external_ip" ] && sleep 10; done; echo "End point ready-" && echo $external_ip; export endpoint=$external_ip; echo "CONTROLS_URL=https://$external_ip" >> $GITHUB_ENV && echo "APPLICATION_INVENTORY_URL=https://$external_ip" >> $GITHUB_ENV' + - name: Wait for Ingress + run: bash -c 'external_ip=""; while [ -z $external_ip ]; do echo "Waiting for end point..."; external_ip=$(kubectl get ingress tackle --template="{{range .status.loadBalancer.ingress}}{{.ip}}{{end}}" -n tackle); [ -z "$external_ip" ] && sleep 10; done; echo "End point ready-" && echo $external_ip; export endpoint=$external_ip; export SSO_URL=https://$external_ip/auth; envsubst '${SSO_URL}' < ./build/keycloak.json.k8s.template > ./build/keycloak.json; echo "CONTROLS_URL=https://$external_ip" >> $GITHUB_ENV && echo "APPLICATION_INVENTORY_URL=https://$external_ip" >> $GITHUB_ENV' + - - name: Cypress run uses: cypress-io/github-action@v2 with: diff --git a/public/keycloak.json.k8s.template b/public/keycloak.json.k8s.template new file mode 100644 index 00000000..2ad5891a --- /dev/null +++ b/public/keycloak.json.k8s.template @@ -0,0 +1,6 @@ +{ + "realm": "konveyor", + "auth-server-url": "${SSO_URL}", + "resource": "tackle-ui", + "public-client": true +} From c1f9825f453e31fd1fd5353e625db01cde1f3b74 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Fri, 19 Mar 2021 22:36:33 +0100 Subject: [PATCH 19/43] x --- .github/workflows/ci-actions.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index c6271050..31d28705 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -184,7 +184,6 @@ jobs: kubectl create -f kubernetes/ing.yml -n tackle - name: Wait for Ingress run: bash -c 'external_ip=""; while [ -z $external_ip ]; do echo "Waiting for end point..."; external_ip=$(kubectl get ingress tackle --template="{{range .status.loadBalancer.ingress}}{{.ip}}{{end}}" -n tackle); [ -z "$external_ip" ] && sleep 10; done; echo "End point ready-" && echo $external_ip; export endpoint=$external_ip; export SSO_URL=https://$external_ip/auth; envsubst '${SSO_URL}' < ./build/keycloak.json.k8s.template > ./build/keycloak.json; echo "CONTROLS_URL=https://$external_ip" >> $GITHUB_ENV && echo "APPLICATION_INVENTORY_URL=https://$external_ip" >> $GITHUB_ENV' - - - name: Cypress run uses: cypress-io/github-action@v2 with: From 8936f27db2b216c0b4b5fa86fd1ceb9bf277e42a Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Fri, 19 Mar 2021 22:57:18 +0100 Subject: [PATCH 20/43] s --- .github/workflows/ci-actions.yml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index 31d28705..b583ef94 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -183,7 +183,7 @@ jobs: kubectl create -f kubernetes/ing.yml -n tackle - name: Wait for Ingress - run: bash -c 'external_ip=""; while [ -z $external_ip ]; do echo "Waiting for end point..."; external_ip=$(kubectl get ingress tackle --template="{{range .status.loadBalancer.ingress}}{{.ip}}{{end}}" -n tackle); [ -z "$external_ip" ] && sleep 10; done; echo "End point ready-" && echo $external_ip; export endpoint=$external_ip; export SSO_URL=https://$external_ip/auth; envsubst '${SSO_URL}' < ./build/keycloak.json.k8s.template > ./build/keycloak.json; echo "CONTROLS_URL=https://$external_ip" >> $GITHUB_ENV && echo "APPLICATION_INVENTORY_URL=https://$external_ip" >> $GITHUB_ENV' + run: bash -c 'external_ip=""; while [ -z $external_ip ]; do echo "Waiting for end point..."; external_ip=$(kubectl get ingress tackle --template="{{range .status.loadBalancer.ingress}}{{.ip}}{{end}}" -n tackle); [ -z "$external_ip" ] && sleep 10; done; echo "End point ready-" && echo $external_ip; export endpoint=$external_ip; export SSO_URL=https://$external_ip/auth; envsubst '${SSO_URL}' < ./build/keycloak.json.k8s.template > ./build/keycloak.json; echo "CONTROLS_URL=https://$external_ip" >> $GITHUB_ENV && echo "APPLICATION_INVENTORY_URL=https://$external_ip" && echo "CYPRESS_controls_base_url=https://$external_ip/controls" && echo "CYPRESS_application_inventory_base_url=https://$external_ip/application-inventory" >> $GITHUB_ENV' - name: Cypress run uses: cypress-io/github-action@v2 with: @@ -195,19 +195,20 @@ jobs: browser: ${{ matrix.browser }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # - uses: actions/upload-artifact@v1 - # if: failure() - # with: - # name: e2e-screenshots-${{ matrix.os }}-${{ matrix.browser }} - # path: cypress/screenshots - # - uses: actions/upload-artifact@v1 - # if: always() - # with: - # name: e2e-videos-${{ matrix.os }}-${{ matrix.browser }} - # path: cypress/videos - # - uses: codecov/codecov-action@v1 - # with: - # flags: e2etests + CYPRESS_auth_base_url: http://localhost:3000/auth + - uses: actions/upload-artifact@v1 + if: failure() + with: + name: e2e-screenshots-${{ matrix.os }}-${{ matrix.browser }} + path: cypress/screenshots + - uses: actions/upload-artifact@v1 + if: always() + with: + name: e2e-videos-${{ matrix.os }}-${{ matrix.browser }} + path: cypress/videos + - uses: codecov/codecov-action@v1 + with: + flags: e2etests # container-images: # if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'konveyor' }} From 5e876fdaffb23d5d55fffb713831498c5d1a7d71 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Mon, 22 Mar 2021 10:16:57 +0100 Subject: [PATCH 21/43] fix e2e tests --- .github/workflows/ci-actions.yml | 5 ++--- src/setupProxy.js | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index b583ef94..dca77343 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -179,11 +179,11 @@ jobs: kubectl wait deployment/tackle-controls --for condition=available --timeout=-1s -n tackle kubectl create -f kubernetes/application-inventory -n tackle - kubectl wait deployment/tackle-application-inventory --for condition=available --timeout=-1s -n tackle + kubectl wait deployment/tackle-application-inventory --for condition=available --timeout=-1s -n tackle kubectl create -f kubernetes/ing.yml -n tackle - name: Wait for Ingress - run: bash -c 'external_ip=""; while [ -z $external_ip ]; do echo "Waiting for end point..."; external_ip=$(kubectl get ingress tackle --template="{{range .status.loadBalancer.ingress}}{{.ip}}{{end}}" -n tackle); [ -z "$external_ip" ] && sleep 10; done; echo "End point ready-" && echo $external_ip; export endpoint=$external_ip; export SSO_URL=https://$external_ip/auth; envsubst '${SSO_URL}' < ./build/keycloak.json.k8s.template > ./build/keycloak.json; echo "CONTROLS_URL=https://$external_ip" >> $GITHUB_ENV && echo "APPLICATION_INVENTORY_URL=https://$external_ip" && echo "CYPRESS_controls_base_url=https://$external_ip/controls" && echo "CYPRESS_application_inventory_base_url=https://$external_ip/application-inventory" >> $GITHUB_ENV' + run: bash -c 'external_ip=""; while [ -z $external_ip ]; do echo "Waiting for end point..."; external_ip=$(kubectl get ingress tackle --template="{{range .status.loadBalancer.ingress}}{{.ip}}{{end}}" -n tackle); [ -z "$external_ip" ] && sleep 10; done; echo "End point ready-" && echo $external_ip; export endpoint=$external_ip; export SSO_URL=https://$external_ip/auth; envsubst '${SSO_URL}' < ./build/keycloak.json.k8s.template > ./build/keycloak.json; echo "TACKLE_CONTROLS_HOST=https://$external_ip" >> $GITHUB_ENV && echo "TACKLE_APPLICATION_INVENTORY_HOST=https://$external_ip" >> $GITHUB_ENV && echo "CYPRESS_controls_base_url=https://$external_ip/controls" >> $GITHUB_ENV && echo "CYPRESS_application_inventory_base_url=https://$external_ip/application-inventory" >> $GITHUB_ENV && echo "CYPRESS_auth_base_url=https://$external_ip/auth" >> $GITHUB_ENV' - name: Cypress run uses: cypress-io/github-action@v2 with: @@ -195,7 +195,6 @@ jobs: browser: ${{ matrix.browser }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CYPRESS_auth_base_url: http://localhost:3000/auth - uses: actions/upload-artifact@v1 if: failure() with: diff --git a/src/setupProxy.js b/src/setupProxy.js index 0c676d2b..203af203 100644 --- a/src/setupProxy.js +++ b/src/setupProxy.js @@ -1,9 +1,9 @@ const { createProxyMiddleware } = require("http-proxy-middleware"); const TACKLE_CONTROLS_HOST = - process.env.CONTROLS_URL || "http://localhost:8081"; + process.env.TACKLE_CONTROLS_HOST || "http://localhost:8081"; const TACKLE_APPLICATION_INVENTORY_HOST = - process.env.APPLICATION_INVENTORY_URL || "http://localhost:8082"; + process.env.TACKLE_APPLICATION_INVENTORY_HOST || "http://localhost:8082"; console.log("Using TACKLE_CONTROLS_HOST=" + TACKLE_CONTROLS_HOST); console.log( From 1eddb4240cd1c876e196e16308b3b0e4b04a386f Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Wed, 7 Apr 2021 17:53:48 +0200 Subject: [PATCH 22/43] Add pathfinder --- .github/workflows/ci-actions.yml | 639 +++++++++++++++------------- kubernetes/pathfinder/db-deploy.yml | 84 ++++ kubernetes/pathfinder/db-pvc.yml | 16 + kubernetes/pathfinder/db-svc.yml | 21 + kubernetes/pathfinder/deploy.yml | 77 ++++ kubernetes/pathfinder/svc.yml | 23 + public/keycloak.json | 2 +- src/setupProxy.js | 10 +- 8 files changed, 576 insertions(+), 296 deletions(-) create mode 100644 kubernetes/pathfinder/db-deploy.yml create mode 100644 kubernetes/pathfinder/db-pvc.yml create mode 100644 kubernetes/pathfinder/db-svc.yml create mode 100644 kubernetes/pathfinder/deploy.yml create mode 100644 kubernetes/pathfinder/svc.yml diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index 60486a23..440620d2 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -9,319 +9,380 @@ on: - main jobs: - unit-test: - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [10.x, 12.x, 14.x] - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - name: Build - run: | - yarn install - yarn build - - name: Test - run: yarn test --coverage --watchAll=false - - uses: codecov/codecov-action@v1 - with: - flags: unitests + # unit-test: + # runs-on: ubuntu-latest + # strategy: + # matrix: + # node-version: [10.x, 12.x, 14.x] + # steps: + # - uses: actions/checkout@v2 + # - name: Use Node.js ${{ matrix.node-version }} + # uses: actions/setup-node@v1 + # with: + # node-version: ${{ matrix.node-version }} + # - name: Build + # run: | + # yarn install + # yarn build + # - name: Test + # run: yarn test --coverage --watchAll=false + # - uses: codecov/codecov-action@v1 + # with: + # flags: unitests + + # e2e: + # needs: [unit-test] + # runs-on: ${{ matrix.os }} + # strategy: + # matrix: + # os: [ubuntu-latest] + # browser: [chrome, firefox] + # services: + # keycloak: + # image: quay.io/keycloak/keycloak:12.0.2 + # ports: + # - 8180:8080 + # env: + # KEYCLOAK_USER: admin + # KEYCLOAK_PASSWORD: admin + # options: >- + # --health-cmd "curl --fail http://localhost:8080/auth || exit 1" + # --health-interval 10s + # --health-timeout 5s + # --health-retries 5 + # controls-db: + # image: postgres:13.1 + # ports: + # - 5433:5432 + # env: + # POSTGRES_USER: user + # POSTGRES_PASSWORD: password + # POSTGRES_DB: controls_db + # options: >- + # --health-cmd pg_isready + # --health-interval 10s + # --health-timeout 5s + # --health-retries 5 + # application-inventory-db: + # image: postgres:13.1 + # ports: + # - 5434:5432 + # env: + # POSTGRES_USER: user + # POSTGRES_PASSWORD: password + # POSTGRES_DB: application_inventory_db + # options: >- + # --health-cmd pg_isready + # --health-interval 10s + # --health-timeout 5s + # --health-retries 5 + # pathfinder-db: + # image: postgres:13.1 + # ports: + # - 5435:5432 + # env: + # POSTGRES_USER: user + # POSTGRES_PASSWORD: password + # POSTGRES_DB: pathfinder_db + # options: >- + # --health-cmd pg_isready + # --health-interval 10s + # --health-timeout 5s + # --health-retries 5 + # steps: + # - name: Checkout + # uses: actions/checkout@v2 + # - name: Keycloak Admin CLI + # uses: carlosthe19916/keycloak-action@0.4 + # with: + # server: http://keycloak:8080/auth + # username: admin + # password: admin + # kcadm: create realms -f konveyor-realm.json + # - name: Controls API + # run: | + # docker run -d --name controls --network ${{ job.services.controls-db.network }} --network-alias controls -p 8081:8080 \ + # -e QUARKUS_HTTP_PORT=8080 \ + # -e QUARKUS_DATASOURCE_USERNAME=user \ + # -e QUARKUS_DATASOURCE_PASSWORD=password \ + # -e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://controls-db:5432/controls_db \ + # -e QUARKUS_OIDC_AUTH_SERVER_URL=http://keycloak:8080/auth/realms/konveyor \ + # -e QUARKUS_OIDC_CLIENT_ID=controls-api \ + # -e QUARKUS_OIDC_CREDENTIALS_SECRET=secret quay.io/konveyor/tackle-controls:latest-native + # sleep 5s && docker logs controls + # - name: Application inventory API + # run: | + # docker run -d --name application-inventory --network ${{ job.services.application-inventory-db.network }} --network-alias application-inventory -p 8082:8080 \ + # -e QUARKUS_HTTP_PORT=8080 \ + # -e QUARKUS_DATASOURCE_USERNAME=user \ + # -e QUARKUS_DATASOURCE_PASSWORD=password \ + # -e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://application-inventory-db:5432/application_inventory_db \ + # -e QUARKUS_OIDC_AUTH_SERVER_URL=http://keycloak:8080/auth/realms/konveyor \ + # -e QUARKUS_OIDC_CLIENT_ID=application-inventory-api \ + # -e QUARKUS_OIDC_CREDENTIALS_SECRET=secret quay.io/konveyor/tackle-application-inventory:latest-native + # sleep 5s && docker logs application-inventory + # - name: Pathfinder API + # run: | + # docker run -d --name pathfinder --network ${{ job.services.pathfinder-db.network }} --network-alias pathfinder -p 8083:8080 \ + # -e QUARKUS_HTTP_PORT=8080 \ + # -e QUARKUS_DATASOURCE_USERNAME=user \ + # -e QUARKUS_DATASOURCE_PASSWORD=password \ + # -e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://pathfinder-db:5432/pathfinder_db \ + # -e QUARKUS_OIDC_AUTH_SERVER_URL=http://keycloak:8080/auth/realms/konveyor \ + # -e QUARKUS_OIDC_CLIENT_ID=pathfinder-api \ + # -e QUARKUS_OIDC_CREDENTIALS_SECRET=secret quay.io/konveyor/tackle-pathfinder:latest-native + # sleep 5s && docker logs pathfinder + # - name: Build + # run: | + # yarn install + # yarn build:instrumentation + # - name: Cypress run + # uses: cypress-io/github-action@v2 + # with: + # record: false + # start: yarn run ui:start + # wait-on: "http://localhost:3000" + # wait-on-timeout: 120 + # config: pageLoadTimeout=100000 + # browser: ${{ matrix.browser }} + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # - uses: actions/upload-artifact@v1 + # if: failure() + # with: + # name: e2e-screenshots-${{ matrix.os }}-${{ matrix.browser }} + # path: cypress/screenshots + # - uses: actions/upload-artifact@v1 + # if: always() + # with: + # name: e2e-videos-${{ matrix.os }}-${{ matrix.browser }} + # path: cypress/videos + # - uses: codecov/codecov-action@v1 + # with: + # flags: e2etests + + # container-images: + # if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'konveyor' }} + # runs-on: ubuntu-latest + # needs: [unit-test] + # steps: + # - uses: actions/checkout@v2 + # - name: Use Node.js + # uses: actions/setup-node@v1 + # with: + # node-version: 12.x + # - name: Build + # run: | + # yarn install + # yarn build + # - name: Push to Quay.io + # uses: elgohr/Publish-Docker-Github-Action@3.02 + # with: + # registry: quay.io + # name: konveyor/tackle-ui + # username: ${{ secrets.QUAYIO_USERNAME }} + # password: ${{ secrets.QUAYIO_PASSWORD }} + # dockerfile: Dockerfile + # snapshot: false + # tags: "main" + # buildoptions: "--pull" - e2e: - needs: [unit-test] + # test-container-images: + # needs: [container-images] + # runs-on: ubuntu-latest + # strategy: + # matrix: + # os: [ubuntu-latest] + # browser: [chrome, firefox] + # services: + # keycloak: + # image: quay.io/keycloak/keycloak:12.0.2 + # ports: + # - 8180:8080 + # env: + # KEYCLOAK_USER: admin + # KEYCLOAK_PASSWORD: admin + # options: >- + # --health-cmd "curl --fail http://localhost:8080/auth || exit 1" + # --health-interval 10s + # --health-timeout 5s + # --health-retries 5 + # controls-db: + # image: postgres:13.1 + # ports: + # - 5433:5432 + # env: + # POSTGRES_USER: user + # POSTGRES_PASSWORD: password + # POSTGRES_DB: controls_db + # options: >- + # --health-cmd pg_isready + # --health-interval 10s + # --health-timeout 5s + # --health-retries 5 + # application-inventory-db: + # image: postgres:13.1 + # ports: + # - 5434:5432 + # env: + # POSTGRES_USER: user + # POSTGRES_PASSWORD: password + # POSTGRES_DB: application_inventory_db + # options: >- + # --health-cmd pg_isready + # --health-interval 10s + # --health-timeout 5s + # --health-retries 5 + # pathfinder-db: + # image: postgres:13.1 + # ports: + # - 5435:5432 + # env: + # POSTGRES_USER: user + # POSTGRES_PASSWORD: password + # POSTGRES_DB: pathfinder_db + # options: >- + # --health-cmd pg_isready + # --health-interval 10s + # --health-timeout 5s + # --health-retries 5 + # steps: + # - uses: actions/checkout@v2 + # - name: Keycloak Admin CLI + # uses: carlosthe19916/keycloak-action@0.4 + # with: + # server: http://keycloak:8080/auth + # username: admin + # password: admin + # kcadm: create realms -f konveyor-realm.json + # - name: Controls API + # run: | + # docker run -d --name controls --network ${{ job.services.controls-db.network }} --network-alias controls -p 8081:8080 \ + # -e QUARKUS_HTTP_PORT=8080 \ + # -e QUARKUS_DATASOURCE_USERNAME=user \ + # -e QUARKUS_DATASOURCE_PASSWORD=password \ + # -e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://controls-db:5432/controls_db \ + # -e QUARKUS_OIDC_AUTH_SERVER_URL=http://keycloak:8080/auth/realms/konveyor \ + # -e QUARKUS_OIDC_CLIENT_ID=controls-api \ + # -e QUARKUS_OIDC_CREDENTIALS_SECRET=secret \ + # quay.io/konveyor/tackle-controls:latest-native + # sleep 5s && docker logs controls + # - name: Application inventory API + # run: | + # docker run -d --name application-inventory --network ${{ job.services.application-inventory-db.network }} --network-alias application-inventory -p 8082:8080 \ + # -e QUARKUS_HTTP_PORT=8080 \ + # -e QUARKUS_DATASOURCE_USERNAME=user \ + # -e QUARKUS_DATASOURCE_PASSWORD=password \ + # -e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://application-inventory-db:5432/application_inventory_db \ + # -e QUARKUS_OIDC_AUTH_SERVER_URL=http://keycloak:8080/auth/realms/konveyor \ + # -e QUARKUS_OIDC_CLIENT_ID=application-inventory-api \ + # -e QUARKUS_OIDC_CREDENTIALS_SECRET=secret \ + # quay.io/konveyor/tackle-application-inventory:latest-native + # sleep 5s && docker logs application-inventory + # - name: Pathfinder API + # run: | + # docker run -d --name pathfinder --network ${{ job.services.pathfinder-db.network }} --network-alias pathfinder -p 8083:8080 \ + # -e QUARKUS_HTTP_PORT=8080 \ + # -e QUARKUS_DATASOURCE_USERNAME=user \ + # -e QUARKUS_DATASOURCE_PASSWORD=password \ + # -e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://pathfinder-db:5432/application_inventory_db \ + # -e QUARKUS_OIDC_AUTH_SERVER_URL=http://keycloak:8080/auth/realms/konveyor \ + # -e QUARKUS_OIDC_CLIENT_ID=pathfinder-api \ + # -e QUARKUS_OIDC_CREDENTIALS_SECRET=secret \ + # quay.io/konveyor/tackle-pathfinder:latest-native + # sleep 5s && docker logs pathfinder + # - name: Tackle UI + # run: | + # docker run -d --name tackle-ui --network ${{ job.services.keycloak.network }} --network-alias tackle-ui -p 3000:8080 \ + # -e SSO_REALM=konveyor \ + # -e SSO_CLIENT_ID=tackle-ui \ + # -e SSO_SERVER_URL=http://keycloak:8080/auth \ + # -e CONTROLS_API_URL=http://controls:8080/controls \ + # -e APPLICATION_INVENTORY_API_URL=http://application-inventory:8080/application-inventory \ + # quay.io/konveyor/tackle-ui:main + # sleep 5s && docker logs tackle-ui + # - name: Cypress run + # uses: cypress-io/github-action@v2 + # with: + # record: false + # wait-on: "http://localhost:3000" + # wait-on-timeout: 120 + # config: pageLoadTimeout=100000 + # browser: ${{ matrix.browser }} + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # CYPRESS_auth_base_url: http://localhost:3000/auth + # CYPRESS_controls_base_url: http://localhost:8081/controls + # CYPRESS_application_inventory_base_url: http://localhost:8082/application-inventory + # CYPRESS_pathfinder_base_url: http://localhost:8083/pathfinder + # - uses: actions/upload-artifact@v1 + # if: failure() + # with: + # name: container-screenshots-${{ matrix.os }}-${{ matrix.browser }} + # path: cypress/screenshots + # - uses: actions/upload-artifact@v1 + # if: always() + # with: + # name: container-videos-${{ matrix.os }}-${{ matrix.browser }} + # path: cypress/videos + + e2e-ks8: runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest] - browser: [chrome, firefox] - services: - keycloak: - image: quay.io/keycloak/keycloak:12.0.2 - ports: - - 8180:8080 - env: - KEYCLOAK_USER: admin - KEYCLOAK_PASSWORD: admin - options: >- - --health-cmd "curl --fail http://localhost:8080/auth || exit 1" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - controls-db: - image: postgres:13.1 - ports: - - 5433:5432 - env: - POSTGRES_USER: user - POSTGRES_PASSWORD: password - POSTGRES_DB: controls_db - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - application-inventory-db: - image: postgres:13.1 - ports: - - 5434:5432 - env: - POSTGRES_USER: user - POSTGRES_PASSWORD: password - POSTGRES_DB: application_inventory_db - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - pathfinder-db: - image: postgres:13.1 - ports: - - 5435:5432 - env: - POSTGRES_USER: user - POSTGRES_PASSWORD: password - POSTGRES_DB: pathfinder_db - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 + browser: [chrome] steps: - name: Checkout uses: actions/checkout@v2 - - name: Keycloak Admin CLI - uses: carlosthe19916/keycloak-action@0.4 - with: - server: http://keycloak:8080/auth - username: admin - password: admin - kcadm: create realms -f konveyor-realm.json - - name: Controls API - run: | - docker run -d --name controls --network ${{ job.services.controls-db.network }} --network-alias controls -p 8081:8080 \ - -e QUARKUS_HTTP_PORT=8080 \ - -e QUARKUS_DATASOURCE_USERNAME=user \ - -e QUARKUS_DATASOURCE_PASSWORD=password \ - -e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://controls-db:5432/controls_db \ - -e QUARKUS_OIDC_AUTH_SERVER_URL=http://keycloak:8080/auth/realms/konveyor \ - -e QUARKUS_OIDC_CLIENT_ID=controls-api \ - -e QUARKUS_OIDC_CREDENTIALS_SECRET=secret quay.io/konveyor/tackle-controls:latest-native - sleep 5s && docker logs controls - - name: Application inventory API - run: | - docker run -d --name application-inventory --network ${{ job.services.application-inventory-db.network }} --network-alias application-inventory -p 8082:8080 \ - -e QUARKUS_HTTP_PORT=8080 \ - -e QUARKUS_DATASOURCE_USERNAME=user \ - -e QUARKUS_DATASOURCE_PASSWORD=password \ - -e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://application-inventory-db:5432/application_inventory_db \ - -e QUARKUS_OIDC_AUTH_SERVER_URL=http://keycloak:8080/auth/realms/konveyor \ - -e QUARKUS_OIDC_CLIENT_ID=application-inventory-api \ - -e QUARKUS_OIDC_CREDENTIALS_SECRET=secret quay.io/konveyor/tackle-application-inventory:latest-native - sleep 5s && docker logs application-inventory - - name: Pathfinder API - run: | - docker run -d --name pathfinder --network ${{ job.services.pathfinder-db.network }} --network-alias pathfinder -p 8083:8080 \ - -e QUARKUS_HTTP_PORT=8080 \ - -e QUARKUS_DATASOURCE_USERNAME=user \ - -e QUARKUS_DATASOURCE_PASSWORD=password \ - -e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://pathfinder-db:5432/pathfinder_db \ - -e QUARKUS_OIDC_AUTH_SERVER_URL=http://keycloak:8080/auth/realms/konveyor \ - -e QUARKUS_OIDC_CLIENT_ID=pathfinder-api \ - -e QUARKUS_OIDC_CREDENTIALS_SECRET=secret quay.io/konveyor/tackle-pathfinder:latest-native - sleep 5s && docker logs pathfinder - name: Build run: | yarn install yarn build:instrumentation - - name: Cypress run - uses: cypress-io/github-action@v2 - with: - record: false - start: yarn run ui:start - wait-on: "http://localhost:3000" - wait-on-timeout: 120 - config: pageLoadTimeout=100000 - browser: ${{ matrix.browser }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/upload-artifact@v1 - if: failure() - with: - name: e2e-screenshots-${{ matrix.os }}-${{ matrix.browser }} - path: cypress/screenshots - - uses: actions/upload-artifact@v1 - if: always() - with: - name: e2e-videos-${{ matrix.os }}-${{ matrix.browser }} - path: cypress/videos - - uses: codecov/codecov-action@v1 - with: - flags: e2etests - - container-images: - if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'konveyor' }} - runs-on: ubuntu-latest - needs: [unit-test] - steps: - - uses: actions/checkout@v2 - - name: Use Node.js - uses: actions/setup-node@v1 - with: - node-version: 12.x - - name: Build - run: | - yarn install - yarn build - - name: Push to Quay.io - uses: elgohr/Publish-Docker-Github-Action@3.02 + - name: Setup Minikube + uses: manusa/actions-setup-minikube@v2.3.1 with: - registry: quay.io - name: konveyor/tackle-ui - username: ${{ secrets.QUAYIO_USERNAME }} - password: ${{ secrets.QUAYIO_PASSWORD }} - dockerfile: Dockerfile - snapshot: false - tags: "main" - buildoptions: "--pull" - - test-container-images: - needs: [container-images] - runs-on: ubuntu-latest - strategy: - matrix: - os: [ubuntu-latest] - browser: [chrome, firefox] - services: - keycloak: - image: quay.io/keycloak/keycloak:12.0.2 - ports: - - 8180:8080 - env: - KEYCLOAK_USER: admin - KEYCLOAK_PASSWORD: admin - options: >- - --health-cmd "curl --fail http://localhost:8080/auth || exit 1" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - controls-db: - image: postgres:13.1 - ports: - - 5433:5432 - env: - POSTGRES_USER: user - POSTGRES_PASSWORD: password - POSTGRES_DB: controls_db - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - application-inventory-db: - image: postgres:13.1 - ports: - - 5434:5432 - env: - POSTGRES_USER: user - POSTGRES_PASSWORD: password - POSTGRES_DB: application_inventory_db - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - pathfinder-db: - image: postgres:13.1 - ports: - - 5435:5432 - env: - POSTGRES_USER: user - POSTGRES_PASSWORD: password - POSTGRES_DB: pathfinder_db - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - steps: - - uses: actions/checkout@v2 - - name: Keycloak Admin CLI - uses: carlosthe19916/keycloak-action@0.4 - with: - server: http://keycloak:8080/auth - username: admin - password: admin - kcadm: create realms -f konveyor-realm.json - - name: Controls API + minikube version: v1.17.1 + kubernetes version: v1.20.2 + driver: docker + start args: "--addons=registry --addons=ingress" + - name: Validate Minikube + run: minikube status | grep Running + - name: Validate Cluster + run: kubectl get nodes + - name: Validate enabled addon in arg + run: minikube addons list -o json | jq '.registry.Status' | grep enabled + - name: Kubectl create namespace + run: kubectl create ns tackle + - name: Deploy keycloak run: | - docker run -d --name controls --network ${{ job.services.controls-db.network }} --network-alias controls -p 8081:8080 \ - -e QUARKUS_HTTP_PORT=8080 \ - -e QUARKUS_DATASOURCE_USERNAME=user \ - -e QUARKUS_DATASOURCE_PASSWORD=password \ - -e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://controls-db:5432/controls_db \ - -e QUARKUS_OIDC_AUTH_SERVER_URL=http://keycloak:8080/auth/realms/konveyor \ - -e QUARKUS_OIDC_CLIENT_ID=controls-api \ - -e QUARKUS_OIDC_CREDENTIALS_SECRET=secret \ - quay.io/konveyor/tackle-controls:latest-native - sleep 5s && docker logs controls - - name: Application inventory API + kubectl create -f kubernetes/keycloak -n tackle + kubectl wait deployment/keycloak --for condition=available --timeout=-1s -n tackle + - name: Deploy tackle-controls run: | - docker run -d --name application-inventory --network ${{ job.services.application-inventory-db.network }} --network-alias application-inventory -p 8082:8080 \ - -e QUARKUS_HTTP_PORT=8080 \ - -e QUARKUS_DATASOURCE_USERNAME=user \ - -e QUARKUS_DATASOURCE_PASSWORD=password \ - -e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://application-inventory-db:5432/application_inventory_db \ - -e QUARKUS_OIDC_AUTH_SERVER_URL=http://keycloak:8080/auth/realms/konveyor \ - -e QUARKUS_OIDC_CLIENT_ID=application-inventory-api \ - -e QUARKUS_OIDC_CREDENTIALS_SECRET=secret \ - quay.io/konveyor/tackle-application-inventory:latest-native - sleep 5s && docker logs application-inventory - - name: Pathfinder API + kubectl create -f kubernetes/controls -n tackle + kubectl wait deployment/tackle-controls --for condition=available --timeout=-1s -n tackle + - name: Deploy tackle-application-inventory run: | - docker run -d --name pathfinder --network ${{ job.services.pathfinder-db.network }} --network-alias pathfinder -p 8083:8080 \ - -e QUARKUS_HTTP_PORT=8080 \ - -e QUARKUS_DATASOURCE_USERNAME=user \ - -e QUARKUS_DATASOURCE_PASSWORD=password \ - -e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://pathfinder-db:5432/application_inventory_db \ - -e QUARKUS_OIDC_AUTH_SERVER_URL=http://keycloak:8080/auth/realms/konveyor \ - -e QUARKUS_OIDC_CLIENT_ID=pathfinder-api \ - -e QUARKUS_OIDC_CREDENTIALS_SECRET=secret \ - quay.io/konveyor/tackle-pathfinder:latest-native - sleep 5s && docker logs pathfinder - - name: Tackle UI + kubectl create -f kubernetes/application-inventory -n tackle + kubectl wait deployment/tackle-application-inventory --for condition=available --timeout=-1s -n tackle + - name: Deploy tackle-pathfinder run: | - docker run -d --name tackle-ui --network ${{ job.services.keycloak.network }} --network-alias tackle-ui -p 3000:8080 \ - -e SSO_REALM=konveyor \ - -e SSO_CLIENT_ID=tackle-ui \ - -e SSO_SERVER_URL=http://keycloak:8080/auth \ - -e CONTROLS_API_URL=http://controls:8080/controls \ - -e APPLICATION_INVENTORY_API_URL=http://application-inventory:8080/application-inventory \ - quay.io/konveyor/tackle-ui:main - sleep 5s && docker logs tackle-ui + kubectl create -f kubernetes/pathfinder -n tackle + kubectl wait deployment/tackle-pathfinder --for condition=available --timeout=-1s -n tackle + - name: Kubectl create ingress + run: kubectl create -f kubernetes/ing.yml -n tackle + - name: Wait for Ingress + run: bash -c 'external_ip=""; while [ -z $external_ip ]; do echo "Waiting for end point..."; external_ip=$(kubectl get ingress tackle --template="{{range .status.loadBalancer.ingress}}{{.ip}}{{end}}" -n tackle); [ -z "$external_ip" ] && sleep 10; done; echo "End point ready-" && echo $external_ip; export endpoint=$external_ip; export SSO_URL=https://$external_ip/auth; envsubst '${SSO_URL}' < ./build/keycloak.json.k8s.template > ./build/keycloak.json; echo "TACKLE_CONTROLS_HOST=https://$external_ip" >> $GITHUB_ENV && echo "TACKLE_APPLICATION_INVENTORY_HOST=https://$external_ip" >> $GITHUB_ENV && echo "TACKLE_PATHFINDER_HOST=https://$external_ip" >> $GITHUB_ENV && echo "CYPRESS_controls_base_url=https://$external_ip/controls" >> $GITHUB_ENV && echo "CYPRESS_application_inventory_base_url=https://$external_ip/application-inventory" >> $GITHUB_ENV && echo "CYPRESS_pathfinder_base_url=https://$external_ip/pathfinder" >> $GITHUB_ENV && echo "CYPRESS_auth_base_url=https://$external_ip/auth" >> $GITHUB_ENV' - name: Cypress run uses: cypress-io/github-action@v2 with: record: false + start: yarn run ui:start wait-on: "http://localhost:3000" wait-on-timeout: 120 config: pageLoadTimeout=100000 browser: ${{ matrix.browser }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CYPRESS_auth_base_url: http://localhost:3000/auth - CYPRESS_controls_base_url: http://localhost:8081/controls - CYPRESS_application_inventory_base_url: http://localhost:8082/application-inventory - CYPRESS_pathfinder_base_url: http://localhost:8083/pathfinder - - uses: actions/upload-artifact@v1 - if: failure() - with: - name: container-screenshots-${{ matrix.os }}-${{ matrix.browser }} - path: cypress/screenshots - - uses: actions/upload-artifact@v1 - if: always() - with: - name: container-videos-${{ matrix.os }}-${{ matrix.browser }} - path: cypress/videos + \ No newline at end of file diff --git a/kubernetes/pathfinder/db-deploy.yml b/kubernetes/pathfinder/db-deploy.yml new file mode 100644 index 00000000..8bfc92f2 --- /dev/null +++ b/kubernetes/pathfinder/db-deploy.yml @@ -0,0 +1,84 @@ +kind: Deployment +apiVersion: apps/v1 +metadata: + name: pathfinder-db + labels: + app.kubernetes.io/name: pathfinder-db + app.kubernetes.io/version: "10.6" + app.kubernetes.io/component: database + app.kubernetes.io/instance: pathfinder-db + app.kubernetes.io/part-of: tackle +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: pathfinder-db + app.kubernetes.io/version: "10.6" + template: + metadata: + labels: + app.kubernetes.io/name: pathfinder-db + app.kubernetes.io/version: "10.6" + spec: + volumes: + - name: pathfinder-db-data + persistentVolumeClaim: + claimName: pathfinder-db + containers: + - name: postgres + image: postgres:10.6 + ports: + - containerPort: 5432 + protocol: TCP + env: + - name: POSTGRES_USER + value: pathfinder_username + - name: POSTGRES_PASSWORD + value: pathfinder_password + - name: POSTGRES_DB + value: pathfinder_db + resources: {} + livenessProbe: + exec: + command: + - /bin/sh + - "-c" + - | + psql -U $POSTGRES_USER -d $POSTGRES_DB -c 'SELECT 1' + initialDelaySeconds: 60 + timeoutSeconds: 10 + periodSeconds: 10 + successThreshold: 1 + failureThreshold: 3 + readinessProbe: + exec: + command: + - /bin/sh + - "-c" + - | + psql -U $POSTGRES_USER -d $POSTGRES_DB -c 'SELECT 1' + initialDelaySeconds: 10 + timeoutSeconds: 1 + periodSeconds: 10 + successThreshold: 1 + failureThreshold: 3 + terminationMessagePath: "/dev/termination-log" + terminationMessagePolicy: File + imagePullPolicy: IfNotPresent + volumeMounts: + - name: pathfinder-db-data + mountPath: "/var/lib/db" + securityContext: + privileged: false + restartPolicy: Always + terminationGracePeriodSeconds: 30 + dnsPolicy: ClusterFirst + securityContext: {} + schedulerName: default-scheduler + strategy: + type: RollingUpdate + rollingUpdate: + maxUnavailable: 25% + maxSurge: 25% + revisionHistoryLimit: 10 + progressDeadlineSeconds: 600 diff --git a/kubernetes/pathfinder/db-pvc.yml b/kubernetes/pathfinder/db-pvc.yml new file mode 100644 index 00000000..24e19733 --- /dev/null +++ b/kubernetes/pathfinder/db-pvc.yml @@ -0,0 +1,16 @@ +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: pathfinder-db + labels: + app.kubernetes.io/name: pathfinder-db + app.kubernetes.io/component: database + app.kubernetes.io/instance: pathfinder-db + app.kubernetes.io/part-of: tackle +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi + volumeMode: Filesystem \ No newline at end of file diff --git a/kubernetes/pathfinder/db-svc.yml b/kubernetes/pathfinder/db-svc.yml new file mode 100644 index 00000000..7e441cd5 --- /dev/null +++ b/kubernetes/pathfinder/db-svc.yml @@ -0,0 +1,21 @@ +kind: Service +apiVersion: v1 +metadata: + name: pathfinder-db + labels: + app.kubernetes.io/name: pathfinder-db + app.kubernetes.io/version: "10.6" + app.kubernetes.io/component: database + app.kubernetes.io/instance: pathfinder-db + app.kubernetes.io/part-of: tackle +spec: + ports: + - name: tcp + protocol: TCP + port: 5432 + targetPort: 5432 + selector: + app.kubernetes.io/name: pathfinder-db + app.kubernetes.io/version: "10.6" + type: ClusterIP + sessionAffinity: None diff --git a/kubernetes/pathfinder/deploy.yml b/kubernetes/pathfinder/deploy.yml new file mode 100644 index 00000000..18ed2de7 --- /dev/null +++ b/kubernetes/pathfinder/deploy.yml @@ -0,0 +1,77 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + annotations: + prometheus.io/port: "8080" + prometheus.io/scheme: http + prometheus.io/scrape: "true" + prometheus.io/path: "/q/metrics" + labels: + app.kubernetes.io/component: rest + app.kubernetes.io/name: tackle-pathfinder + app.kubernetes.io/part-of: tackle + name: tackle-pathfinder +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: tackle-pathfinder + app.kubernetes.io/part-of: tackle + template: + metadata: + annotations: + prometheus.io/port: "8080" + prometheus.io/scheme: http + prometheus.io/scrape: "true" + prometheus.io/path: "/q/metrics" + labels: + app.kubernetes.io/component: rest + app.kubernetes.io/name: tackle-pathfinder + app.kubernetes.io/part-of: tackle + spec: + containers: + - env: + - name: KUBERNETES_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: QUARKUS_DATASOURCE_USERNAME + value: pathfinder_username + - name: QUARKUS_DATASOURCE_PASSWORD + value: pathfinder_password + - name: QUARKUS_DATASOURCE_JDBC_URL + value: jdbc:postgresql://pathfinder-db:5432/pathfinder_db + - name: QUARKUS_OIDC_AUTH_SERVER_URL + value: http://keycloak:8080/auth/realms/konveyor + - name: QUARKUS_OIDC_CLIENT_ID + value: pathfinder-api + - name: QUARKUS_OIDC_CREDENTIALS_SECRET + value: secret + image: quay.io/konveyor/tackle-pathfinder:latest-native + imagePullPolicy: Always + livenessProbe: + failureThreshold: 3 + httpGet: + path: "/pathfinder/q/health/live" + port: 8080 + scheme: HTTP + initialDelaySeconds: 0 + periodSeconds: 30 + successThreshold: 1 + timeoutSeconds: 10 + name: tackle-pathfinder + ports: + - containerPort: 8080 + name: http + protocol: TCP + readinessProbe: + failureThreshold: 3 + httpGet: + path: "/pathfinder/q/health/ready" + port: 8080 + scheme: HTTP + initialDelaySeconds: 0 + periodSeconds: 30 + successThreshold: 1 + timeoutSeconds: 10 + resources: {} diff --git a/kubernetes/pathfinder/svc.yml b/kubernetes/pathfinder/svc.yml new file mode 100644 index 00000000..5c4c3310 --- /dev/null +++ b/kubernetes/pathfinder/svc.yml @@ -0,0 +1,23 @@ +apiVersion: v1 +kind: Service +metadata: + annotations: + prometheus.io/scheme: http + prometheus.io/scrape: 'true' + prometheus.io/path: "/q/metrics" + prometheus.io/port: '8080' + labels: + app.kubernetes.io/name: tackle-pathfinder + app.kubernetes.io/part-of: tackle + app.kubernetes.io/component: rest + app.openshift.io/runtime: quarkus + name: tackle-pathfinder +spec: + ports: + - name: http + port: 8080 + targetPort: 8080 + selector: + app.kubernetes.io/name: tackle-pathfinder + app.kubernetes.io/part-of: tackle + type: ClusterIP \ No newline at end of file diff --git a/public/keycloak.json b/public/keycloak.json index 35df1f3d..dde90ff0 100644 --- a/public/keycloak.json +++ b/public/keycloak.json @@ -1,6 +1,6 @@ { "realm": "konveyor", - "auth-server-url": "http://192.168.99.113/auth", + "auth-server-url": "http://localhost:8180/auth/", "resource": "tackle-ui", "public-client": true } diff --git a/src/setupProxy.js b/src/setupProxy.js index bdad1e35..986567d6 100644 --- a/src/setupProxy.js +++ b/src/setupProxy.js @@ -4,11 +4,8 @@ const TACKLE_CONTROLS_HOST = process.env.TACKLE_CONTROLS_HOST || "http://localhost:8081"; const TACKLE_APPLICATION_INVENTORY_HOST = process.env.TACKLE_APPLICATION_INVENTORY_HOST || "http://localhost:8082"; - -console.log("Using TACKLE_CONTROLS_HOST=" + TACKLE_CONTROLS_HOST); -console.log( - "Using TACKLE_APPLICATION_INVENTORY_HOST=" + TACKLE_APPLICATION_INVENTORY_HOST -); +const TACKLE_PATHFINDER_HOST = + process.env.TACKLE_PATHFINDER_HOST || "http://localhost:8083"; module.exports = function (app) { app.use( @@ -38,7 +35,8 @@ module.exports = function (app) { app.use( "/api/pathfinder", createProxyMiddleware({ - target: "http://localhost:8083", + target: TACKLE_PATHFINDER_HOST, + secure: false, changeOrigin: true, pathRewrite: { "^/api/pathfinder": "/pathfinder", From b2c73587fe5bb1b8eeaa111e3b206b22ffbe9ca0 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Wed, 7 Apr 2021 17:55:12 +0200 Subject: [PATCH 23/43] Test minikube --- .github/workflows/ci-actions.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index 440620d2..7336e457 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - minikube pull_request: branches: - main From bfb91d282cdaaaf5ba3ce35d6cd2afe494fd83ef Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Wed, 7 Apr 2021 18:16:23 +0200 Subject: [PATCH 24/43] Add pathfinder to the ingress --- kubernetes/ing.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kubernetes/ing.yml b/kubernetes/ing.yml index f22e5f9f..000308bd 100644 --- a/kubernetes/ing.yml +++ b/kubernetes/ing.yml @@ -32,3 +32,10 @@ spec: name: tackle-application-inventory port: number: 8080 + - path: /pathfinder + pathType: ImplementationSpecific + backend: + service: + name: tackle-pathfinder + port: + number: 8080 From 471d4889bceb2dad407efe445c8e5384f29d5b3b Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Wed, 7 Apr 2021 18:28:52 +0200 Subject: [PATCH 25/43] Add pathfinder --- kubernetes/ui/deploy.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kubernetes/ui/deploy.yml b/kubernetes/ui/deploy.yml index 29a6639b..e821fb97 100644 --- a/kubernetes/ui/deploy.yml +++ b/kubernetes/ui/deploy.yml @@ -34,6 +34,8 @@ spec: value: "http://tackle-controls:8080" - name: APPLICATION_INVENTORY_API_URL value: "http://tackle-application-inventory:8080" + - name: PATHFINDER_API_URL + value: "http://tackle-pathfinder:8080" - name: SSO_REALM value: quarkus - name: SSO_CLIENT_ID From 53ea92ccf0eab9efe3d4e729f55625b12126b7d6 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Wed, 7 Apr 2021 21:04:22 +0200 Subject: [PATCH 26/43] Format script --- .github/workflows/ci-actions.yml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index 7336e457..3cb38ee4 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -374,7 +374,25 @@ jobs: - name: Kubectl create ingress run: kubectl create -f kubernetes/ing.yml -n tackle - name: Wait for Ingress - run: bash -c 'external_ip=""; while [ -z $external_ip ]; do echo "Waiting for end point..."; external_ip=$(kubectl get ingress tackle --template="{{range .status.loadBalancer.ingress}}{{.ip}}{{end}}" -n tackle); [ -z "$external_ip" ] && sleep 10; done; echo "End point ready-" && echo $external_ip; export endpoint=$external_ip; export SSO_URL=https://$external_ip/auth; envsubst '${SSO_URL}' < ./build/keycloak.json.k8s.template > ./build/keycloak.json; echo "TACKLE_CONTROLS_HOST=https://$external_ip" >> $GITHUB_ENV && echo "TACKLE_APPLICATION_INVENTORY_HOST=https://$external_ip" >> $GITHUB_ENV && echo "TACKLE_PATHFINDER_HOST=https://$external_ip" >> $GITHUB_ENV && echo "CYPRESS_controls_base_url=https://$external_ip/controls" >> $GITHUB_ENV && echo "CYPRESS_application_inventory_base_url=https://$external_ip/application-inventory" >> $GITHUB_ENV && echo "CYPRESS_pathfinder_base_url=https://$external_ip/pathfinder" >> $GITHUB_ENV && echo "CYPRESS_auth_base_url=https://$external_ip/auth" >> $GITHUB_ENV' + run: | + bash -c 'external_ip=""; + while [ -z $external_ip ]; + do echo "Waiting for end point..."; + external_ip=$(kubectl get ingress tackle --template="{{range .status.loadBalancer.ingress}}{{.ip}}{{end}}" -n tackle);[ -z "$external_ip" ] && + sleep 10; + done; + echo "End point ready:" && + echo $external_ip; + export endpoint=$external_ip; + export SSO_URL=https://$external_ip/auth; + envsubst '${SSO_URL}' < ./build/keycloak.json.k8s.template > ./build/keycloak.json; + echo "TACKLE_CONTROLS_HOST=https://$external_ip" >> $GITHUB_ENV && + echo "TACKLE_APPLICATION_INVENTORY_HOST=https://$external_ip" >> $GITHUB_ENV && + echo "TACKLE_PATHFINDER_HOST=https://$external_ip" >> $GITHUB_ENV && + echo "CYPRESS_controls_base_url=https://$external_ip/controls" >>$GITHUB_ENV && + echo "CYPRESS_application_inventory_base_url=https://$external_ip/application-inventory" >> $GITHUB_ENV && + echo "CYPRESS_pathfinder_base_url=https://$external_ip/pathfinder" >> $GITHUB_ENV && + echo "CYPRESS_auth_base_url=https://$external_ip/auth" >> $GITHUB_ENV' - name: Cypress run uses: cypress-io/github-action@v2 with: @@ -386,4 +404,3 @@ jobs: browser: ${{ matrix.browser }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - \ No newline at end of file From 1dfae1c139f63f96063c805ee1778fa97455a575 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Wed, 7 Apr 2021 21:08:43 +0200 Subject: [PATCH 27/43] Build --- .github/workflows/ci-actions.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index 3cb38ee4..fdff938e 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -335,11 +335,7 @@ jobs: browser: [chrome] steps: - name: Checkout - uses: actions/checkout@v2 - - name: Build - run: | - yarn install - yarn build:instrumentation + uses: actions/checkout@v2 - name: Setup Minikube uses: manusa/actions-setup-minikube@v2.3.1 with: @@ -373,6 +369,10 @@ jobs: kubectl wait deployment/tackle-pathfinder --for condition=available --timeout=-1s -n tackle - name: Kubectl create ingress run: kubectl create -f kubernetes/ing.yml -n tackle + - name: Build UI + run: | + yarn install + yarn build:instrumentation - name: Wait for Ingress run: | bash -c 'external_ip=""; From a7e2988ce463e0205e77ee55dbe2cd9af3df8514 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Wed, 7 Apr 2021 21:27:39 +0200 Subject: [PATCH 28/43] change driver --- .github/workflows/ci-actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index fdff938e..c2f14958 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -341,7 +341,7 @@ jobs: with: minikube version: v1.17.1 kubernetes version: v1.20.2 - driver: docker + # driver: docker start args: "--addons=registry --addons=ingress" - name: Validate Minikube run: minikube status | grep Running From 2430d20fa67aae920ff2951ffc16e0fd8c272a63 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Wed, 7 Apr 2021 21:33:52 +0200 Subject: [PATCH 29/43] Change minikube version --- .github/workflows/ci-actions.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index c2f14958..c7fc5c38 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -336,12 +336,18 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + # - name: Setup Minikube + # uses: manusa/actions-setup-minikube@v2.3.1 + # with: + # minikube version: v1.17.1 + # kubernetes version: v1.20.2 + # driver: docker + # start args: "--addons=registry --addons=ingress" - name: Setup Minikube uses: manusa/actions-setup-minikube@v2.3.1 with: - minikube version: v1.17.1 + minikube version: v1.18.1 kubernetes version: v1.20.2 - # driver: docker start args: "--addons=registry --addons=ingress" - name: Validate Minikube run: minikube status | grep Running From e6088bfd0849a7dc6469690287dbe1ef3c96fdc0 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Wed, 7 Apr 2021 22:47:13 +0200 Subject: [PATCH 30/43] Restore actions --- .github/workflows/ci-actions.yml | 633 ++++++++++++++++--------------- kubernetes/ing1.yml | 20 + kubernetes/{ing.yml => ing2.yml} | 0 kubernetes/keycloak/cm.yml | 6 +- kubernetes/start-minikube.sh | 5 - kubernetes/ui/deploy.yml | 2 +- 6 files changed, 340 insertions(+), 326 deletions(-) create mode 100644 kubernetes/ing1.yml rename kubernetes/{ing.yml => ing2.yml} (100%) delete mode 100755 kubernetes/start-minikube.sh diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index c7fc5c38..b9f8799d 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -10,332 +10,333 @@ on: - main jobs: - # unit-test: - # runs-on: ubuntu-latest - # strategy: - # matrix: - # node-version: [10.x, 12.x, 14.x] - # steps: - # - uses: actions/checkout@v2 - # - name: Use Node.js ${{ matrix.node-version }} - # uses: actions/setup-node@v1 - # with: - # node-version: ${{ matrix.node-version }} - # - name: Build - # run: | - # yarn install - # yarn build - # - name: Test - # run: yarn test --coverage --watchAll=false - # - uses: codecov/codecov-action@v1 - # with: - # flags: unitests + unit-test: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [10.x, 12.x, 14.x] + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: Build + run: | + yarn install + yarn build + - name: Test + run: yarn test --coverage --watchAll=false + - uses: codecov/codecov-action@v1 + with: + flags: unitests - # e2e: - # needs: [unit-test] - # runs-on: ${{ matrix.os }} - # strategy: - # matrix: - # os: [ubuntu-latest] - # browser: [chrome, firefox] - # services: - # keycloak: - # image: quay.io/keycloak/keycloak:12.0.2 - # ports: - # - 8180:8080 - # env: - # KEYCLOAK_USER: admin - # KEYCLOAK_PASSWORD: admin - # options: >- - # --health-cmd "curl --fail http://localhost:8080/auth || exit 1" - # --health-interval 10s - # --health-timeout 5s - # --health-retries 5 - # controls-db: - # image: postgres:13.1 - # ports: - # - 5433:5432 - # env: - # POSTGRES_USER: user - # POSTGRES_PASSWORD: password - # POSTGRES_DB: controls_db - # options: >- - # --health-cmd pg_isready - # --health-interval 10s - # --health-timeout 5s - # --health-retries 5 - # application-inventory-db: - # image: postgres:13.1 - # ports: - # - 5434:5432 - # env: - # POSTGRES_USER: user - # POSTGRES_PASSWORD: password - # POSTGRES_DB: application_inventory_db - # options: >- - # --health-cmd pg_isready - # --health-interval 10s - # --health-timeout 5s - # --health-retries 5 - # pathfinder-db: - # image: postgres:13.1 - # ports: - # - 5435:5432 - # env: - # POSTGRES_USER: user - # POSTGRES_PASSWORD: password - # POSTGRES_DB: pathfinder_db - # options: >- - # --health-cmd pg_isready - # --health-interval 10s - # --health-timeout 5s - # --health-retries 5 - # steps: - # - name: Checkout - # uses: actions/checkout@v2 - # - name: Keycloak Admin CLI - # uses: carlosthe19916/keycloak-action@0.4 - # with: - # server: http://keycloak:8080/auth - # username: admin - # password: admin - # kcadm: create realms -f konveyor-realm.json - # - name: Controls API - # run: | - # docker run -d --name controls --network ${{ job.services.controls-db.network }} --network-alias controls -p 8081:8080 \ - # -e QUARKUS_HTTP_PORT=8080 \ - # -e QUARKUS_DATASOURCE_USERNAME=user \ - # -e QUARKUS_DATASOURCE_PASSWORD=password \ - # -e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://controls-db:5432/controls_db \ - # -e QUARKUS_OIDC_AUTH_SERVER_URL=http://keycloak:8080/auth/realms/konveyor \ - # -e QUARKUS_OIDC_CLIENT_ID=controls-api \ - # -e QUARKUS_OIDC_CREDENTIALS_SECRET=secret quay.io/konveyor/tackle-controls:latest-native - # sleep 5s && docker logs controls - # - name: Application inventory API - # run: | - # docker run -d --name application-inventory --network ${{ job.services.application-inventory-db.network }} --network-alias application-inventory -p 8082:8080 \ - # -e QUARKUS_HTTP_PORT=8080 \ - # -e QUARKUS_DATASOURCE_USERNAME=user \ - # -e QUARKUS_DATASOURCE_PASSWORD=password \ - # -e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://application-inventory-db:5432/application_inventory_db \ - # -e QUARKUS_OIDC_AUTH_SERVER_URL=http://keycloak:8080/auth/realms/konveyor \ - # -e QUARKUS_OIDC_CLIENT_ID=application-inventory-api \ - # -e QUARKUS_OIDC_CREDENTIALS_SECRET=secret quay.io/konveyor/tackle-application-inventory:latest-native - # sleep 5s && docker logs application-inventory - # - name: Pathfinder API - # run: | - # docker run -d --name pathfinder --network ${{ job.services.pathfinder-db.network }} --network-alias pathfinder -p 8083:8080 \ - # -e QUARKUS_HTTP_PORT=8080 \ - # -e QUARKUS_DATASOURCE_USERNAME=user \ - # -e QUARKUS_DATASOURCE_PASSWORD=password \ - # -e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://pathfinder-db:5432/pathfinder_db \ - # -e QUARKUS_OIDC_AUTH_SERVER_URL=http://keycloak:8080/auth/realms/konveyor \ - # -e QUARKUS_OIDC_CLIENT_ID=pathfinder-api \ - # -e QUARKUS_OIDC_CREDENTIALS_SECRET=secret quay.io/konveyor/tackle-pathfinder:latest-native - # sleep 5s && docker logs pathfinder - # - name: Build - # run: | - # yarn install - # yarn build:instrumentation - # - name: Cypress run - # uses: cypress-io/github-action@v2 - # with: - # record: false - # start: yarn run ui:start - # wait-on: "http://localhost:3000" - # wait-on-timeout: 120 - # config: pageLoadTimeout=100000 - # browser: ${{ matrix.browser }} - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # - uses: actions/upload-artifact@v1 - # if: failure() - # with: - # name: e2e-screenshots-${{ matrix.os }}-${{ matrix.browser }} - # path: cypress/screenshots - # - uses: actions/upload-artifact@v1 - # if: always() - # with: - # name: e2e-videos-${{ matrix.os }}-${{ matrix.browser }} - # path: cypress/videos - # - uses: codecov/codecov-action@v1 - # with: - # flags: e2etests + e2e: + needs: [unit-test] + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + browser: [chrome, firefox] + services: + keycloak: + image: quay.io/keycloak/keycloak:12.0.2 + ports: + - 8180:8080 + env: + KEYCLOAK_USER: admin + KEYCLOAK_PASSWORD: admin + options: >- + --health-cmd "curl --fail http://localhost:8080/auth || exit 1" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + controls-db: + image: postgres:13.1 + ports: + - 5433:5432 + env: + POSTGRES_USER: user + POSTGRES_PASSWORD: password + POSTGRES_DB: controls_db + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + application-inventory-db: + image: postgres:13.1 + ports: + - 5434:5432 + env: + POSTGRES_USER: user + POSTGRES_PASSWORD: password + POSTGRES_DB: application_inventory_db + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + pathfinder-db: + image: postgres:13.1 + ports: + - 5435:5432 + env: + POSTGRES_USER: user + POSTGRES_PASSWORD: password + POSTGRES_DB: pathfinder_db + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Keycloak Admin CLI + uses: carlosthe19916/keycloak-action@0.4 + with: + server: http://keycloak:8080/auth + username: admin + password: admin + kcadm: create realms -f konveyor-realm.json + - name: Controls API + run: | + docker run -d --name controls --network ${{ job.services.controls-db.network }} --network-alias controls -p 8081:8080 \ + -e QUARKUS_HTTP_PORT=8080 \ + -e QUARKUS_DATASOURCE_USERNAME=user \ + -e QUARKUS_DATASOURCE_PASSWORD=password \ + -e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://controls-db:5432/controls_db \ + -e QUARKUS_OIDC_AUTH_SERVER_URL=http://keycloak:8080/auth/realms/konveyor \ + -e QUARKUS_OIDC_CLIENT_ID=controls-api \ + -e QUARKUS_OIDC_CREDENTIALS_SECRET=secret quay.io/konveyor/tackle-controls:latest-native + sleep 5s && docker logs controls + - name: Application inventory API + run: | + docker run -d --name application-inventory --network ${{ job.services.application-inventory-db.network }} --network-alias application-inventory -p 8082:8080 \ + -e QUARKUS_HTTP_PORT=8080 \ + -e QUARKUS_DATASOURCE_USERNAME=user \ + -e QUARKUS_DATASOURCE_PASSWORD=password \ + -e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://application-inventory-db:5432/application_inventory_db \ + -e QUARKUS_OIDC_AUTH_SERVER_URL=http://keycloak:8080/auth/realms/konveyor \ + -e QUARKUS_OIDC_CLIENT_ID=application-inventory-api \ + -e QUARKUS_OIDC_CREDENTIALS_SECRET=secret quay.io/konveyor/tackle-application-inventory:latest-native + sleep 5s && docker logs application-inventory + - name: Pathfinder API + run: | + docker run -d --name pathfinder --network ${{ job.services.pathfinder-db.network }} --network-alias pathfinder -p 8083:8080 \ + -e QUARKUS_HTTP_PORT=8080 \ + -e QUARKUS_DATASOURCE_USERNAME=user \ + -e QUARKUS_DATASOURCE_PASSWORD=password \ + -e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://pathfinder-db:5432/pathfinder_db \ + -e QUARKUS_OIDC_AUTH_SERVER_URL=http://keycloak:8080/auth/realms/konveyor \ + -e QUARKUS_OIDC_CLIENT_ID=pathfinder-api \ + -e QUARKUS_OIDC_CREDENTIALS_SECRET=secret quay.io/konveyor/tackle-pathfinder:latest-native + sleep 5s && docker logs pathfinder + - name: Build + run: | + yarn install + yarn build:instrumentation + - name: Cypress run + uses: cypress-io/github-action@v2 + with: + record: false + start: yarn run ui:start + wait-on: "http://localhost:3000" + wait-on-timeout: 120 + config: pageLoadTimeout=100000 + browser: ${{ matrix.browser }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/upload-artifact@v1 + if: failure() + with: + name: e2e-screenshots-${{ matrix.os }}-${{ matrix.browser }} + path: cypress/screenshots + - uses: actions/upload-artifact@v1 + if: always() + with: + name: e2e-videos-${{ matrix.os }}-${{ matrix.browser }} + path: cypress/videos + - uses: codecov/codecov-action@v1 + with: + flags: e2etests - # container-images: - # if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'konveyor' }} - # runs-on: ubuntu-latest - # needs: [unit-test] - # steps: - # - uses: actions/checkout@v2 - # - name: Use Node.js - # uses: actions/setup-node@v1 - # with: - # node-version: 12.x - # - name: Build - # run: | - # yarn install - # yarn build - # - name: Push to Quay.io - # uses: elgohr/Publish-Docker-Github-Action@3.02 - # with: - # registry: quay.io - # name: konveyor/tackle-ui - # username: ${{ secrets.QUAYIO_USERNAME }} - # password: ${{ secrets.QUAYIO_PASSWORD }} - # dockerfile: Dockerfile - # snapshot: false - # tags: "main" - # buildoptions: "--pull" + container-images: + if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'konveyor' }} + runs-on: ubuntu-latest + needs: [unit-test] + steps: + - uses: actions/checkout@v2 + - name: Use Node.js + uses: actions/setup-node@v1 + with: + node-version: 12.x + - name: Build + run: | + yarn install + yarn build + - name: Push to Quay.io + uses: elgohr/Publish-Docker-Github-Action@3.02 + with: + registry: quay.io + name: konveyor/tackle-ui + username: ${{ secrets.QUAYIO_USERNAME }} + password: ${{ secrets.QUAYIO_PASSWORD }} + dockerfile: Dockerfile + snapshot: false + tags: "main" + buildoptions: "--pull" - # test-container-images: - # needs: [container-images] - # runs-on: ubuntu-latest - # strategy: - # matrix: - # os: [ubuntu-latest] - # browser: [chrome, firefox] - # services: - # keycloak: - # image: quay.io/keycloak/keycloak:12.0.2 - # ports: - # - 8180:8080 - # env: - # KEYCLOAK_USER: admin - # KEYCLOAK_PASSWORD: admin - # options: >- - # --health-cmd "curl --fail http://localhost:8080/auth || exit 1" - # --health-interval 10s - # --health-timeout 5s - # --health-retries 5 - # controls-db: - # image: postgres:13.1 - # ports: - # - 5433:5432 - # env: - # POSTGRES_USER: user - # POSTGRES_PASSWORD: password - # POSTGRES_DB: controls_db - # options: >- - # --health-cmd pg_isready - # --health-interval 10s - # --health-timeout 5s - # --health-retries 5 - # application-inventory-db: - # image: postgres:13.1 - # ports: - # - 5434:5432 - # env: - # POSTGRES_USER: user - # POSTGRES_PASSWORD: password - # POSTGRES_DB: application_inventory_db - # options: >- - # --health-cmd pg_isready - # --health-interval 10s - # --health-timeout 5s - # --health-retries 5 - # pathfinder-db: - # image: postgres:13.1 - # ports: - # - 5435:5432 - # env: - # POSTGRES_USER: user - # POSTGRES_PASSWORD: password - # POSTGRES_DB: pathfinder_db - # options: >- - # --health-cmd pg_isready - # --health-interval 10s - # --health-timeout 5s - # --health-retries 5 - # steps: - # - uses: actions/checkout@v2 - # - name: Keycloak Admin CLI - # uses: carlosthe19916/keycloak-action@0.4 - # with: - # server: http://keycloak:8080/auth - # username: admin - # password: admin - # kcadm: create realms -f konveyor-realm.json - # - name: Controls API - # run: | - # docker run -d --name controls --network ${{ job.services.controls-db.network }} --network-alias controls -p 8081:8080 \ - # -e QUARKUS_HTTP_PORT=8080 \ - # -e QUARKUS_DATASOURCE_USERNAME=user \ - # -e QUARKUS_DATASOURCE_PASSWORD=password \ - # -e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://controls-db:5432/controls_db \ - # -e QUARKUS_OIDC_AUTH_SERVER_URL=http://keycloak:8080/auth/realms/konveyor \ - # -e QUARKUS_OIDC_CLIENT_ID=controls-api \ - # -e QUARKUS_OIDC_CREDENTIALS_SECRET=secret \ - # quay.io/konveyor/tackle-controls:latest-native - # sleep 5s && docker logs controls - # - name: Application inventory API - # run: | - # docker run -d --name application-inventory --network ${{ job.services.application-inventory-db.network }} --network-alias application-inventory -p 8082:8080 \ - # -e QUARKUS_HTTP_PORT=8080 \ - # -e QUARKUS_DATASOURCE_USERNAME=user \ - # -e QUARKUS_DATASOURCE_PASSWORD=password \ - # -e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://application-inventory-db:5432/application_inventory_db \ - # -e QUARKUS_OIDC_AUTH_SERVER_URL=http://keycloak:8080/auth/realms/konveyor \ - # -e QUARKUS_OIDC_CLIENT_ID=application-inventory-api \ - # -e QUARKUS_OIDC_CREDENTIALS_SECRET=secret \ - # quay.io/konveyor/tackle-application-inventory:latest-native - # sleep 5s && docker logs application-inventory - # - name: Pathfinder API - # run: | - # docker run -d --name pathfinder --network ${{ job.services.pathfinder-db.network }} --network-alias pathfinder -p 8083:8080 \ - # -e QUARKUS_HTTP_PORT=8080 \ - # -e QUARKUS_DATASOURCE_USERNAME=user \ - # -e QUARKUS_DATASOURCE_PASSWORD=password \ - # -e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://pathfinder-db:5432/application_inventory_db \ - # -e QUARKUS_OIDC_AUTH_SERVER_URL=http://keycloak:8080/auth/realms/konveyor \ - # -e QUARKUS_OIDC_CLIENT_ID=pathfinder-api \ - # -e QUARKUS_OIDC_CREDENTIALS_SECRET=secret \ - # quay.io/konveyor/tackle-pathfinder:latest-native - # sleep 5s && docker logs pathfinder - # - name: Tackle UI - # run: | - # docker run -d --name tackle-ui --network ${{ job.services.keycloak.network }} --network-alias tackle-ui -p 3000:8080 \ - # -e SSO_REALM=konveyor \ - # -e SSO_CLIENT_ID=tackle-ui \ - # -e SSO_SERVER_URL=http://keycloak:8080/auth \ - # -e CONTROLS_API_URL=http://controls:8080/controls \ - # -e APPLICATION_INVENTORY_API_URL=http://application-inventory:8080/application-inventory \ - # quay.io/konveyor/tackle-ui:main - # sleep 5s && docker logs tackle-ui - # - name: Cypress run - # uses: cypress-io/github-action@v2 - # with: - # record: false - # wait-on: "http://localhost:3000" - # wait-on-timeout: 120 - # config: pageLoadTimeout=100000 - # browser: ${{ matrix.browser }} - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # CYPRESS_auth_base_url: http://localhost:3000/auth - # CYPRESS_controls_base_url: http://localhost:8081/controls - # CYPRESS_application_inventory_base_url: http://localhost:8082/application-inventory - # CYPRESS_pathfinder_base_url: http://localhost:8083/pathfinder - # - uses: actions/upload-artifact@v1 - # if: failure() - # with: - # name: container-screenshots-${{ matrix.os }}-${{ matrix.browser }} - # path: cypress/screenshots - # - uses: actions/upload-artifact@v1 - # if: always() - # with: - # name: container-videos-${{ matrix.os }}-${{ matrix.browser }} - # path: cypress/videos + test-container-images: + needs: [container-images] + runs-on: ubuntu-latest + strategy: + matrix: + os: [ubuntu-latest] + browser: [chrome, firefox] + services: + keycloak: + image: quay.io/keycloak/keycloak:12.0.2 + ports: + - 8180:8080 + env: + KEYCLOAK_USER: admin + KEYCLOAK_PASSWORD: admin + options: >- + --health-cmd "curl --fail http://localhost:8080/auth || exit 1" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + controls-db: + image: postgres:13.1 + ports: + - 5433:5432 + env: + POSTGRES_USER: user + POSTGRES_PASSWORD: password + POSTGRES_DB: controls_db + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + application-inventory-db: + image: postgres:13.1 + ports: + - 5434:5432 + env: + POSTGRES_USER: user + POSTGRES_PASSWORD: password + POSTGRES_DB: application_inventory_db + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + pathfinder-db: + image: postgres:13.1 + ports: + - 5435:5432 + env: + POSTGRES_USER: user + POSTGRES_PASSWORD: password + POSTGRES_DB: pathfinder_db + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + steps: + - uses: actions/checkout@v2 + - name: Keycloak Admin CLI + uses: carlosthe19916/keycloak-action@0.4 + with: + server: http://keycloak:8080/auth + username: admin + password: admin + kcadm: create realms -f konveyor-realm.json + - name: Controls API + run: | + docker run -d --name controls --network ${{ job.services.controls-db.network }} --network-alias controls -p 8081:8080 \ + -e QUARKUS_HTTP_PORT=8080 \ + -e QUARKUS_DATASOURCE_USERNAME=user \ + -e QUARKUS_DATASOURCE_PASSWORD=password \ + -e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://controls-db:5432/controls_db \ + -e QUARKUS_OIDC_AUTH_SERVER_URL=http://keycloak:8080/auth/realms/konveyor \ + -e QUARKUS_OIDC_CLIENT_ID=controls-api \ + -e QUARKUS_OIDC_CREDENTIALS_SECRET=secret \ + quay.io/konveyor/tackle-controls:latest-native + sleep 5s && docker logs controls + - name: Application inventory API + run: | + docker run -d --name application-inventory --network ${{ job.services.application-inventory-db.network }} --network-alias application-inventory -p 8082:8080 \ + -e QUARKUS_HTTP_PORT=8080 \ + -e QUARKUS_DATASOURCE_USERNAME=user \ + -e QUARKUS_DATASOURCE_PASSWORD=password \ + -e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://application-inventory-db:5432/application_inventory_db \ + -e QUARKUS_OIDC_AUTH_SERVER_URL=http://keycloak:8080/auth/realms/konveyor \ + -e QUARKUS_OIDC_CLIENT_ID=application-inventory-api \ + -e QUARKUS_OIDC_CREDENTIALS_SECRET=secret \ + quay.io/konveyor/tackle-application-inventory:latest-native + sleep 5s && docker logs application-inventory + - name: Pathfinder API + run: | + docker run -d --name pathfinder --network ${{ job.services.pathfinder-db.network }} --network-alias pathfinder -p 8083:8080 \ + -e QUARKUS_HTTP_PORT=8080 \ + -e QUARKUS_DATASOURCE_USERNAME=user \ + -e QUARKUS_DATASOURCE_PASSWORD=password \ + -e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://pathfinder-db:5432/application_inventory_db \ + -e QUARKUS_OIDC_AUTH_SERVER_URL=http://keycloak:8080/auth/realms/konveyor \ + -e QUARKUS_OIDC_CLIENT_ID=pathfinder-api \ + -e QUARKUS_OIDC_CREDENTIALS_SECRET=secret \ + quay.io/konveyor/tackle-pathfinder:latest-native + sleep 5s && docker logs pathfinder + - name: Tackle UI + run: | + docker run -d --name tackle-ui --network ${{ job.services.keycloak.network }} --network-alias tackle-ui -p 3000:8080 \ + -e SSO_REALM=konveyor \ + -e SSO_CLIENT_ID=tackle-ui \ + -e SSO_SERVER_URL=http://keycloak:8080/auth \ + -e CONTROLS_API_URL=http://controls:8080/controls \ + -e APPLICATION_INVENTORY_API_URL=http://application-inventory:8080/application-inventory \ + quay.io/konveyor/tackle-ui:main + sleep 5s && docker logs tackle-ui + - name: Cypress run + uses: cypress-io/github-action@v2 + with: + record: false + wait-on: "http://localhost:3000" + wait-on-timeout: 120 + config: pageLoadTimeout=100000 + browser: ${{ matrix.browser }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CYPRESS_auth_base_url: http://localhost:3000/auth + CYPRESS_controls_base_url: http://localhost:8081/controls + CYPRESS_application_inventory_base_url: http://localhost:8082/application-inventory + CYPRESS_pathfinder_base_url: http://localhost:8083/pathfinder + - uses: actions/upload-artifact@v1 + if: failure() + with: + name: container-screenshots-${{ matrix.os }}-${{ matrix.browser }} + path: cypress/screenshots + - uses: actions/upload-artifact@v1 + if: always() + with: + name: container-videos-${{ matrix.os }}-${{ matrix.browser }} + path: cypress/videos e2e-ks8: + needs: [unit-test] runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest] - browser: [chrome] + browser: [chrome, firefox] steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v2 # - name: Setup Minikube # uses: manusa/actions-setup-minikube@v2.3.1 # with: @@ -374,7 +375,7 @@ jobs: kubectl create -f kubernetes/pathfinder -n tackle kubectl wait deployment/tackle-pathfinder --for condition=available --timeout=-1s -n tackle - name: Kubectl create ingress - run: kubectl create -f kubernetes/ing.yml -n tackle + run: kubectl create -f kubernetes/ing2.yml -n tackle - name: Build UI run: | yarn install diff --git a/kubernetes/ing1.yml b/kubernetes/ing1.yml new file mode 100644 index 00000000..88b99d15 --- /dev/null +++ b/kubernetes/ing1.yml @@ -0,0 +1,20 @@ +kind: Ingress +apiVersion: networking.k8s.io/v1 +metadata: + name: tackle + labels: + app.kubernetes.io/name: tackle + app.kubernetes.io/component: application + app.kubernetes.io/instance: tackle + app.kubernetes.io/part-of: tackle +spec: + rules: + - http: + paths: + - path: / + pathType: ImplementationSpecific + backend: + service: + name: tackle-ui + port: + number: 8080 diff --git a/kubernetes/ing.yml b/kubernetes/ing2.yml similarity index 100% rename from kubernetes/ing.yml rename to kubernetes/ing2.yml diff --git a/kubernetes/keycloak/cm.yml b/kubernetes/keycloak/cm.yml index 5bbd15a4..93be4d5e 100644 --- a/kubernetes/keycloak/cm.yml +++ b/kubernetes/keycloak/cm.yml @@ -1017,12 +1017,10 @@ data: "clientAuthenticatorType": "client-secret", "secret": "**********", "redirectUris": [ - "http://localhost:3000/*", - "http://localhost:3001/*" + "*" ], "webOrigins": [ - "http://localhost:3000", - "http://localhost:3001" + "*" ], "notBefore": 0, "bearerOnly": false, diff --git a/kubernetes/start-minikube.sh b/kubernetes/start-minikube.sh deleted file mode 100755 index 8ea02bdb..00000000 --- a/kubernetes/start-minikube.sh +++ /dev/null @@ -1,5 +0,0 @@ - -# kubectl delete ns tackle -# kubectl create ns tackle - -kubectl create -f kubernetes/keycloak/ -n tackle \ No newline at end of file diff --git a/kubernetes/ui/deploy.yml b/kubernetes/ui/deploy.yml index e821fb97..01ff74fe 100644 --- a/kubernetes/ui/deploy.yml +++ b/kubernetes/ui/deploy.yml @@ -37,7 +37,7 @@ spec: - name: PATHFINDER_API_URL value: "http://tackle-pathfinder:8080" - name: SSO_REALM - value: quarkus + value: konveyor - name: SSO_CLIENT_ID value: tackle-ui - name: SSO_SERVER_URL From 298bd2c9e5638cfb507b18de317b39bae71c97fc Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Thu, 8 Apr 2021 11:04:00 +0200 Subject: [PATCH 31/43] test only containers --- .github/workflows/ci-actions.yml | 224 ------------------------------ .github/workflows/daily.yml | 87 ++++++++++++ package.json | 3 +- public/keycloak.json.k8s.template | 6 - 4 files changed, 89 insertions(+), 231 deletions(-) create mode 100644 .github/workflows/daily.yml delete mode 100644 public/keycloak.json.k8s.template diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index b9f8799d..2bd18a08 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -187,227 +187,3 @@ jobs: snapshot: false tags: "main" buildoptions: "--pull" - - test-container-images: - needs: [container-images] - runs-on: ubuntu-latest - strategy: - matrix: - os: [ubuntu-latest] - browser: [chrome, firefox] - services: - keycloak: - image: quay.io/keycloak/keycloak:12.0.2 - ports: - - 8180:8080 - env: - KEYCLOAK_USER: admin - KEYCLOAK_PASSWORD: admin - options: >- - --health-cmd "curl --fail http://localhost:8080/auth || exit 1" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - controls-db: - image: postgres:13.1 - ports: - - 5433:5432 - env: - POSTGRES_USER: user - POSTGRES_PASSWORD: password - POSTGRES_DB: controls_db - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - application-inventory-db: - image: postgres:13.1 - ports: - - 5434:5432 - env: - POSTGRES_USER: user - POSTGRES_PASSWORD: password - POSTGRES_DB: application_inventory_db - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - pathfinder-db: - image: postgres:13.1 - ports: - - 5435:5432 - env: - POSTGRES_USER: user - POSTGRES_PASSWORD: password - POSTGRES_DB: pathfinder_db - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - steps: - - uses: actions/checkout@v2 - - name: Keycloak Admin CLI - uses: carlosthe19916/keycloak-action@0.4 - with: - server: http://keycloak:8080/auth - username: admin - password: admin - kcadm: create realms -f konveyor-realm.json - - name: Controls API - run: | - docker run -d --name controls --network ${{ job.services.controls-db.network }} --network-alias controls -p 8081:8080 \ - -e QUARKUS_HTTP_PORT=8080 \ - -e QUARKUS_DATASOURCE_USERNAME=user \ - -e QUARKUS_DATASOURCE_PASSWORD=password \ - -e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://controls-db:5432/controls_db \ - -e QUARKUS_OIDC_AUTH_SERVER_URL=http://keycloak:8080/auth/realms/konveyor \ - -e QUARKUS_OIDC_CLIENT_ID=controls-api \ - -e QUARKUS_OIDC_CREDENTIALS_SECRET=secret \ - quay.io/konveyor/tackle-controls:latest-native - sleep 5s && docker logs controls - - name: Application inventory API - run: | - docker run -d --name application-inventory --network ${{ job.services.application-inventory-db.network }} --network-alias application-inventory -p 8082:8080 \ - -e QUARKUS_HTTP_PORT=8080 \ - -e QUARKUS_DATASOURCE_USERNAME=user \ - -e QUARKUS_DATASOURCE_PASSWORD=password \ - -e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://application-inventory-db:5432/application_inventory_db \ - -e QUARKUS_OIDC_AUTH_SERVER_URL=http://keycloak:8080/auth/realms/konveyor \ - -e QUARKUS_OIDC_CLIENT_ID=application-inventory-api \ - -e QUARKUS_OIDC_CREDENTIALS_SECRET=secret \ - quay.io/konveyor/tackle-application-inventory:latest-native - sleep 5s && docker logs application-inventory - - name: Pathfinder API - run: | - docker run -d --name pathfinder --network ${{ job.services.pathfinder-db.network }} --network-alias pathfinder -p 8083:8080 \ - -e QUARKUS_HTTP_PORT=8080 \ - -e QUARKUS_DATASOURCE_USERNAME=user \ - -e QUARKUS_DATASOURCE_PASSWORD=password \ - -e QUARKUS_DATASOURCE_JDBC_URL=jdbc:postgresql://pathfinder-db:5432/application_inventory_db \ - -e QUARKUS_OIDC_AUTH_SERVER_URL=http://keycloak:8080/auth/realms/konveyor \ - -e QUARKUS_OIDC_CLIENT_ID=pathfinder-api \ - -e QUARKUS_OIDC_CREDENTIALS_SECRET=secret \ - quay.io/konveyor/tackle-pathfinder:latest-native - sleep 5s && docker logs pathfinder - - name: Tackle UI - run: | - docker run -d --name tackle-ui --network ${{ job.services.keycloak.network }} --network-alias tackle-ui -p 3000:8080 \ - -e SSO_REALM=konveyor \ - -e SSO_CLIENT_ID=tackle-ui \ - -e SSO_SERVER_URL=http://keycloak:8080/auth \ - -e CONTROLS_API_URL=http://controls:8080/controls \ - -e APPLICATION_INVENTORY_API_URL=http://application-inventory:8080/application-inventory \ - quay.io/konveyor/tackle-ui:main - sleep 5s && docker logs tackle-ui - - name: Cypress run - uses: cypress-io/github-action@v2 - with: - record: false - wait-on: "http://localhost:3000" - wait-on-timeout: 120 - config: pageLoadTimeout=100000 - browser: ${{ matrix.browser }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CYPRESS_auth_base_url: http://localhost:3000/auth - CYPRESS_controls_base_url: http://localhost:8081/controls - CYPRESS_application_inventory_base_url: http://localhost:8082/application-inventory - CYPRESS_pathfinder_base_url: http://localhost:8083/pathfinder - - uses: actions/upload-artifact@v1 - if: failure() - with: - name: container-screenshots-${{ matrix.os }}-${{ matrix.browser }} - path: cypress/screenshots - - uses: actions/upload-artifact@v1 - if: always() - with: - name: container-videos-${{ matrix.os }}-${{ matrix.browser }} - path: cypress/videos - - e2e-ks8: - needs: [unit-test] - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest] - browser: [chrome, firefox] - steps: - - name: Checkout - uses: actions/checkout@v2 - # - name: Setup Minikube - # uses: manusa/actions-setup-minikube@v2.3.1 - # with: - # minikube version: v1.17.1 - # kubernetes version: v1.20.2 - # driver: docker - # start args: "--addons=registry --addons=ingress" - - name: Setup Minikube - uses: manusa/actions-setup-minikube@v2.3.1 - with: - minikube version: v1.18.1 - kubernetes version: v1.20.2 - start args: "--addons=registry --addons=ingress" - - name: Validate Minikube - run: minikube status | grep Running - - name: Validate Cluster - run: kubectl get nodes - - name: Validate enabled addon in arg - run: minikube addons list -o json | jq '.registry.Status' | grep enabled - - name: Kubectl create namespace - run: kubectl create ns tackle - - name: Deploy keycloak - run: | - kubectl create -f kubernetes/keycloak -n tackle - kubectl wait deployment/keycloak --for condition=available --timeout=-1s -n tackle - - name: Deploy tackle-controls - run: | - kubectl create -f kubernetes/controls -n tackle - kubectl wait deployment/tackle-controls --for condition=available --timeout=-1s -n tackle - - name: Deploy tackle-application-inventory - run: | - kubectl create -f kubernetes/application-inventory -n tackle - kubectl wait deployment/tackle-application-inventory --for condition=available --timeout=-1s -n tackle - - name: Deploy tackle-pathfinder - run: | - kubectl create -f kubernetes/pathfinder -n tackle - kubectl wait deployment/tackle-pathfinder --for condition=available --timeout=-1s -n tackle - - name: Kubectl create ingress - run: kubectl create -f kubernetes/ing2.yml -n tackle - - name: Build UI - run: | - yarn install - yarn build:instrumentation - - name: Wait for Ingress - run: | - bash -c 'external_ip=""; - while [ -z $external_ip ]; - do echo "Waiting for end point..."; - external_ip=$(kubectl get ingress tackle --template="{{range .status.loadBalancer.ingress}}{{.ip}}{{end}}" -n tackle);[ -z "$external_ip" ] && - sleep 10; - done; - echo "End point ready:" && - echo $external_ip; - export endpoint=$external_ip; - export SSO_URL=https://$external_ip/auth; - envsubst '${SSO_URL}' < ./build/keycloak.json.k8s.template > ./build/keycloak.json; - echo "TACKLE_CONTROLS_HOST=https://$external_ip" >> $GITHUB_ENV && - echo "TACKLE_APPLICATION_INVENTORY_HOST=https://$external_ip" >> $GITHUB_ENV && - echo "TACKLE_PATHFINDER_HOST=https://$external_ip" >> $GITHUB_ENV && - echo "CYPRESS_controls_base_url=https://$external_ip/controls" >>$GITHUB_ENV && - echo "CYPRESS_application_inventory_base_url=https://$external_ip/application-inventory" >> $GITHUB_ENV && - echo "CYPRESS_pathfinder_base_url=https://$external_ip/pathfinder" >> $GITHUB_ENV && - echo "CYPRESS_auth_base_url=https://$external_ip/auth" >> $GITHUB_ENV' - - name: Cypress run - uses: cypress-io/github-action@v2 - with: - record: false - start: yarn run ui:start - wait-on: "http://localhost:3000" - wait-on-timeout: 120 - config: pageLoadTimeout=100000 - browser: ${{ matrix.browser }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml new file mode 100644 index 00000000..11521777 --- /dev/null +++ b/.github/workflows/daily.yml @@ -0,0 +1,87 @@ +name: Daliy CI + +on: + schedule: + - cron: "0 0 * * *" + workflow_dispatch: + inputs: + message: + description: "Hello" + required: false + +jobs: + ks8: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + browser: [chrome, firefox] + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Minikube + uses: manusa/actions-setup-minikube@v2.3.1 + with: + minikube version: v1.18.1 + kubernetes version: v1.20.2 + start args: "--addons=registry --addons=ingress" + - name: Validate Minikube + run: minikube status | grep Running + - name: Validate Cluster + run: kubectl get nodes + - name: Validate enabled addon in arg + run: minikube addons list -o json | jq '.registry.Status' | grep enabled + - name: Kubectl create namespace + run: kubectl create ns tackle + - name: Deploy keycloak + run: | + kubectl create -f kubernetes/keycloak -n tackle + kubectl wait deployment/keycloak --for condition=available --timeout=-1s -n tackle + - name: Deploy tackle-controls + run: | + kubectl create -f kubernetes/controls -n tackle + kubectl wait deployment/tackle-controls --for condition=available --timeout=-1s -n tackle + - name: Deploy tackle-application-inventory + run: | + kubectl create -f kubernetes/application-inventory -n tackle + kubectl wait deployment/tackle-application-inventory --for condition=available --timeout=-1s -n tackle + - name: Deploy tackle-pathfinder + run: | + kubectl create -f kubernetes/pathfinder -n tackle + kubectl wait deployment/tackle-pathfinder --for condition=available --timeout=-1s -n tackle + - name: Deploy tackle-ui + run: | + kubectl create -f kubernetes/ui -n tackle + kubectl wait deployment/tackle-ui --for condition=available --timeout=-1s -n tackle + - name: Kubectl create ingress + run: kubectl create -f kubernetes/ing1.yml -n tackle + - name: Wait for Ingress + run: | + bash -c 'external_ip=""; + while [ -z $external_ip ]; + do echo "Waiting for end point..."; + external_ip=$(kubectl get ingress tackle --template="{{range .status.loadBalancer.ingress}}{{.ip}}{{end}}" -n tackle);[ -z "$external_ip" ] && + sleep 10; + done; + echo "End point ready:" && + echo $external_ip; + export endpoint=$external_ip; + echo "TACKLE_CONTROLS_HOST=https://$external_ip" >> $GITHUB_ENV && + echo "TACKLE_APPLICATION_INVENTORY_HOST=https://$external_ip" >> $GITHUB_ENV && + echo "TACKLE_PATHFINDER_HOST=https://$external_ip" >> $GITHUB_ENV && + echo "CYPRESS_BASE_URL=https://$external_ip" >>$GITHUB_ENV && + echo "CYPRESS_controls_base_url=https://$external_ip/controls" >>$GITHUB_ENV && + echo "CYPRESS_application_inventory_base_url=https://$external_ip/application-inventory" >> $GITHUB_ENV && + echo "CYPRESS_pathfinder_base_url=https://$external_ip/pathfinder" >> $GITHUB_ENV && + echo "CYPRESS_auth_base_url=https://$external_ip/auth" >> $GITHUB_ENV' + - name: Cypress run + uses: cypress-io/github-action@v2 + with: + record: false + start: yarn run ui:start-k8s + # wait-on: "http://localhost:3000" + # wait-on-timeout: 120 + config: pageLoadTimeout=100000 + browser: ${{ matrix.browser }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json index 7f519d8d..c7a80b44 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,8 @@ "eject": "react-scripts eject", "storybook": "start-storybook -p 6006 -s public", "build-storybook": "build-storybook -s public", - "ui:start": "node server.js" + "ui:start": "node server.js", + "ui:start-k8s": "echo \"Starting k8s test\"" }, "eslintConfig": { "extends": [ diff --git a/public/keycloak.json.k8s.template b/public/keycloak.json.k8s.template deleted file mode 100644 index 2ad5891a..00000000 --- a/public/keycloak.json.k8s.template +++ /dev/null @@ -1,6 +0,0 @@ -{ - "realm": "konveyor", - "auth-server-url": "${SSO_URL}", - "resource": "tackle-ui", - "public-client": true -} From 007c416aa0b18bb83005ea35b783250f3712cae0 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Thu, 8 Apr 2021 11:04:59 +0200 Subject: [PATCH 32/43] remove minikube branch from CI --- .github/workflows/ci-actions.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index 2bd18a08..6fc8c212 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -4,7 +4,6 @@ on: push: branches: - main - - minikube pull_request: branches: - main From 905b14cac364cfc7164417c5d080abbdbdedb09c Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Thu, 8 Apr 2021 11:07:06 +0200 Subject: [PATCH 33/43] Run minikube --- .github/workflows/daily.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index 11521777..01bbc203 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -8,6 +8,9 @@ on: message: description: "Hello" required: false + push: + branches: + - minikube jobs: ks8: From 2e8c5c3c82acccad08e89008df619682738b70c1 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Thu, 8 Apr 2021 11:34:35 +0200 Subject: [PATCH 34/43] Remove local proxy setup --- .github/workflows/daily.yml | 3 --- src/setupProxy.js | 16 +++------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index 01bbc203..f2426b3f 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -69,9 +69,6 @@ jobs: echo "End point ready:" && echo $external_ip; export endpoint=$external_ip; - echo "TACKLE_CONTROLS_HOST=https://$external_ip" >> $GITHUB_ENV && - echo "TACKLE_APPLICATION_INVENTORY_HOST=https://$external_ip" >> $GITHUB_ENV && - echo "TACKLE_PATHFINDER_HOST=https://$external_ip" >> $GITHUB_ENV && echo "CYPRESS_BASE_URL=https://$external_ip" >>$GITHUB_ENV && echo "CYPRESS_controls_base_url=https://$external_ip/controls" >>$GITHUB_ENV && echo "CYPRESS_application_inventory_base_url=https://$external_ip/application-inventory" >> $GITHUB_ENV && diff --git a/src/setupProxy.js b/src/setupProxy.js index 986567d6..76f4730f 100644 --- a/src/setupProxy.js +++ b/src/setupProxy.js @@ -1,18 +1,10 @@ const { createProxyMiddleware } = require("http-proxy-middleware"); -const TACKLE_CONTROLS_HOST = - process.env.TACKLE_CONTROLS_HOST || "http://localhost:8081"; -const TACKLE_APPLICATION_INVENTORY_HOST = - process.env.TACKLE_APPLICATION_INVENTORY_HOST || "http://localhost:8082"; -const TACKLE_PATHFINDER_HOST = - process.env.TACKLE_PATHFINDER_HOST || "http://localhost:8083"; - module.exports = function (app) { app.use( "/api/controls", createProxyMiddleware({ - target: TACKLE_CONTROLS_HOST, - secure: false, + target: "http://localhost:8081", changeOrigin: true, pathRewrite: { "^/api/controls": "/controls", @@ -23,8 +15,7 @@ module.exports = function (app) { app.use( "/api/application-inventory", createProxyMiddleware({ - target: TACKLE_APPLICATION_INVENTORY_HOST, - secure: false, + target: "http://localhost:8082", changeOrigin: true, pathRewrite: { "^/api/application-inventory": "/application-inventory", @@ -35,8 +26,7 @@ module.exports = function (app) { app.use( "/api/pathfinder", createProxyMiddleware({ - target: TACKLE_PATHFINDER_HOST, - secure: false, + target: "http://localhost:8083", changeOrigin: true, pathRewrite: { "^/api/pathfinder": "/pathfinder", From 86dba2c7f7d5c09d1fc96fb820619a13a37c3777 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Thu, 8 Apr 2021 12:29:15 +0200 Subject: [PATCH 35/43] Fix endpoints --- .github/workflows/daily.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index f2426b3f..33d8885f 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -70,9 +70,9 @@ jobs: echo $external_ip; export endpoint=$external_ip; echo "CYPRESS_BASE_URL=https://$external_ip" >>$GITHUB_ENV && - echo "CYPRESS_controls_base_url=https://$external_ip/controls" >>$GITHUB_ENV && - echo "CYPRESS_application_inventory_base_url=https://$external_ip/application-inventory" >> $GITHUB_ENV && - echo "CYPRESS_pathfinder_base_url=https://$external_ip/pathfinder" >> $GITHUB_ENV && + echo "CYPRESS_controls_base_url=https://$external_ip/api/controls" >>$GITHUB_ENV && + echo "CYPRESS_application_inventory_base_url=https://$external_ip/api/application-inventory" >> $GITHUB_ENV && + echo "CYPRESS_pathfinder_base_url=https://$external_ip/api/pathfinder" >> $GITHUB_ENV && echo "CYPRESS_auth_base_url=https://$external_ip/auth" >> $GITHUB_ENV' - name: Cypress run uses: cypress-io/github-action@v2 From 6c1cf0ad3fcec24dd1165ee828ed607818df6478 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Thu, 8 Apr 2021 12:47:33 +0200 Subject: [PATCH 36/43] Add yarn install --- .github/workflows/daily.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index 33d8885f..b509dcff 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -74,6 +74,8 @@ jobs: echo "CYPRESS_application_inventory_base_url=https://$external_ip/api/application-inventory" >> $GITHUB_ENV && echo "CYPRESS_pathfinder_base_url=https://$external_ip/api/pathfinder" >> $GITHUB_ENV && echo "CYPRESS_auth_base_url=https://$external_ip/auth" >> $GITHUB_ENV' + - name: Yarn install + run: yarn install - name: Cypress run uses: cypress-io/github-action@v2 with: From 75812b6f065dba0244a32b12d7ed1f8fd45f75bf Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Thu, 8 Apr 2021 13:04:17 +0200 Subject: [PATCH 37/43] Remove minikube branch --- .github/workflows/daily.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index b509dcff..8e00e708 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -8,9 +8,6 @@ on: message: description: "Hello" required: false - push: - branches: - - minikube jobs: ks8: From 0ef21eaa37152dc156aca9f169e35757664b3b16 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Thu, 8 Apr 2021 13:06:09 +0200 Subject: [PATCH 38/43] Remove inputs --- .github/workflows/daily.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index 8e00e708..26538f0d 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -3,11 +3,7 @@ name: Daliy CI on: schedule: - cron: "0 0 * * *" - workflow_dispatch: - inputs: - message: - description: "Hello" - required: false + workflow_dispatch: {} jobs: ks8: From 5134efc062c2ed0e84bac25dce5469dec6e48bc5 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Thu, 8 Apr 2021 13:19:54 +0200 Subject: [PATCH 39/43] Change file name --- .github/workflows/{daily.yml => ci-daily.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{daily.yml => ci-daily.yml} (99%) diff --git a/.github/workflows/daily.yml b/.github/workflows/ci-daily.yml similarity index 99% rename from .github/workflows/daily.yml rename to .github/workflows/ci-daily.yml index 26538f0d..81f41bf4 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/ci-daily.yml @@ -1,4 +1,4 @@ -name: Daliy CI +name: CI Daily on: schedule: From 9212760763899ad217c23e0156f82420e545109e Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Thu, 20 May 2021 11:48:21 +0200 Subject: [PATCH 40/43] Use tackle-ui-tests --- .github/workflows/ci-daily.yml | 44 +++++++++++++++++++--------------- package.json | 3 +-- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci-daily.yml b/.github/workflows/ci-daily.yml index 81f41bf4..94906693 100644 --- a/.github/workflows/ci-daily.yml +++ b/.github/workflows/ci-daily.yml @@ -1,9 +1,15 @@ name: CI Daily +# Temporary definition just to test this workflow in PRs on: - schedule: - - cron: "0 0 * * *" - workflow_dispatch: {} + pull_request: + branches: + - main + +# on: +# schedule: +# - cron: "0 0 * * *" +# workflow_dispatch: {} jobs: ks8: @@ -15,6 +21,13 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + with: + path: tackle-ui + - name: Checkout + uses: actions/checkout@v2 + with: + repository: konveyor/tackle-ui-tests + path: tackle-ui-tests - name: Setup Minikube uses: manusa/actions-setup-minikube@v2.3.1 with: @@ -31,26 +44,26 @@ jobs: run: kubectl create ns tackle - name: Deploy keycloak run: | - kubectl create -f kubernetes/keycloak -n tackle + kubectl create -f tackle-ui/kubernetes/keycloak -n tackle kubectl wait deployment/keycloak --for condition=available --timeout=-1s -n tackle - name: Deploy tackle-controls run: | - kubectl create -f kubernetes/controls -n tackle + kubectl create -f tackle-ui/kubernetes/controls -n tackle kubectl wait deployment/tackle-controls --for condition=available --timeout=-1s -n tackle - name: Deploy tackle-application-inventory run: | - kubectl create -f kubernetes/application-inventory -n tackle + kubectl create -f tackle-ui/kubernetes/application-inventory -n tackle kubectl wait deployment/tackle-application-inventory --for condition=available --timeout=-1s -n tackle - name: Deploy tackle-pathfinder run: | - kubectl create -f kubernetes/pathfinder -n tackle + kubectl create -f tackle-ui/kubernetes/pathfinder -n tackle kubectl wait deployment/tackle-pathfinder --for condition=available --timeout=-1s -n tackle - name: Deploy tackle-ui run: | - kubectl create -f kubernetes/ui -n tackle + kubectl create -f tackle-ui/kubernetes/ui -n tackle kubectl wait deployment/tackle-ui --for condition=available --timeout=-1s -n tackle - name: Kubectl create ingress - run: kubectl create -f kubernetes/ing1.yml -n tackle + run: kubectl create -f tackle-ui/kubernetes/ing1.yml -n tackle - name: Wait for Ingress run: | bash -c 'external_ip=""; @@ -62,20 +75,13 @@ jobs: echo "End point ready:" && echo $external_ip; export endpoint=$external_ip; - echo "CYPRESS_BASE_URL=https://$external_ip" >>$GITHUB_ENV && - echo "CYPRESS_controls_base_url=https://$external_ip/api/controls" >>$GITHUB_ENV && - echo "CYPRESS_application_inventory_base_url=https://$external_ip/api/application-inventory" >> $GITHUB_ENV && - echo "CYPRESS_pathfinder_base_url=https://$external_ip/api/pathfinder" >> $GITHUB_ENV && - echo "CYPRESS_auth_base_url=https://$external_ip/auth" >> $GITHUB_ENV' - - name: Yarn install - run: yarn install + echo "CYPRESS_BASE_URL=https://$external_ip" >>$GITHUB_ENV' - name: Cypress run uses: cypress-io/github-action@v2 with: + working-directory: tackle-ui-tests record: false - start: yarn run ui:start-k8s - # wait-on: "http://localhost:3000" - # wait-on-timeout: 120 + start: npx echo "Starting Minikube Cypress tests" config: pageLoadTimeout=100000 browser: ${{ matrix.browser }} env: diff --git a/package.json b/package.json index 34f5db20..5e45a573 100644 --- a/package.json +++ b/package.json @@ -47,8 +47,7 @@ "eject": "react-scripts eject", "storybook": "start-storybook -p 6006 -s public", "build-storybook": "build-storybook -s public", - "ui:start": "node server.js", - "ui:start-k8s": "echo \"Starting k8s test\"" + "ui:start": "node server.js" }, "eslintConfig": { "extends": [ From e178a2cc75afee3f750832ad729ff2bc6b583615 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Thu, 20 May 2021 11:58:57 +0200 Subject: [PATCH 41/43] add env variables --- .github/workflows/ci-daily.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-daily.yml b/.github/workflows/ci-daily.yml index 94906693..87b0261f 100644 --- a/.github/workflows/ci-daily.yml +++ b/.github/workflows/ci-daily.yml @@ -75,7 +75,7 @@ jobs: echo "End point ready:" && echo $external_ip; export endpoint=$external_ip; - echo "CYPRESS_BASE_URL=https://$external_ip" >>$GITHUB_ENV' + echo "CYPRESS_tackleUrl=https://$external_ip" >>$GITHUB_ENV' - name: Cypress run uses: cypress-io/github-action@v2 with: @@ -86,3 +86,5 @@ jobs: browser: ${{ matrix.browser }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CYPRESS_user: admin + CYPRESS_pass: admin From 55f3b76d43ff6f86105e03d983df7a78c3468c27 Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Fri, 21 May 2021 17:54:15 +0200 Subject: [PATCH 42/43] Remove firefox tests temporarily --- .github/workflows/ci-actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index ac64695f..82884a9a 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -36,7 +36,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - browser: [chrome, firefox] + browser: [chrome] services: keycloak: image: quay.io/keycloak/keycloak:12.0.2 From db1a3af82a7d8c65412c97252c876de67ea6644f Mon Sep 17 00:00:00 2001 From: Carlos Esteban Feria Vila <2582866+carlosthe19916@users.noreply.github.com> Date: Fri, 21 May 2021 17:59:35 +0200 Subject: [PATCH 43/43] Remove firefox from minikube running tests --- .github/workflows/ci-actions.yml | 2 +- .github/workflows/ci-daily.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index 82884a9a..ac64695f 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -36,7 +36,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - browser: [chrome] + browser: [chrome, firefox] services: keycloak: image: quay.io/keycloak/keycloak:12.0.2 diff --git a/.github/workflows/ci-daily.yml b/.github/workflows/ci-daily.yml index 87b0261f..589e9c46 100644 --- a/.github/workflows/ci-daily.yml +++ b/.github/workflows/ci-daily.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - browser: [chrome, firefox] + browser: [chrome] steps: - name: Checkout uses: actions/checkout@v2