Skip to content

Commit 65b8db0

Browse files
committed
Fix condition guarding for kai tasks, handling of trusted_ca_bundle
Signed-off-by: Fabian von Feilitzsch <[email protected]>
1 parent 16dc436 commit 65b8db0

File tree

4 files changed

+27
-32
lines changed

4 files changed

+27
-32
lines changed

roles/tackle/defaults/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ kai_log_level: info
277277
kai_enable_demo_mode: "false"
278278
kai_enable_trace: "true"
279279

280+
280281
kai_llm_model: null
281282
kai_llm_provider: null
282283
kai_llm_baseurl: null
@@ -297,7 +298,9 @@ kai_llm_params:
297298
base_url: "{{ kai_llm_baseurl }}"
298299
kwargs: "{{ kai_llm_model_specific_kwargs }}"
299300

301+
300302
# LLM params when using the proxy - points to the local llm-proxy service
303+
kai_llm_proxy_provider_id: "{{ kai_llm_provider }}"
301304
kai_llm_params_proxy:
302305
model: "{{ kai_llm_proxy_provider_id }}/{{ kai_llm_model }}"
303306
model_provider: "openai_api"
@@ -338,7 +341,6 @@ kai_llm_proxy_provider_type_map:
338341

339342
# Computed provider type - uses map or falls back to remote::<provider_name>
340343
kai_llm_proxy_provider_type: "{{ kai_llm_proxy_provider_type_map[kai_llm_provider] | default('remote::' + kai_llm_provider) if kai_llm_provider else 'remote::openai' }}"
341-
kai_llm_proxy_provider_id: "{{ kai_llm_provider | default('openai') }}"
342344

343345
# API key environment variable name - map provider to expected env var
344346
kai_llm_proxy_api_key_env_map:

roles/tackle/tasks/kai.yml

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,15 @@
11
---
22

3-
- name: Verify API key secret is defined
4-
k8s_info:
5-
api_version: v1
6-
kind: Secret
7-
name: "{{ kai_api_key_secret_name }}"
8-
namespace: "{{ app_namespace }}"
9-
register: kai_api_key_secret_status
10-
11-
- name: Verify kai-api-key-secret has been created
12-
when: (kai_api_key_secret_status.resources|length) == 0
13-
debug:
14-
msg: >
15-
The Kai Solution Server will not be able to serve advanced insights until the credential secret exists.
16-
kubectl create secret -n {{ app_namespace }} generic {{ kai_api_key_secret_name }} --from-literal=<your service's environment variable>=<your API key>
17-
for example
18-
kubectl create secret -n {{ app_namespace }} generic {{ kai_api_key_secret_name }} --from-literal=OPENAI_API_KEY=sk-thisisafakekey
19-
20-
- when: (kai_api_key_secret_status.resources|length) > 0
3+
- when: kai_llm_proxy_enabled|bool or kai_solution_server_enabled|bool
214
block:
5+
- name: Get API key secret
6+
k8s_info:
7+
api_version: v1
8+
kind: Secret
9+
name: "{{ kai_api_key_secret_name }}"
10+
namespace: "{{ app_namespace }}"
11+
register: kai_api_key_secret_status
12+
2213
- name: Check if DB secret is defined
2314
k8s_info:
2415
api_version: v1
@@ -92,16 +83,19 @@
9283
state: present
9384
template: kai/llm-proxy-client-configmap.yaml.j2
9485

95-
- name: Create Kai API deployment
96-
k8s:
97-
state: present
98-
template: kai/kai-api-deployment.yaml.j2
99-
merge_type: merge
86+
- name: Deploy Solution server
87+
when: kai_solution_server_enabled | bool
88+
block:
89+
- name: Create Kai API deployment
90+
k8s:
91+
state: present
92+
template: kai/kai-api-deployment.yaml.j2
93+
merge_type: merge
10094

101-
- name: Create KAI API Service
102-
k8s:
103-
state: present
104-
template: kai/kai-api-service.yaml.j2
95+
- name: Create KAI API Service
96+
k8s:
97+
state: present
98+
template: kai/kai-api-service.yaml.j2
10599

106100
- name: Update Kai component status conditions
107101
when: ansible_operator_meta is defined

roles/tackle/tasks/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,5 +916,4 @@
916916
msg: "kai_solution_server_enabled = {{ kai_solution_server_enabled }}, will run kai tasks = {{ kai_solution_server_enabled | bool }}"
917917

918918
- name: Run kai tasks
919-
when: kai_solution_server_enabled | bool
920919
import_tasks: kai.yml

roles/tackle/templates/kai/llm-proxy-deployment.yaml.j2

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ spec:
8686
readOnly: true
8787
- name: tmp
8888
mountPath: /tmp
89-
{% if feature_auth_required and keycloak_sso_proto == 'https' %}
89+
{% if trusted_ca_enabled | default(false) | bool %}
9090
- name: trusted-ca
9191
mountPath: /etc/pki/ca-trust/source/anchors
9292
readOnly: true
@@ -104,12 +104,12 @@ spec:
104104
name: llm-proxy
105105
- name: tmp
106106
emptyDir: {}
107-
{% if feature_auth_required and keycloak_sso_proto == 'https' %}
107+
{% if trusted_ca_enabled | default(false) | bool %}
108108
- name: trusted-ca
109109
configMap:
110110
name: trusted-ca
111111
items:
112112
- key: ca-bundle.crt
113113
path: ca.crt
114114
optional: true
115-
{% endif %}
115+
{% endif %}

0 commit comments

Comments
 (0)