diff --git a/play-with-sld/kubernetes/k8s/add-env-patch.yaml b/play-with-sld/kubernetes/k8s/add-env-patch.yaml new file mode 100644 index 00000000..43ac5e08 --- /dev/null +++ b/play-with-sld/kubernetes/k8s/add-env-patch.yaml @@ -0,0 +1,13 @@ +# add-env-patch.yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + name: "" +spec: + template: + spec: + containers: + - name: "" + env: + - name: PATH + value: "/home/sld/.asdf/shims:/home/sld/.asdf/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" diff --git a/play-with-sld/kubernetes/k8s/kustomization.yaml b/play-with-sld/kubernetes/k8s/kustomization.yaml index 5626c9a3..decc7c96 100644 --- a/play-with-sld/kubernetes/k8s/kustomization.yaml +++ b/play-with-sld/kubernetes/k8s/kustomization.yaml @@ -29,4 +29,4 @@ resources: - sld-schedule-service.yml - db-secret.yml - dashboard-secret.yml - - rabbit-secret.yml + - rabbit-secret.yml \ No newline at end of file diff --git a/play-with-sld/kubernetes/k8s/sld-api-backend.yml b/play-with-sld/kubernetes/k8s/sld-api-backend.yml index b979063c..62ddeaeb 100644 --- a/play-with-sld/kubernetes/k8s/sld-api-backend.yml +++ b/play-with-sld/kubernetes/k8s/sld-api-backend.yml @@ -16,18 +16,21 @@ spec: spec: subdomain: primary containers: - - name: api-backend - image: d10s0vsky/sld-api:latest - imagePullPolicy: Always - command: ["python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1"] - ports: - - containerPort: 8000 - livenessProbe: - httpGet: - path: /api/v1/ - port: 8000 - httpHeaders: - - name: status - value: healthy - initialDelaySeconds: 60 - periodSeconds: 60 + - name: api-backend + image: d10s0vsky/sld-api:2.18.0 + imagePullPolicy: Always + command: ["python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1"] + ports: + - containerPort: 8000 + livenessProbe: + httpGet: + path: /api/v1/ + port: 8000 + httpHeaders: + - name: status + value: healthy + initialDelaySeconds: 60 + periodSeconds: 60 + env: + - name: PATH + value: "/home/sld/.asdf/shims:/home/sld/.asdf/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" diff --git a/play-with-sld/kubernetes/k8s/sld-dashboard.yml b/play-with-sld/kubernetes/k8s/sld-dashboard.yml index 9477a638..8078c8c2 100644 --- a/play-with-sld/kubernetes/k8s/sld-dashboard.yml +++ b/play-with-sld/kubernetes/k8s/sld-dashboard.yml @@ -19,6 +19,8 @@ spec: - name: sld-dashboard image: d10s0vsky/sld-dashboard:latest env: + - name: PATH + value: "/home/sld/.asdf/shims:/home/sld/.asdf/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" - name: DEBUG value: "True" - name: SECRET_KEY @@ -42,6 +44,6 @@ spec: name: db key: password imagePullPolicy: Always - command: ["gunicorn", "--config", "gunicorn-cfg.py", "run:app"] + command: ["python", "-m", "gunicorn", "--config", "gunicorn-cfg.py", "run:app"] ports: - containerPort: 5000 diff --git a/play-with-sld/kubernetes/k8s/sld-remote-state.yml b/play-with-sld/kubernetes/k8s/sld-remote-state.yml index 6a67c708..1e97d3d0 100644 --- a/play-with-sld/kubernetes/k8s/sld-remote-state.yml +++ b/play-with-sld/kubernetes/k8s/sld-remote-state.yml @@ -17,8 +17,10 @@ spec: subdomain: primary containers: - name: remote-state - image: d10s0vsky/sld-remote-state:latest + image: d10s0vsky/sld-remote-state:2.11.0 env: + - name: PATH + value: "/home/sld/.asdf/shims:/home/sld/.asdf/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" - name: SLD_STORAGE_BACKEND value: mongodb - name: SLD_MONGODB_URL diff --git a/play-with-sld/kubernetes/k8s/sld-worker-default.yml b/play-with-sld/kubernetes/k8s/sld-worker-default.yml index 9623d01c..ba72a866 100644 --- a/play-with-sld/kubernetes/k8s/sld-worker-default.yml +++ b/play-with-sld/kubernetes/k8s/sld-worker-default.yml @@ -17,9 +17,11 @@ spec: subdomain: primary containers: - name: stack-deploy-worker-default - image: d10s0vsky/sld-api:latest + image: d10s0vsky/sld-api:2.18.0 imagePullPolicy: Always env: - name: TF_WARN_OUTPUT_ERRORS value: "1" - command: ["celery", "--app", "src.worker.tasks.terraform_worker", "worker", "--loglevel=info", "-c", "10", "-E", "-Q", "squad"] + - name: PATH + value: "/home/sld/.asdf/shims:/home/sld/.asdf/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + command: ["python", "-m", "celery", "--app", "src.worker.tasks.terraform_worker", "worker", "--loglevel=info", "-c", "8", "-E", "-Q", "squad"] diff --git a/play-with-sld/kubernetes/k8s/sld-worker-squad1.yml b/play-with-sld/kubernetes/k8s/sld-worker-squad1.yml index 976e586a..07a954f8 100644 --- a/play-with-sld/kubernetes/k8s/sld-worker-squad1.yml +++ b/play-with-sld/kubernetes/k8s/sld-worker-squad1.yml @@ -17,9 +17,11 @@ spec: subdomain: primary containers: - name: stack-deploy-worker-squad1 - image: d10s0vsky/sld-api:latest + image: d10s0vsky/sld-api:2.18.0 imagePullPolicy: Always env: - name: TF_WARN_OUTPUT_ERRORS value: "1" - command: ["celery", "--app", "src.worker.tasks.terraform_worker", "worker", "--loglevel=info", "-c", "8", "-E", "-Q", "any,squad1"] + - name: PATH + value: "/home/sld/.asdf/shims:/home/sld/.asdf/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + command: ["python", "-m", "celery", "--app", "src.worker.tasks.terraform_worker", "worker", "--loglevel=info", "-c", "8", "-E", "-Q", "any,squad1"] diff --git a/play-with-sld/kubernetes/k8s/sld-worker-squad2.yml b/play-with-sld/kubernetes/k8s/sld-worker-squad2.yml index 87718fec..c0b3f26e 100644 --- a/play-with-sld/kubernetes/k8s/sld-worker-squad2.yml +++ b/play-with-sld/kubernetes/k8s/sld-worker-squad2.yml @@ -17,9 +17,11 @@ spec: subdomain: primary containers: - name: stack-deploy-worker-squad2 - image: d10s0vsky/sld-api:latest + image: d10s0vsky/sld-api:2.18.0 imagePullPolicy: Always env: - name: TF_WARN_OUTPUT_ERRORS value: "1" - command: ["celery", "--app", "src.worker.tasks.terraform_worker", "worker", "--loglevel=info", "-c", "8", "-E", "-Q", "any,squad2"] + - name: PATH + value: "/home/sld/.asdf/shims:/home/sld/.asdf/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + command: ["python", "-m", "celery", "--app", "src.worker.tasks.terraform_worker", "worker", "--loglevel=info", "-c", "8", "-E", "-Q", "any,squad2"] diff --git a/sld-remote-state/configs/azure_blob_storage.py b/sld-remote-state/configs/azure_blob_storage.py index 84c1c9a7..c0dc11f5 100644 --- a/sld-remote-state/configs/azure_blob_storage.py +++ b/sld-remote-state/configs/azure_blob_storage.py @@ -2,7 +2,8 @@ import os -from pydantic import BaseSettings +from pydantic_settings import BaseSettings + class Settings(BaseSettings): diff --git a/sld-remote-state/configs/bucket_s3.py b/sld-remote-state/configs/bucket_s3.py index 7e189e66..ba21375f 100644 --- a/sld-remote-state/configs/bucket_s3.py +++ b/sld-remote-state/configs/bucket_s3.py @@ -1,6 +1,6 @@ import os -from pydantic import BaseSettings +from pydantic_settings import BaseSettings class Settings(BaseSettings): diff --git a/sld-remote-state/configs/gcp_cloud_storage.py b/sld-remote-state/configs/gcp_cloud_storage.py index 66ef2aaf..61ebb07d 100644 --- a/sld-remote-state/configs/gcp_cloud_storage.py +++ b/sld-remote-state/configs/gcp_cloud_storage.py @@ -2,7 +2,7 @@ import os -from pydantic import BaseSettings +from pydantic_settings import BaseSettings class Settings(BaseSettings): diff --git a/sld-remote-state/configs/mongo_db.py b/sld-remote-state/configs/mongo_db.py index 1387ba5c..0bf2fd3c 100644 --- a/sld-remote-state/configs/mongo_db.py +++ b/sld-remote-state/configs/mongo_db.py @@ -1,6 +1,6 @@ import os -from pydantic import BaseSettings +from pydantic_settings import BaseSettings class Settings(BaseSettings):