Skip to content

Commit 768599c

Browse files
committed
feat: move to llsd for ca bundle and run.yaml config
Signed-off-by: Doug Edgar <dedgar@redhat.com>
1 parent 68d3c6a commit 768599c

19 files changed

+680
-1676
lines changed

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,13 @@ spec:
9494
```
9595
3. Verify the server pod is running in the user defined namespace.
9696

97-
### Using a ConfigMap for run.yaml configuration
97+
### Using inline configuration
9898

99-
A ConfigMap can be used to store run.yaml configuration for each LlamaStackDistribution.
100-
Updates to the ConfigMap will restart the Pod to load the new data.
99+
You can provide custom run.yaml configuration directly in the LlamaStackDistribution spec using the `userConfig.customConfig` field. The operator will automatically create and manage a ConfigMap containing this configuration.
101100

102-
Example to create a run.yaml ConfigMap, and a LlamaStackDistribution that references it:
101+
Example to create a LlamaStackDistribution with a custom run.yaml configuration:
103102
```
104-
kubectl apply -f config/samples/example-with-configmap.yaml
103+
kubectl apply -f config/samples/example-with-custom-config.yaml
105104
```
106105

107106
## Developer Guide

api/v1alpha1/llamastackdistribution_types.go

Lines changed: 7 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 1 addition & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/llamastack.io_llamastackdistributions.yaml

Lines changed: 8 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2006,44 +2006,20 @@ spec:
20062006
server
20072007
properties:
20082008
caBundle:
2009-
description: CABundle defines the CA bundle configuration
2010-
for custom certificates
2011-
properties:
2012-
configMapKeys:
2013-
description: |-
2014-
ConfigMapKeys specifies multiple keys within the ConfigMap containing CA bundle data
2015-
All certificates from these keys will be concatenated into a single CA bundle file
2016-
If not specified, defaults to [DefaultCABundleKey]
2017-
items:
2018-
type: string
2019-
maxItems: 50
2020-
type: array
2021-
configMapName:
2022-
description: ConfigMapName is the name of the ConfigMap
2023-
containing CA bundle certificates
2024-
type: string
2025-
configMapNamespace:
2026-
description: ConfigMapNamespace is the namespace of the
2027-
ConfigMap (defaults to the same namespace as the CR)
2028-
type: string
2029-
required:
2030-
- configMapName
2031-
type: object
2009+
description: |-
2010+
CABundle contains PEM-encoded CA bundle certificates as inline data
2011+
The operator automatically creates and manages a ConfigMap for mounting into the llama-stack pod
2012+
type: string
20322013
type: object
20332014
userConfig:
20342015
description: UserConfig defines the user configuration for the
20352016
llama-stack server
20362017
properties:
2037-
configMapName:
2038-
description: ConfigMapName is the name of the ConfigMap containing
2039-
user configuration
2040-
type: string
2041-
configMapNamespace:
2042-
description: ConfigMapNamespace is the namespace of the ConfigMap
2043-
(defaults to the same namespace as the CR)
2018+
customConfig:
2019+
description: |-
2020+
CustomConfig contains arbitrary text data that represents a user-provided run.yamlconfiguration file
2021+
The operator automatically creates and manages a ConfigMap for mounting into the llama-stack pod
20442022
type: string
2045-
required:
2046-
- configMapName
20472023
type: object
20482024
required:
20492025
- distribution
@@ -2196,11 +2172,6 @@ spec:
21962172
required:
21972173
- spec
21982174
type: object
2199-
selectableFields:
2200-
- jsonPath: .spec.server.userConfig.configMapName
2201-
- jsonPath: .spec.server.userConfig.configMapNamespace
2202-
- jsonPath: .spec.server.tlsConfig.caBundle.configMapName
2203-
- jsonPath: .spec.server.tlsConfig.caBundle.configMapNamespace
22042175
served: true
22052176
storage: true
22062177
subresources:

config/rbac/role.yaml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ rules:
88
- ""
99
resources:
1010
- configmaps
11+
- serviceaccounts
12+
- services
1113
verbs:
1214
- create
15+
- delete
1316
- get
1417
- list
1518
- patch
@@ -24,19 +27,6 @@ rules:
2427
- get
2528
- list
2629
- watch
27-
- apiGroups:
28-
- ""
29-
resources:
30-
- serviceaccounts
31-
- services
32-
verbs:
33-
- create
34-
- delete
35-
- get
36-
- list
37-
- patch
38-
- update
39-
- watch
4030
- apiGroups:
4131
- apps
4232
resources:
Lines changed: 21 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,7 @@
1-
apiVersion: v1
2-
kind: ConfigMap
3-
metadata:
4-
name: llama-stack-config
5-
data:
6-
run.yaml: |
7-
# Llama Stack Configuration
8-
version: '2'
9-
image_name: remote-vllm
10-
apis:
11-
- inference
12-
providers:
13-
inference:
14-
- provider_id: vllm
15-
provider_type: "remote::vllm"
16-
config:
17-
url: "https://vllm-server.vllm-dist.svc.cluster.local:8000/v1"
18-
models:
19-
- model_id: "meta-llama/Llama-3.2-1B-Instruct"
20-
provider_id: vllm
21-
model_type: llm
22-
server:
23-
port: 8321
24-
---
251
apiVersion: llamastack.io/v1alpha1
262
kind: LlamaStackDistribution
273
metadata:
28-
name: llamastack-with-config
4+
name: llamastack-with-ca-bundle
295
spec:
306
replicas: 1
317
server:
@@ -41,13 +17,24 @@ spec:
4117
- name: VLLM_TLS_VERIFY
4218
value: "/etc/ssl/certs/ca-bundle.crt"
4319
userConfig:
44-
configMapName: llama-stack-config
45-
# configMapNamespace: "" # Optional - defaults to the same namespace as the CR
20+
customConfig: |
21+
# Llama Stack Configuration
22+
version: '2'
23+
image_name: remote-vllm
24+
apis:
25+
- inference
26+
providers:
27+
inference:
28+
- provider_id: vllm
29+
provider_type: "remote::vllm"
30+
config:
31+
url: "https://vllm-server.vllm-dist.svc.cluster.local:8000/v1"
32+
models:
33+
- model_id: "meta-llama/Llama-3.2-1B-Instruct"
34+
provider_id: vllm
35+
model_type: llm
36+
server:
37+
port: 8321
4638
tlsConfig:
47-
caBundle:
48-
configMapName: custom-ca-bundle
49-
# configMapNamespace: "" # Optional - defaults to the same namespace as the CR
50-
# configMapKeys not specified - defaults to ["ca-bundle.crt"]
51-
# configMapKeys: # Specify multiple keys to concatenate into ca-bundle.crt
52-
# - ca-bundle1.crt
53-
# - ca-bundle2.crt
39+
# caBundle must contain valid PEM formatted data
40+
caBundle: "PLACEHOLDER_CA_BUNDLE"

config/samples/example-with-configmap.yaml

Lines changed: 0 additions & 43 deletions
This file was deleted.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
apiVersion: llamastack.io/v1alpha1
3+
kind: LlamaStackDistribution
4+
metadata:
5+
name: llamastack-with-custom-config
6+
spec:
7+
replicas: 1
8+
server:
9+
distribution:
10+
name: ollama
11+
containerSpec:
12+
port: 8321
13+
env:
14+
- name: INFERENCE_MODEL
15+
value: "llama3.2:1b"
16+
- name: OLLAMA_URL
17+
value: "http://ollama-server-service.ollama-dist.svc.cluster.local:11434"
18+
userConfig:
19+
customConfig: |
20+
# Llama Stack run.yaml Configuration
21+
version: '2'
22+
image_name: ollama
23+
apis:
24+
- inference
25+
providers:
26+
inference:
27+
- provider_id: ollama
28+
provider_type: "remote::ollama"
29+
config:
30+
url: "http://ollama-server-service.ollama-dist.svc.cluster.local:11434"
31+
models:
32+
- model_id: "llama3.2:1b"
33+
provider_id: ollama
34+
model_type: llm
35+
server:
36+
port: 8321

controllers/kubebuilder_rbac.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ package controllers
2222

2323
//+kubebuilder:rbac:groups="",resources=persistentvolumeclaims,verbs=get;list;watch;create
2424

25-
// ConfigMap permissions - controller reads user configmaps and manages operator config configmaps
26-
//+kubebuilder:rbac:groups="",resources=configmaps,verbs=get;list;watch;create;update;patch
25+
// ConfigMap permissions - controller creates and manages operator-owned configmaps for CA bundles and user config
26+
//+kubebuilder:rbac:groups="",resources=configmaps,verbs=get;list;watch;create;update;patch;delete
2727

2828
// NetworkPolicy permissions - controller creates and manages network policies
2929
//+kubebuilder:rbac:groups=networking.k8s.io,resources=networkpolicies,verbs=get;list;watch;create;update;patch;delete

0 commit comments

Comments
 (0)