Merge pull request #5 from parallel-programming-hwr/container

k8s: add spec
main
leonnicolas 4 years ago committed by GitHub
commit 1cc4db1211
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,39 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: rust-opencl-demo
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: rust-opencl-demo
template:
metadata:
labels:
app: rust-opencl-demo
spec:
containers:
- name: rust-opencl-demo
image: leonnicolas/rust-opencl-demo-wrapper
args:
- --command=rust-opencl-demo
- --args=calculate-primes,--end,1000,--local-size,256,--numbers-per-step,12288,--stdout
env:
- name: LD_LIBRARY_PATH
value: /usr/lib/x86_64-linux-gnu:/usr/local/nvidia
livenessProbe:
httpGet:
path: /status
port: 8080
initialDelaySeconds: 30
periodSeconds: 5
ports:
- containerPort: 8080
resources:
limits:
nvidia.com/gpu: 1
tolerations:
- key: nvidia.com/gpu
effect: NoSchedule
operator: Exists

@ -0,0 +1,57 @@
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: nvidia-gpu-device-plugin
namespace: kube-system
labels:
k8s-app: nvidia-gpu-device-plugin
addonmanager.kubernetes.io/mode: EnsureExists
spec:
selector:
matchLabels:
k8s-app: nvidia-gpu-device-plugin
template:
metadata:
labels:
k8s-app: nvidia-gpu-device-plugin
spec:
priorityClassName: system-node-critical
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: hwr-berlin.de/nvidia-accelerator
operator: Exists
tolerations:
- operator: "Exists"
effect: "NoExecute"
- operator: "Exists"
effect: "NoSchedule"
volumes:
- name: device-plugin
hostPath:
path: /var/lib/kubelet/device-plugins
- name: dev
hostPath:
path: /dev
containers:
- image: "gcr.io/gke-release/nvidia-gpu-device-plugin@sha256:a75ec0caa9e3038bd9886b3f36641a624574ff34b064974de6ee45048de3372b"
command: ["/usr/bin/nvidia-gpu-device-plugin", "-logtostderr","--host-path=/usr/lib/x86_64-linux-gnu"]
name: nvidia-gpu-device-plugin
resources:
requests:
cpu: 50m
memory: 10Mi
limits:
cpu: 50m
memory: 10Mi
securityContext:
privileged: true
volumeMounts:
- name: device-plugin
mountPath: /device-plugin
- name: dev
mountPath: /dev
updateStrategy:
type: RollingUpdate
Loading…
Cancel
Save