Skip to content

Commit cc8b039

Browse files
authored
changed from ex-power-dra to power-dra-driver to match namespace (#23)
* Example readme and yamls corrections Signed-off-by: Punith Kenchappa <[email protected]> * fix not found of power-dra-kubeletplugin and cdi file Signed-off-by: Punith Kenchappa <[email protected]> * Added path and exec permission to container file and readme modification for uninstall Signed-off-by: Punith Kenchappa <[email protected]> * Copy power-dra-kubeletplugin to bin in container file and readme modification Signed-off-by: Punith Kenchappa <[email protected]> * changed from ex-power-dra to power-dra-driver to match namespace Signed-off-by: Punith Kenchappa <[email protected]> * fixed issues and added resource slice Signed-off-by: Punith Kenchappa <[email protected]> * fixed issues and readme Signed-off-by: Punith Kenchappa <[email protected]> * changed from ex-power-dra to power-dra-driver to match namespace Signed-off-by: Punith Kenchappa <[email protected]> * fixed issues for nx device classes Signed-off-by: Punith Kenchappa <[email protected]> --------- Signed-off-by: Punith Kenchappa <[email protected]>
1 parent cf25e17 commit cc8b039

File tree

10 files changed

+181
-35
lines changed

10 files changed

+181
-35
lines changed

build/Containerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ RUN [ "$(arch)" == "s390x" ]
4242
ENV GOROOT=/usr/local/go
4343
ENV PATH="/root/platform/bin:/opt/power-dra/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:$GOROOT/bin"
4444

45-
4645
COPY . .
4746

4847
RUN ARCH=$(arch | sed 's|x86_64|amd64|g' | sed 's|aarch64|arm64|g') \

deployments/helm/power-dra-driver/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ selectorLabelsOverride: {}
55

66
allowDefaultNamespace: false
77

8-
deviceClasses: ["nx-device"]
8+
deviceClasses: ["nx.device"]
99

1010
imagePullSecrets: []
1111
image:
1212
repository: quay.io/powercloud/power-dra-driver
13-
pullPolicy: Always
13+
pullPolicy: IfNotPresent
1414
# Overrides the image tag whose default is the chart appVersion.
1515
tag: "main"
1616

example/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22

3-
1. Create namespace `oc new-project ex-power-dra`
3+
1. Create namespace `oc new-project ex-dra-driver`
44
2. Install Scenario - `kustomize build examples/<scenario> | oc apply -f -`
55
3. Uninstall Scenario - `kustomize build examples/<scenario> | oc delete -f -`
66

example/demo/nx-test.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
2+
---
3+
apiVersion: v1
4+
kind: Namespace
5+
metadata:
6+
name: nx-gzip-test1
7+
8+
---
9+
apiVersion: resource.k8s.io/v1alpha3
10+
kind: ResourceClaimTemplate
11+
metadata:
12+
namespace: ex-dra-driver
13+
name: nx-gzip
14+
spec:
15+
spec:
16+
devices:
17+
requests:
18+
- name: nx-gzip
19+
deviceClassName: nx.device.power.ibm.com
20+
21+
---
22+
apiVersion: v1
23+
kind: Pod
24+
metadata:
25+
namespace: ex-dra-driver
26+
name: pod0
27+
spec:
28+
nodeSelector:
29+
kubernetes.io/hostname: worker-0
30+
containers:
31+
- name: ctr0
32+
image: quay.io/powercloud/power-dra-driver:main
33+
command: ["bash", "-c"]
34+
args: ["export; trap 'exit 0' TERM; sleep 9999 & wait"]
35+
resources:
36+
claims:
37+
- name: nx-gzip
38+
resourceClaims:
39+
- name: nx-gzip
40+
resourceClaimTemplateName: nx-gzip-template-0
41+
42+
---
43+
apiVersion: v1
44+
kind: Pod
45+
metadata:
46+
namespace: ex-power-dra
47+
name: pod1
48+
spec:
49+
nodeSelector:
50+
kubernetes.io/hostname: worker-0
51+
containers:
52+
- name: ctr0
53+
image: quay.io/powercloud/power-dra-driver:main
54+
command: ["bash", "-c"]
55+
args: ["export; trap 'exit 0' TERM; sleep 9999 & wait"]
56+
resources:
57+
claims:
58+
- name: nx-gzip
59+
resourceClaims:
60+
- name: nx-gzip
61+
resourceClaimTemplateName: nx-gzip-template-1

example/two-pods-two-distinct-nx-gzip/03-resource-claim-template.yaml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
1-
apiVersion: resource.k8s.io/v1beta1
1+
---
2+
apiVersion: resource.k8s.io/v1alpha3
23
kind: ResourceClaimTemplate
34
metadata:
4-
namespace: gpu-test1
5-
name: nx-gzip
5+
namespace: ex-dra-driver
6+
name: nx-gzip-template-0
7+
spec:
8+
spec:
9+
devices:
10+
requests:
11+
- name: nx-gzip
12+
deviceClassName: nx.device.power.ibm.com
13+
14+
---
15+
apiVersion: resource.k8s.io/v1alpha3
16+
kind: ResourceClaimTemplate
17+
metadata:
18+
namespace: ex-dra-driver
19+
name: nx-gzip-template-1
620
spec:
721
spec:
822
devices:
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
apiVersion: resource.k8s.io/v1alpha3
2+
kind: ResourceSlice
3+
metadata:
4+
name: nx-gzip-slice-worker-0
5+
namespace: ex-dra-driver
6+
ownerReferences:
7+
- apiVersion: v1
8+
kind: Node
9+
name: worker-0
10+
uid: 599f6e81-b968-4266-9421-9d5b1fc0a544
11+
spec:
12+
driver: nx.device.power.ibm.com
13+
nodeName: worker-0
14+
pool:
15+
name: worker-0
16+
generation: 0
17+
resourceSliceCount: 1
18+
devices:
19+
- name: nx-gzip-0
20+
basic:
21+
attributes:
22+
model:
23+
string: NX-GZIP-V1
24+
uuid:
25+
string: nx-gzip-uuid-001
26+
capacity:
27+
memory: "80Gi"
28+
- name: nx-gzip-1
29+
basic:
30+
attributes:
31+
model:
32+
string: NX-GZIP-V2
33+
uuid:
34+
string: nx-gzip-uuid-002
35+
capacity:
36+
memory: "80Gi"
37+
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
apiVersion: apps/v1
22
kind: Deployment
33
metadata:
4-
name: ex-power-dra-sec
4+
name: ex-dra-driver
55
labels:
6-
app: ex-power-dra-sec
6+
app: ex-dra-driver
77
spec:
88
selector:
99
matchLabels:
10-
app: ex-power-dra
10+
app: ex-dra-driver
1111
template:
1212
metadata:
1313
labels:
14-
app: ex-power-dra
14+
app: ex-dra-driver
1515
spec:
16-
serviceAccountName: ex-sa
16+
resourceClaims:
17+
- name: nx-gzip
18+
resourceClaimTemplateName: nx-gzip
1719
containers:
1820
- name: driver
19-
image: quay.io/powercloud/power-dra-driver:latest
21+
image: quay.io/powercloud/power-dra-driver:main
2022
imagePullPolicy: IfNotPresent
2123
command: [ "/bin/sleep" ]
2224
args: [ "infinity" ]
@@ -26,18 +28,20 @@ spec:
2628
requests:
2729
cpu: 100m
2830
memory: 100Mi
31+
claims:
32+
- name: nx-gzip
33+
serviceAccount: ex-sa
34+
serviceAccountName: ex-sa
2935
securityContext:
3036
privileged: false
31-
runAsUser: 1000
37+
runAsUser: 1000740023
3238
capabilities:
3339
drop:
3440
- ALL
3541
runAsNonRoot: true
3642
readOnlyRootFilesystem: true
3743
allowPrivilegeEscalation: false
38-
# Resource Claims should be outside of `containers`
39-
resourceClaims:
40-
- name: nx-gzip
41-
resourceClaimTemplateName: nx-gzip
44+
serviceAccount: ex-sa
45+
serviceAccountName: ex-sa
4246
updateStrategy:
43-
type: RollingUpdate
47+
type: RollingUpdate
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
11
apiVersion: apps/v1
22
kind: Deployment
33
metadata:
4-
name: ex-power-dra
4+
name: ex-dra-driver-sec
55
labels:
6-
app: ex-power-dra
6+
app: ex-dra-driver-sec
77
spec:
88
selector:
99
matchLabels:
10-
app: ex-power-dra
10+
app: ex-dra-driver
1111
template:
1212
metadata:
1313
labels:
14-
app: ex-power-dra
14+
app: ex-dra-driver
1515
spec:
16+
resourceClaims:
17+
- name: nx-gzip
18+
resourceClaimTemplateName: nx-gzip
19+
serviceAccount: ex-sa
20+
serviceAccountName: ex-sa
1621
containers:
1722
- name: driver
18-
image: quay.io/powercloud/power-dra-driver:latest
23+
image: quay.io/powercloud/power-dra-driver:main
1924
imagePullPolicy: IfNotPresent
2025
command: [ "/bin/sleep" ]
2126
args: [ "infinity" ]
2227
resources:
28+
claims:
29+
- name: nx-gzip
2330
limits:
2431
memory: 100Mi
2532
requests:
2633
cpu: 100m
2734
memory: 100Mi
28-
claims:
29-
- name: nx-gzip
3035
serviceAccount: ex-sa
3136
serviceAccountName: ex-sa
3237
securityContext:
3338
privileged: false
34-
runAsUser: 1000
39+
runAsUser: 1000740022
3540
capabilities:
3641
drop:
3742
- ALL
3843
runAsNonRoot: true
3944
readOnlyRootFilesystem: true
4045
allowPrivilegeEscalation: false
41-
resourceClaims:
42-
- name: nx-gzip
43-
resourceClaimTemplateName: nx-gzip
44-
serviceAccount: ex-sa
45-
serviceAccountName: ex-sa
4646
updateStrategy:
47-
type: RollingUpdate
47+
type: RollingUpdate
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
apiVersion: apps/v1
2+
kind: DaemonSet
3+
metadata:
4+
name: nx-device-plugin
5+
namespace: kube-system
6+
labels:
7+
app: nx-device-plugin
8+
spec:
9+
selector:
10+
matchLabels:
11+
app: nx-device-plugin
12+
template:
13+
metadata:
14+
labels:
15+
app: nx-device-plugin
16+
spec:
17+
containers:
18+
- name: nx-device-plugin
19+
image: quay.io/powercloud/power-dra-driver:main
20+
imagePullPolicy: IfNotPresent
21+
securityContext:
22+
privileged: true
23+
volumeMounts:
24+
- name: device-plugins
25+
mountPath: /var/lib/kubelet/device-plugins
26+
volumes:
27+
- name: device-plugins
28+
hostPath:
29+
path: /var/lib/kubelet/device-plugins
30+
type: Directory

example/two-pods-two-distinct-nx-gzip/kustomization.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ resources:
1212
- 01-sa.yaml
1313
- 02-rbac.yaml
1414
- 03-resource-claim-template.yaml
15-
- 04-deployment-first.yaml
16-
- 05-deployment-second.yaml
15+
- 04-resource-slice-template.yaml
16+
- 05-deployment-first.yaml
17+
- 06-deployment-second.yaml

0 commit comments

Comments
 (0)