diff --git a/helm/templates/deployment.yaml b/helm/templates/deployment.yaml index 870a09b..29930f4 100644 --- a/helm/templates/deployment.yaml +++ b/helm/templates/deployment.yaml @@ -55,6 +55,8 @@ spec: value: {{ .Values.images.provider_generic }} - name: RELATED_IMAGE_PROVIDER_JAVA value: {{ .Values.images.provider_java }} + - name: RELATED_IMAGE_KAI + value: {{ .Values.images.kai }} name: tackle-operator image: {{ .Values.images.operator }} imagePullPolicy: Always diff --git a/helm/values.yaml b/helm/values.yaml index e467406..3a4f76c 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -21,4 +21,5 @@ images: addon_analyzer: quay.io/konveyor/tackle2-addon-analyzer:latest addon_discovery: quay.io/konveyor/tackle2-addon-discovery:latest provider_generic: quay.io/konveyor/generic-external-provider:latest - provider_java: quay.io/konveyor/java-external-provider:latest \ No newline at end of file + provider_java: quay.io/konveyor/java-external-provider:latest + kai: quay.io/konveyor/kai:latest diff --git a/roles/tackle/defaults/main.yml b/roles/tackle/defaults/main.yml index c59682f..e85e017 100644 --- a/roles/tackle/defaults/main.yml +++ b/roles/tackle/defaults/main.yml @@ -245,3 +245,4 @@ kai_database_image_fqin: "{{ keycloak_database_image_fqin }}" kai_database_secret_name: kai-db-secret kai_database_volume_size: "10Gi" kai_database_volume_claim_name: "{{ hub_service_name }}-kai-database-volume-claim" +kai_database_address: kai-db.{{ app_namespace }}.svc diff --git a/roles/tackle/tasks/kai.yml b/roles/tackle/tasks/kai.yml index 7c75908..522e5e7 100644 --- a/roles/tackle/tasks/kai.yml +++ b/roles/tackle/tasks/kai.yml @@ -41,7 +41,7 @@ name: "{{ kai_database_secret_name }}" namespace: "{{ app_namespace }}" stringData: - POSTGRES_HOST: kai-db + POSTGRES_HOST: "{{ kai_database_address }}" POSTGRES_DB: kai POSTGRES_PASSWORD: "{{ pg_password }}" POSTGRES_USER: kai diff --git a/roles/tackle/templates/kai/kai-api-deployment.yaml.j2 b/roles/tackle/templates/kai/kai-api-deployment.yaml.j2 index 2dcf682..0a229b1 100644 --- a/roles/tackle/templates/kai/kai-api-deployment.yaml.j2 +++ b/roles/tackle/templates/kai/kai-api-deployment.yaml.j2 @@ -16,7 +16,6 @@ spec: spec: containers: - name: kai-api - # TODO: Update image variable image: "{{ kai_fqin }}" ports: - containerPort: 8080 @@ -53,21 +52,27 @@ spec: value: "8" - name: USE_HUB_IMPORTER value: "True" +{% if kai_api_key_secret_status.resources.0.data[kai_bam_secret_key]|default(false) %} - name: GENAI_KEY valueFrom: secretKeyRef: name: "{{ kai_api_key_secret_name }}" key: "{{ kai_bam_secret_key }}" +{% endif %} +{% if kai_api_key_secret_status.resources.0.data[kai_openai_secret_base_key]|default(false) %} - name: OPENAI_API_BASE valueFrom: secretKeyRef: name: "{{ kai_api_key_secret_name }}" key: "{{ kai_openai_secret_base_key }}" +{% endif %} +{% if kai_api_key_secret_status.resources.0.data[kai_openai_secret_api_key]|default(false) %} - name: OPENAI_API_KEY valueFrom: secretKeyRef: name: "{{ kai_api_key_secret_name }}" key: "{{ kai_openai_secret_api_key }}" +{% endif %} volumeMounts: - name: config-volume mountPath: /podman_compose/kai-config.toml diff --git a/roles/tackle/templates/kai/kai-config.yaml.j2 b/roles/tackle/templates/kai/kai-config.yaml.j2 index cb048c2..f2240f8 100644 --- a/roles/tackle/templates/kai/kai-config.yaml.j2 +++ b/roles/tackle/templates/kai/kai-config.yaml.j2 @@ -7,7 +7,7 @@ metadata: data: kai-config.toml: | # TODO: Make all these configurable via ansible - log_level = "{{ kai_loglevel }}" + log_level = "{{ kai_log_level }}" file_log_level = "debug" log_dir = "/podman_compose/logs" demo_mode = {{ kai_enable_demo_mode }} diff --git a/roles/tackle/templates/kai/kai-db-deployment.yaml.j2 b/roles/tackle/templates/kai/kai-db-deployment.yaml.j2 index 3e55ae1..6b37d56 100644 --- a/roles/tackle/templates/kai/kai-db-deployment.yaml.j2 +++ b/roles/tackle/templates/kai/kai-db-deployment.yaml.j2 @@ -16,19 +16,19 @@ spec: spec: containers: - name: kai-db - image: "{{ kai_fqin }}" + image: "{{ kai_database_image_fqin }}" env: - - name: POSTGRES_DB + - name: POSTGRESQL_DATABASE valueFrom: secretKeyRef: name: "{{ kai_db_secret_name }}" key: POSTGRES_DB - - name: POSTGRES_PASSWORD + - name: POSTGRESQL_PASSWORD valueFrom: secretKeyRef: name: "{{ kai_db_secret_name }}" key: POSTGRES_PASSWORD - - name: POSTGRES_USER + - name: POSTGRESQL_USER valueFrom: secretKeyRef: name: "{{ kai_db_secret_name }}" diff --git a/roles/tackle/templates/kai/kai-importer-deployment.yaml.j2 b/roles/tackle/templates/kai/kai-importer-deployment.yaml.j2 index 531f016..3f34a03 100644 --- a/roles/tackle/templates/kai/kai-importer-deployment.yaml.j2 +++ b/roles/tackle/templates/kai/kai-importer-deployment.yaml.j2 @@ -16,7 +16,7 @@ spec: spec: containers: - name: kai-hub-importer - image: "{{ kai_dqin }}" + image: "{{ kai_fqin }}" env: - name: POSTGRES_HOST valueFrom: @@ -52,26 +52,32 @@ spec: value: "True" - name: MODE value: "importer" + - name: JWT + valueFrom: + secretKeyRef: + name: "{{ kai_jwt_secret_name }}" + key: jwt +{% if kai_api_key_secret_status.resources.0.data[kai_bam_secret_key]|default(false) %} - name: GENAI_KEY valueFrom: secretKeyRef: name: "{{ kai_api_key_secret_name }}" key: "{{ kai_bam_secret_key }}" +{% endif %} +{% if kai_api_key_secret_status.resources.0.data[kai_openai_secret_base_key]|default(false) %} - name: OPENAI_API_BASE valueFrom: secretKeyRef: name: "{{ kai_api_key_secret_name }}" key: "{{ kai_openai_secret_base_key }}" +{% endif %} +{% if kai_api_key_secret_status.resources.0.data[kai_openai_secret_api_key]|default(false) %} - name: OPENAI_API_KEY valueFrom: secretKeyRef: name: "{{ kai_api_key_secret_name }}" key: "{{ kai_openai_secret_api_key }}" - - name: JWT - valueFrom: - secretKeyRef: - name: "{{ kai_jwt_secret_name }}" - key: jwt +{% endif %} volumeMounts: - name: config-volume mountPath: /podman_compose/kai-config.toml