From a3aa24f9bf684d7e0a45879d4dde6ce10cada4ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Alonso=20L=C3=B3pez?= Date: Wed, 27 Nov 2024 16:49:30 +0100 Subject: [PATCH] Kustomize added and changed Workflows --- .github/workflows/create-image.yml | 35 ------------------------ .github/workflows/main.yaml | 12 ++++++++ .github/workflows/ruff-check.yml | 10 ------- kubernetes/{ => base}/001-service.yaml | 0 kubernetes/base/002-deployment.yaml | 32 ++++++++++++++++++++++ kubernetes/{ => base}/003-vs.yaml | 0 kubernetes/base/kustomization.yaml | 7 +++++ kubernetes/{ => dev}/002-deployment.yaml | 2 +- kubernetes/dev/kustomization.yaml | 8 ++++++ 9 files changed, 60 insertions(+), 46 deletions(-) delete mode 100644 .github/workflows/create-image.yml create mode 100644 .github/workflows/main.yaml delete mode 100644 .github/workflows/ruff-check.yml rename kubernetes/{ => base}/001-service.yaml (100%) create mode 100644 kubernetes/base/002-deployment.yaml rename kubernetes/{ => base}/003-vs.yaml (100%) create mode 100644 kubernetes/base/kustomization.yaml rename kubernetes/{ => dev}/002-deployment.yaml (96%) create mode 100644 kubernetes/dev/kustomization.yaml diff --git a/.github/workflows/create-image.yml b/.github/workflows/create-image.yml deleted file mode 100644 index c2b799c..0000000 --- a/.github/workflows/create-image.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Docker Image CI - -on: - #release: - push: - branches: [ main ] - #pull_request: - # branches: [ main ] - -jobs: - update: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - id: pre-step - shell: bash - run: | - echo "release-version=${{ github.ref }}" >> $GITHUB_ENV - echo "commit-sha=${{ github.sha }}" >> $GITHUB_SHA - # - name: Set up Docker Buildx - # uses: docker/setup-buildx-action@v2 - - name: Publish to Registry - uses: elgohr/Publish-Docker-Github-Action@v5 - with: - name: ${{ secrets.DOCKER_USERNAME }}/gh-summary-lens - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - tags: "latest" - # platforms: linux/amd64,linux/arm64 - # cache: ${{ github.event_name != 'schedule' }} - snapshot: true - workdir: . - - - diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 0000000..52456b8 --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,12 @@ +name: CI CD + +on: + push: + +jobs: + main-GH-workflow: + uses: Gravitate-Health/reusable-workflows/.github/workflows/main.yml@main + secrets: + REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }} + REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }} + KUBECONFIG_DEV: ${{ secrets.KUBECONFIG_DEV }} \ No newline at end of file diff --git a/.github/workflows/ruff-check.yml b/.github/workflows/ruff-check.yml deleted file mode 100644 index 37c5e31..0000000 --- a/.github/workflows/ruff-check.yml +++ /dev/null @@ -1,10 +0,0 @@ -name: Ruff -on: [push, pull_request] -jobs: - ruff: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: chartboost/ruff-action@v1 - with: - args: check --exit-zero diff --git a/kubernetes/001-service.yaml b/kubernetes/base/001-service.yaml similarity index 100% rename from kubernetes/001-service.yaml rename to kubernetes/base/001-service.yaml diff --git a/kubernetes/base/002-deployment.yaml b/kubernetes/base/002-deployment.yaml new file mode 100644 index 0000000..ca7593a --- /dev/null +++ b/kubernetes/base/002-deployment.yaml @@ -0,0 +1,32 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: external-summary-lens-python +spec: + replicas: 1 + selector: + matchLabels: + app: external-summary-lens-python + template: + metadata: + labels: + app: external-summary-lens-python + spec: + containers: + - name: external-summary-lens-python + image: gravitate-registry.cr.de-fra.ionos.com/external-summary-lens-python:v0.1.0 + imagePullPolicy: Always + env: + - name: SERVER_URL + value: "https://fosps.gravitatehealth.eu/" + - name: MODEL_URL + value: "https://ollama.lst.tfo.upm.es" + - name: OPENAI_KEY + value: "" + - name: GROQ_API_KEY + value: "" + ports: + - containerPort: 80 + protocol: TCP + restartPolicy: Always +status: {} diff --git a/kubernetes/003-vs.yaml b/kubernetes/base/003-vs.yaml similarity index 100% rename from kubernetes/003-vs.yaml rename to kubernetes/base/003-vs.yaml diff --git a/kubernetes/base/kustomization.yaml b/kubernetes/base/kustomization.yaml new file mode 100644 index 0000000..ae2145b --- /dev/null +++ b/kubernetes/base/kustomization.yaml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - 001-service.yaml + - 002-deployment.yaml + - 003-vs.yaml \ No newline at end of file diff --git a/kubernetes/002-deployment.yaml b/kubernetes/dev/002-deployment.yaml similarity index 96% rename from kubernetes/002-deployment.yaml rename to kubernetes/dev/002-deployment.yaml index 09c1eaf..2a418c5 100644 --- a/kubernetes/002-deployment.yaml +++ b/kubernetes/dev/002-deployment.yaml @@ -14,7 +14,7 @@ spec: spec: containers: - name: external-summary-lens-python - image: gravitate-registry.cr.de-fra.ionos.com/external-summary-lens-python:dev + image: gravitate-registry.cr.de-fra.ionos.com/external-summary-lens-python:latest imagePullPolicy: Always env: - name: SERVER_URL diff --git a/kubernetes/dev/kustomization.yaml b/kubernetes/dev/kustomization.yaml new file mode 100644 index 0000000..8f710f7 --- /dev/null +++ b/kubernetes/dev/kustomization.yaml @@ -0,0 +1,8 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: +- ../base + +patches: +- path: 002-deployment.yaml