Skip to content

Commit 89fc69e

Browse files
committed
customize helm charts
1 parent 91971f1 commit 89fc69e

14 files changed

+88
-1511
lines changed

charts/kwok/conf/kwok.yaml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,13 @@ options:
99
podPlayStageParallelism: 4
1010
nodePlayStageParallelism: 4
1111
nodePort: 10247
12-
cidr: 10.0.0.1/24
12+
cidr: 10.0.0.0/12
1313
manageAllNodes: false
14-
manageNodesWithAnnotationSelector: 'kwok.x-k8s.io/node=fake'
14+
manageNodesWithAnnotationSelector: ''
1515
manageNodesWithLabelSelector: ''
1616
manageSingleNode: ''
1717
nodeLeaseDurationSeconds: 40
1818
enableCRDs:
1919
- Stage
2020
- Metric
21-
- Attach
22-
- ClusterAttach
23-
- Exec
24-
- ClusterExec
25-
- Logs
26-
- ClusterLogs
27-
- PortForward
28-
- ClusterPortForward
29-
- ResourceUsage
30-
- ClusterResourceUsage
21+

charts/kwok/templates/deployment.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{{ if .Values.enableDeployment }}
22
apiVersion: apps/v1
3-
kind: Deployment
3+
kind: StatefulSet
44
metadata:
55
name: {{ include "kwok.fullname" . }}
66
labels:
77
{{- include "kwok.labels" . | nindent 4 }}
88
spec:
99
replicas: {{ .Values.replicas }}
10+
podManagementPolicy: Parallel
1011
selector:
1112
matchLabels:
1213
{{- include "kwok.selectorLabels" . | nindent 6 }}
@@ -31,6 +32,7 @@ spec:
3132
args:
3233
- --config=/root/.kwok/kwok.yaml
3334
- --node-ip=$(POD_IP)
35+
- --manage-single-node=$(POD_NAME)
3436
env:
3537
{{ toYaml .Values.env | nindent 10 }}
3638
imagePullPolicy: {{ .Values.image.pullPolicy }}

charts/kwok/templates/node.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{{- $root := . }}
2+
{{- range $i := until (int $root.Values.node.count) }}
3+
---
4+
apiVersion: v1
5+
kind: Node
6+
metadata:
7+
name: {{ $root.Values.fullnameOverride }}-{{ $i }}
8+
annotations:
9+
node.alpha.kubernetes.io/ttl: "0"
10+
kwok.x-k8s.io/node: fake
11+
labels:
12+
beta.kubernetes.io/arch: amd64
13+
beta.kubernetes.io/os: linux
14+
kubernetes.io/arch: amd64
15+
kubernetes.io/hostname: {{ $root.Values.fullnameOverride }}-{{ $i }}
16+
kubernetes.io/os: linux
17+
kubernetes.io/role: agent
18+
node-role.kubernetes.io/agent: ""
19+
type: kwok
20+
spec:
21+
providerID: kwok://{{ $root.Values.fullnameOverride }}-{{ $i }}
22+
taints:
23+
{{- toYaml $root.Values.node.taints | nindent 2 }}
24+
status:
25+
allocatable:
26+
{{- toYaml $root.Values.node.allocatable | nindent 4 }}
27+
capacity:
28+
{{- toYaml $root.Values.node.capacity | nindent 4 }}
29+
nodeInfo:
30+
architecture: amd64
31+
bootID: ""
32+
containerRuntimeVersion: ""
33+
kernelVersion: ""
34+
kubeProxyVersion: fake
35+
kubeletVersion: fake
36+
machineID: ""
37+
operatingSystem: linux
38+
osImage: ""
39+
systemUUID: ""
40+
phase: Running
41+
{{- end }}

charts/kwok/values.yaml

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ image:
44
# -- Image repository.
55
repository: registry.k8s.io/kwok/kwok
66
# -- Overrides the image tag whose default is {{ .Chart.AppVersion }}.
7-
tag: ""
7+
tag: "v0.7.0"
88

99
# -- Image pull secrets.
1010
imagePullSecrets: []
@@ -13,27 +13,33 @@ imagePullSecrets: []
1313
nameOverride: ""
1414

1515
# -- Override the `fullname` of the chart.
16-
fullnameOverride: "kwok-controller"
16+
fullnameOverride: "kwok"
1717

1818
podSecurityContext: {}
1919
securityContext: {}
2020

2121
nodeSelector: {}
22-
resources: {}
22+
resources:
23+
requests:
24+
cpu: "10m"
25+
limits:
26+
cpu: "100m"
2327
affinity: {}
2428

2529
# -- The replica count for Deployment.
2630
replicas: 1
2731

2832
# -- Change `hostNetwork` to `true` if you want to deploy in a kind cluster.
2933
hostNetwork: false
30-
tolerations:
31-
- operator: Exists
32-
effect: NoSchedule
33-
key: node-role.kubernetes.io/control-plane
34-
- operator: Exists
35-
effect: NoSchedule
36-
key: node-role.kubernetes.io/master
34+
affinity:
35+
nodeAffinity:
36+
requiredDuringSchedulingIgnoredDuringExecution:
37+
nodeSelectorTerms:
38+
- matchExpressions:
39+
- key: agentpool
40+
operator: In
41+
values:
42+
- user
3743
volumes: []
3844
env:
3945
- name: POD_IP
@@ -44,5 +50,30 @@ env:
4450
valueFrom:
4551
fieldRef:
4652
fieldPath: status.hostIP
53+
- name: POD_NAME
54+
valueFrom:
55+
fieldRef:
56+
fieldPath: metadata.name
57+
4758
volumeMounts: []
4859
enableDeployment: true
60+
61+
node:
62+
count: 1
63+
64+
taints:
65+
- effect: NoSchedule
66+
key: kwok.x-k8s.io/node
67+
value: fake
68+
69+
allocatable:
70+
cpu: 96
71+
memory: 1Ti
72+
pods: 110
73+
nvidia.com/gpu: "8"
74+
75+
capacity:
76+
cpu: 96
77+
memory: 1Ti
78+
pods: 110
79+
nvidia.com/gpu: "8"

kustomize/crd/bases/kwok.x-k8s.io_attaches.yaml

Lines changed: 0 additions & 123 deletions
This file was deleted.

0 commit comments

Comments
 (0)