Skip to content

Commit bf6a1a6

Browse files
authored
Merge branch 'main' into bump-k8s-deps
2 parents 640ce4e + c8080eb commit bf6a1a6

File tree

6 files changed

+61
-17
lines changed

6 files changed

+61
-17
lines changed

.github/workflows/generate-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ jobs:
101101
make release VERSION=${{ steps.validate.outputs.operator_version }} LLAMASTACK_VERSION=${{ steps.validate.outputs.llamastack_version }}
102102
103103
- name: Set up Python
104-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
104+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
105105
with:
106106
python-version: '3.12'
107107

README.md

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ This repo hosts a kubernetes operator that is responsible for creating and manag
1515
- [Quick Start](#quick-start)
1616
- [Installation](#installation)
1717
- [Deploying Llama Stack Server](#deploying-the-llama-stack-server)
18+
- [Enabling Network Policies](#enabling-network-policies)
1819
- [Developer Guide](#developer-guide)
1920
- [Prerequisites](#prerequisites)
2021
- [Building the Operator](#building-the-operator)
@@ -80,11 +81,10 @@ spec:
8081
replicas: 1
8182
server:
8283
distribution:
83-
name: ollama
84+
name: starter
8485
containerSpec:
85-
port: 8321
8686
env:
87-
- name: INFERENCE_MODEL
87+
- name: OLLAMA_INFERENCE_MODEL
8888
value: "llama3.2:1b"
8989
- name: OLLAMA_URL
9090
value: "http://ollama-server-service.ollama-dist.svc.cluster.local:11434"
@@ -104,6 +104,36 @@ Example to create a run.yaml ConfigMap, and a LlamaStackDistribution that refere
104104
kubectl apply -f config/samples/example-with-configmap.yaml
105105
```
106106

107+
## Enabling Network Policies
108+
109+
The operator can create an ingress-only `NetworkPolicy` for every `LlamaStackDistribution` to ensure traffic is limited to:
110+
- Other pods in the same namespace that are part of the Llama Stack deployment (`app.kubernetes.io/part-of: llama-stack`)
111+
- Components that run inside the operator namespace (default: `llama-stack-k8s-operator-system`)
112+
113+
This behavior is guarded by a feature flag and is disabled by default to avoid interfering with existing cluster-level policies. To enable it:
114+
115+
1. Identify the namespace where the operator is running. If you used the provided manifests, it is `llama-stack-k8s-operator-system`.
116+
2. Create or update the `llama-stack-operator-config` ConfigMap in that namespace so the `featureFlags` entry enables the network policy flag.
117+
118+
```bash
119+
cat <<'EOF' > feature-flags.yaml
120+
apiVersion: v1
121+
kind: ConfigMap
122+
metadata:
123+
name: llama-stack-operator-config
124+
namespace: llama-stack-k8s-operator-system
125+
data:
126+
featureFlags: |
127+
enableNetworkPolicy:
128+
enabled: true
129+
EOF
130+
131+
kubectl apply -f feature-flags.yaml
132+
```
133+
134+
Within the next reconciliation loop the operator will begin creating a `<name>-network-policy` resource for each distribution.
135+
Set `enabled: false` (or remove the block) to turn the feature back off; the operator will delete the previously managed policies.
136+
107137
## Developer Guide
108138

109139
### Prerequisites

config/samples/_v1alpha1_llamastackdistribution.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ spec:
77
server:
88
containerSpec:
99
env:
10-
- name: INFERENCE_MODEL
10+
- name: OLLAMA_INFERENCE_MODEL
1111
value: 'llama3.2:1b'
1212
- name: OLLAMA_URL
1313
value: 'http://ollama-server-service.ollama-dist.svc.cluster.local:11434'

config/samples/example-with-configmap.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ data:
4848
apiVersion: llamastack.io/v1alpha1
4949
kind: LlamaStackDistribution
5050
metadata:
51-
name: llamastack-with-config
51+
name: llamastack-with-userconfig
5252
spec:
5353
replicas: 1
5454
server:
@@ -57,10 +57,8 @@ spec:
5757
containerSpec:
5858
port: 8321
5959
env:
60-
- name: INFERENCE_MODEL
61-
value: "llama3.2:1b"
62-
- name: OLLAMA_URL
63-
value: "http://ollama-server-service.ollama-dist.svc.cluster.local:11434"
60+
- name: OLLAMA_EMBEDDING_MODEL
61+
value: all-minilm:l6-v2
6462
userConfig:
6563
configMapName: llama-stack-config
6664
# configMapNamespace: "" # Optional - defaults to the same namespace as the CR
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
apiVersion: llamastack.io/v1alpha1
3+
kind: LlamaStackDistribution
4+
metadata:
5+
name: llamastack-without-userconfig
6+
spec:
7+
replicas: 1
8+
server:
9+
distribution:
10+
name: starter
11+
containerSpec:
12+
env:
13+
- name: OLLAMA_INFERENCE_MODEL
14+
value: "llama3.2:1b"
15+
- name: OLLAMA_URL
16+
value: "http://ollama-server-service.ollama-dist.svc.cluster.local:11434"
17+
storage:
18+
size: "10Gi" # Optional - defaults to 10Gi
19+
mountPath: "/home/lls/.lls" # Optional - defaults to /.llama

distributions.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
{
2-
"starter": "docker.io/llamastack/distribution-starter:latest",
3-
"ollama": "docker.io/llamastack/distribution-ollama:latest",
4-
"bedrock": "docker.io/llamastack/distribution-bedrock:latest",
5-
"remote-vllm": "docker.io/llamastack/distribution-remote-vllm:latest",
6-
"tgi": "docker.io/llamastack/distribution-tgi:latest",
7-
"together": "docker.io/llamastack/distribution-together:latest",
8-
"vllm-gpu": "docker.io/llamastack/distribution-vllm-gpu:latest"
2+
"starter": "docker.io/llamastack/distribution-starter:latest",
3+
"remote-vllm": "docker.io/llamastack/distribution-remote-vllm:latest",
4+
"meta-reference-gpu": "docker.io/llamastack/distribution-meta-reference-gpu:latest",
5+
"postgres-demo": "docker.io/llamastack/distribution-postgres-demo:latest"
96
}

0 commit comments

Comments
 (0)