Skip to content

Commit 2c4093a

Browse files
committed
Create RBAC and ConfigMap before deployment
Signed-off-by: Shmuel Kallner <[email protected]>
1 parent f464495 commit 2c4093a

File tree

2 files changed

+166
-166
lines changed

2 files changed

+166
-166
lines changed

test/testdata/inferencepool-e2e.yaml

Lines changed: 81 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,87 @@ metadata:
3737
name: vllm-llama3-8b-instruct-epp
3838
namespace: $E2E_NS
3939
---
40+
kind: Role
41+
apiVersion: rbac.authorization.k8s.io/v1
42+
metadata:
43+
name: pod-read
44+
namespace: $E2E_NS
45+
rules:
46+
- apiGroups: [ "inference.networking.x-k8s.io" ]
47+
resources: [ "inferenceobjectives", "inferencepools" ]
48+
verbs: [ "get", "watch", "list" ]
49+
- apiGroups: [ "inference.networking.k8s.io" ]
50+
resources: [ "inferencepools" ]
51+
verbs: [ "get", "watch", "list" ]
52+
- apiGroups: [ "" ]
53+
resources: [ "pods" ]
54+
verbs: [ "get", "watch", "list" ]
55+
---
56+
kind: RoleBinding
57+
apiVersion: rbac.authorization.k8s.io/v1
58+
metadata:
59+
name: pod-read-binding
60+
namespace: $E2E_NS
61+
subjects:
62+
- kind: ServiceAccount
63+
name: vllm-llama3-8b-instruct-epp
64+
namespace: $E2E_NS
65+
roleRef:
66+
apiGroup: rbac.authorization.k8s.io
67+
kind: Role
68+
name: pod-read
69+
---
70+
kind: ClusterRole
71+
apiVersion: rbac.authorization.k8s.io/v1
72+
metadata:
73+
name: auth-reviewer
74+
rules:
75+
- apiGroups:
76+
- authentication.k8s.io
77+
resources:
78+
- tokenreviews
79+
verbs:
80+
- create
81+
- apiGroups:
82+
- authorization.k8s.io
83+
resources:
84+
- subjectaccessreviews
85+
verbs:
86+
- create
87+
---
88+
kind: ClusterRoleBinding
89+
apiVersion: rbac.authorization.k8s.io/v1
90+
metadata:
91+
name: auth-reviewer-binding
92+
subjects:
93+
- kind: ServiceAccount
94+
name: vllm-llama3-8b-instruct-epp
95+
namespace: $E2E_NS
96+
roleRef:
97+
apiGroup: rbac.authorization.k8s.io
98+
kind: ClusterRole
99+
name: auth-reviewer
100+
---
101+
apiVersion: v1
102+
kind: ConfigMap
103+
metadata:
104+
name: plugins-config
105+
namespace: $E2E_NS
106+
data:
107+
default-plugins.yaml: |
108+
apiVersion: inference.networking.x-k8s.io/v1alpha1
109+
kind: EndpointPickerConfig
110+
plugins:
111+
- type: queue-scorer
112+
- type: kv-cache-utilization-scorer
113+
- type: prefix-cache-scorer
114+
schedulingProfiles:
115+
- name: default
116+
plugins:
117+
- pluginRef: queue-scorer
118+
- pluginRef: kv-cache-utilization-scorer
119+
- pluginRef: prefix-cache-scorer
120+
---
40121
apiVersion: apps/v1
41122
kind: Deployment
42123
metadata:
@@ -100,84 +181,3 @@ spec:
100181
- name: plugins-config-volume
101182
configMap:
102183
name: plugins-config
103-
---
104-
apiVersion: v1
105-
kind: ConfigMap
106-
metadata:
107-
name: plugins-config
108-
namespace: $E2E_NS
109-
data:
110-
default-plugins.yaml: |
111-
apiVersion: inference.networking.x-k8s.io/v1alpha1
112-
kind: EndpointPickerConfig
113-
plugins:
114-
- type: queue-scorer
115-
- type: kv-cache-utilization-scorer
116-
- type: prefix-cache-scorer
117-
schedulingProfiles:
118-
- name: default
119-
plugins:
120-
- pluginRef: queue-scorer
121-
- pluginRef: kv-cache-utilization-scorer
122-
- pluginRef: prefix-cache-scorer
123-
---
124-
kind: Role
125-
apiVersion: rbac.authorization.k8s.io/v1
126-
metadata:
127-
name: pod-read
128-
namespace: $E2E_NS
129-
rules:
130-
- apiGroups: [ "inference.networking.x-k8s.io" ]
131-
resources: [ "inferenceobjectives", "inferencepools" ]
132-
verbs: [ "get", "watch", "list" ]
133-
- apiGroups: [ "inference.networking.k8s.io" ]
134-
resources: [ "inferencepools" ]
135-
verbs: [ "get", "watch", "list" ]
136-
- apiGroups: [ "" ]
137-
resources: [ "pods" ]
138-
verbs: [ "get", "watch", "list" ]
139-
---
140-
kind: RoleBinding
141-
apiVersion: rbac.authorization.k8s.io/v1
142-
metadata:
143-
name: pod-read-binding
144-
namespace: $E2E_NS
145-
subjects:
146-
- kind: ServiceAccount
147-
name: vllm-llama3-8b-instruct-epp
148-
namespace: $E2E_NS
149-
roleRef:
150-
apiGroup: rbac.authorization.k8s.io
151-
kind: Role
152-
name: pod-read
153-
---
154-
kind: ClusterRole
155-
apiVersion: rbac.authorization.k8s.io/v1
156-
metadata:
157-
name: auth-reviewer
158-
rules:
159-
- apiGroups:
160-
- authentication.k8s.io
161-
resources:
162-
- tokenreviews
163-
verbs:
164-
- create
165-
- apiGroups:
166-
- authorization.k8s.io
167-
resources:
168-
- subjectaccessreviews
169-
verbs:
170-
- create
171-
---
172-
kind: ClusterRoleBinding
173-
apiVersion: rbac.authorization.k8s.io/v1
174-
metadata:
175-
name: auth-reviewer-binding
176-
subjects:
177-
- kind: ServiceAccount
178-
name: vllm-llama3-8b-instruct-epp
179-
namespace: $E2E_NS
180-
roleRef:
181-
apiGroup: rbac.authorization.k8s.io
182-
kind: ClusterRole
183-
name: auth-reviewer

