From 84c9eaa0f951984a36d34b3dead80eceb08f8144 Mon Sep 17 00:00:00 2001 From: Antony Natale <43508092+tonytheleg@users.noreply.github.com> Date: Wed, 25 Sep 2024 02:49:25 -0400 Subject: [PATCH] updates deploy file to fix deployment issues in stage (#160) --- deploy/kessel-inventory.yaml | 54 ++++++++++++++++++++++++++---------- 1 file changed, 39 insertions(+), 15 deletions(-) diff --git a/deploy/kessel-inventory.yaml b/deploy/kessel-inventory.yaml index bda9b2e0..7e9be75f 100644 --- a/deploy/kessel-inventory.yaml +++ b/deploy/kessel-inventory.yaml @@ -11,19 +11,21 @@ objects: POSTGRESQL_DATABASE: authz POSTGRESQL_USER: authz POSTGRESQL_PASSWORD: SuperSecretPassword + - apiVersion: v1 kind: ConfigMap metadata: name: inventory-api-config data: - server-config.yaml: | + inventory-api-config.yaml: | server: http: address: 0.0.0.0:8081 grpc: address: 0.0.0.0:9081 authn: - allow-unauthenticated: true + psk: + pre-shared-key-file: /psks/psks.yaml authz: impl: allow-all eventing: @@ -34,11 +36,24 @@ objects: sqlite3: dsn: inventory.db postgres: - host: "invdatabase" - port: "5433" + host: "invpostgres" + port: "5432" user: "authz" password: "SuperSecretPassword" dbname: "authz" + + - apiVersion: v1 + kind: ConfigMap + metadata: + name: psks + data: + psks.yaml: | + "1234": + tenant: "Example" + principal: "user@example.com" + is_reporter: true + type: "REPORTER_TYPE_ACM" + - apiVersion: apps/v1 kind: Deployment metadata: @@ -87,6 +102,7 @@ objects: cpu: 30m memory: 128Mi restartPolicy: Always + - apiVersion: v1 kind: Service metadata: @@ -100,6 +116,7 @@ objects: protocol: TCP selector: app: invpostgres + - apiVersion: cloud.redhat.com/v1alpha1 kind: ClowdApp metadata: @@ -108,35 +125,42 @@ objects: envName: ${ENV_NAME} # testing: # iqePlugin: inventory_api - replicas: 1 deployments: - name: api + replicas: 1 podSpec: + initContainers: + - name: migration + image: ${INVENTORY_IMAGE}:${INVENTORY_IMAGE_TAG} + command: ["inventory-api"] + args: ["migrate"] + inheritEnv: true image: ${INVENTORY_IMAGE}:${INVENTORY_IMAGE_TAG} command: ["inventory-api"] args: ["serve"] livenessProbe: httpGet: path: /api/inventory/v1/livez - port: 8000 + port: 8081 readinessProbe: httpGet: path: /api/inventory/v1/readyz - port: 8000 + port: 8081 env: - - name: INVENTORY_API_CONFIG - value: "/inventory-api-compose.yaml" + - name: INVENTORY_API_CONFIG + value: "/inventory/inventory-api-config.yaml" volumeMounts: - name: config-volume - mountPath: /inventory-api-compose.yaml - subPath: inventory-api-compose.yaml -# - name: psks-volume -# mountPath: /psks.yaml -# subPath: psks.yaml + mountPath: "/inventory" + - name: psks-volume + mountPath: /psks volumes: - name: config-volume configMap: name: inventory-api-config + - name: psks-volume + configMap: + name: psks webServices: public: enabled: true @@ -147,7 +171,7 @@ parameters: required: true - description: App Image name: INVENTORY_IMAGE - value: quay.io/redhat-services-prod/project-kessel-tenant/kessel-inventory-main/inventory-api-main + value: quay.io/redhat-services-prod/project-kessel-tenant/kessel-inventory/inventory-api - description: Image Tag name: INVENTORY_IMAGE_TAG value: latest