Skip to content

Commit

Permalink
add documentation for running knavigator within a cluster
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Shmulevich <[email protected]>
  • Loading branch information
dmitsh committed May 21, 2024
1 parent 571e816 commit 3527c8c
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
FROM ubuntu

RUN apt-get update && apt-get -y install curl
RUN apt-get update && apt-get -y install curl vim
RUN curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 && chmod 700 get_helm.sh && ./get_helm.sh

WORKDIR /knavigator

COPY bin/* /usr/local/bin/
COPY resources /etc/knavigator
COPY resources /knavigator/resources
43 changes: 43 additions & 0 deletions docs/examples/knavigator/rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: knavigator
namespace: default
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: knavigator
rules:
- apiGroups: [""]
resources: ["*"]
verbs: [create,get,list,watch,patch,update,delete]
- apiGroups: ["batch"]
resources: [jobs]
verbs: [create,get,list,watch,patch,update,delete]
- apiGroups: [extensions,apps]
resources: [deployments,replicasets]
verbs: [create,get,list,watch,patch,delete]
- apiGroups: [rbac.authorization.k8s.io]
resources: [clusterroles,clusterrolebindings]
verbs: [get,list,watch,patch]
- apiGroups: [coordination.k8s.io]
resources: [leases]
verbs: [create,get,list,watch,patch,update]
- apiGroups: [kwok.x-k8s.io]
resources: ["*","*/*"]
verbs: ["*"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: knavigator
subjects:
- kind: ServiceAccount
name: knavigator
namespace: default
apiGroup: ""
roleRef:
kind: ClusterRole
name: knavigator
apiGroup: ""
28 changes: 28 additions & 0 deletions docs/examples/knavigator/test-job.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: batch/v1
kind: Job
metadata:
name: klient
namespace: default
spec:
template:
spec:
serviceAccountName: knavigator
containers:
- name: knavigator
image: ghcr.io/nvidia/knavigator:f575368
imagePullPolicy: Always
command:
- /usr/local/bin/knavigator
args:
- -tasks=resources/tests/k8s/test-job.yml
- -cleanup
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: type
operator: NotIn
values:
- kwok
restartPolicy: "Never"

0 comments on commit 3527c8c

Please sign in to comment.