test/testdata/inferencepool-leader-election-e2e.yaml

Lines changed: 85 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -35,91 +35,6 @@ metadata:
3535
name: vllm-llama3-8b-instruct-epp
3636
namespace: $E2E_NS
3737
---
38-
apiVersion: apps/v1
39-
kind: Deployment
40-
metadata:
41-
name: vllm-llama3-8b-instruct-epp
42-
namespace: $E2E_NS
43-
labels:
44-
app: vllm-llama3-8b-instruct-epp
45-
spec:
46-
replicas: 3
47-
selector:
48-
matchLabels:
49-
app: vllm-llama3-8b-instruct-epp
50-
template:
51-
metadata:
52-
labels:
53-
app: vllm-llama3-8b-instruct-epp
54-
spec:
55-
serviceAccountName: vllm-llama3-8b-instruct-epp
56-
# Conservatively, this timeout should mirror the longest grace period of the pods within the pool
57-
terminationGracePeriodSeconds: 130
58-
containers:
59-
- name: epp
60-
image: $E2E_IMAGE
61-
imagePullPolicy: IfNotPresent
62-
args:
63-
- --pool-name
64-
- "vllm-llama3-8b-instruct"
65-
- --pool-namespace
66-
- "$E2E_NS"
67-
- --v
68-
- "4"
69-
- --zap-encoder
70-
- "json"
71-
- --grpc-port
72-
- "9002"
73-
- --grpc-health-port
74-
- "9003"
75-
- --ha-enable-leader-election
76-
- "--config-file"
77-
- "/config/default-plugins.yaml"
78-
ports:
79-
- containerPort: 9002
80-
- containerPort: 9003
81-
- name: metrics
82-
containerPort: 9090
83-
livenessProbe:
84-
grpc:
85-
port: 9003
86-
service: liveness
87-
initialDelaySeconds: 5
88-
periodSeconds: 10
89-
readinessProbe:
90-
grpc:
91-
port: 9003
92-
service: readiness
93-
initialDelaySeconds: 5
94-
periodSeconds: 10
95-
volumeMounts:
96-
- name: plugins-config-volume
97-
mountPath: "/config"
98-
volumes:
99-
- name: plugins-config-volume
100-
configMap:
101-
name: plugins-config
102-
---
103-
apiVersion: v1
104-
kind: ConfigMap
105-
metadata:
106-
name: plugins-config
107-
namespace: $E2E_NS
108-
data:
109-
default-plugins.yaml: |
110-
apiVersion: inference.networking.x-k8s.io/v1alpha1
111-
kind: EndpointPickerConfig
112-
plugins:
113-
- type: queue-scorer
114-
- type: kv-cache-utilization-scorer
115-
- type: prefix-cache-scorer
116-
schedulingProfiles:
117-
- name: default
118-
plugins:
119-
- pluginRef: queue-scorer
120-
- pluginRef: kv-cache-utilization-scorer
121-
- pluginRef: prefix-cache-scorer
122-
---
12338
kind: Role
12439
apiVersion: rbac.authorization.k8s.io/v1
12540
metadata:
@@ -207,3 +122,88 @@ roleRef:
207122
apiGroup: rbac.authorization.k8s.io
208123
kind: ClusterRole
209124
name: auth-reviewer
125+
---
126+
apiVersion: v1
127+
kind: ConfigMap
128+
metadata:
129+
name: plugins-config
130+
namespace: $E2E_NS
131+
data:
132+
default-plugins.yaml: |
133+
apiVersion: inference.networking.x-k8s.io/v1alpha1
134+
kind: EndpointPickerConfig
135+
plugins:
136+
- type: queue-scorer
137+
- type: kv-cache-utilization-scorer
138+
- type: prefix-cache-scorer
139+
schedulingProfiles:
140+
- name: default
141+
plugins:
142+
- pluginRef: queue-scorer
143+
- pluginRef: kv-cache-utilization-scorer
144+
- pluginRef: prefix-cache-scorer
145+
---
146+
apiVersion: apps/v1
147+
kind: Deployment
148+
metadata:
149+
name: vllm-llama3-8b-instruct-epp
150+
namespace: $E2E_NS
151+
labels:
152+
app: vllm-llama3-8b-instruct-epp
153+
spec:
154+
replicas: 3
155+
selector:
156+
matchLabels:
157+
app: vllm-llama3-8b-instruct-epp
158+
template:
159+
metadata:
160+
labels:
161+
app: vllm-llama3-8b-instruct-epp
162+
spec:
163+
serviceAccountName: vllm-llama3-8b-instruct-epp
164+
# Conservatively, this timeout should mirror the longest grace period of the pods within the pool
165+
terminationGracePeriodSeconds: 130
166+
containers:
167+
- name: epp
168+
image: $E2E_IMAGE
169+
imagePullPolicy: IfNotPresent
170+
args:
171+
- --pool-name
172+
- "vllm-llama3-8b-instruct"
173+
- --pool-namespace
174+
- "$E2E_NS"
175+
- --v
176+
- "4"
177+
- --zap-encoder
178+
- "json"
179+
- --grpc-port
180+
- "9002"
181+
- --grpc-health-port
182+
- "9003"
183+
- --ha-enable-leader-election
184+
- "--config-file"
185+
- "/config/default-plugins.yaml"
186+
ports:
187+
- containerPort: 9002
188+
- containerPort: 9003
189+
- name: metrics
190+
containerPort: 9090
191+
livenessProbe:
192+
grpc:
193+
port: 9003
194+
service: liveness
195+
initialDelaySeconds: 5
196+
periodSeconds: 10
197+
readinessProbe:
198+
grpc:
199+
port: 9003
200+
service: readiness
201+
initialDelaySeconds: 5
202+
periodSeconds: 10
203+
volumeMounts:
204+
- name: plugins-config-volume
205+
mountPath: "/config"
206+
volumes:
207+
- name: plugins-config-volume
208+
configMap:
209+
name: plugins-config

0 commit comments

Comments
 (0)