commit
c864e76a2d
8 changed files with 98 additions and 0 deletions
@ -0,0 +1 @@ |
|||
FROM glmdev/k8s-hpc-demo:latest |
@ -0,0 +1,18 @@ |
|||
apiVersion: v1 |
|||
kind: ServiceAccount |
|||
metadata: |
|||
name: default |
|||
namespace: cluster |
|||
--- |
|||
apiVersion: rbac.authorization.k8s.io/v1 |
|||
kind: ClusterRoleBinding |
|||
metadata: |
|||
name: cluster-admin |
|||
roleRef: |
|||
apiGroup: rbac.authorization.k8s.io |
|||
kind: ClusterRole |
|||
name: cluster-admin |
|||
subjects: |
|||
- kind: ServiceAccount |
|||
name: default |
|||
namespace: cluster |
@ -0,0 +1,31 @@ |
|||
apiVersion: v1 |
|||
image: |
|||
repository: glmdev/k8s-hpc-demo |
|||
tag: latest |
|||
# pullPolicy: Never |
|||
pullPolicy: IfNotPresent |
|||
networkPolicy: |
|||
enabled: false |
|||
sshGateway: |
|||
enabled: false |
|||
mpiMaster: |
|||
autoUpdateHostfile: |
|||
enabled: true |
|||
volumes: |
|||
- name: cache-volume |
|||
hostPath: |
|||
path: / |
|||
type: Directory |
|||
volumeMounts: |
|||
- mountPath: /clusterfs |
|||
name: cache-volume |
|||
mpiWorkers: |
|||
num: 5 |
|||
volumes: |
|||
- name: cache-volume |
|||
hostPath: |
|||
path: / |
|||
type: Directory |
|||
volumeMounts: |
|||
- mountPath: /clusterfs |
|||
name: cache-volume |
@ -0,0 +1,6 @@ |
|||
apiVersion: v1 |
|||
kind: Namespace |
|||
metadata: |
|||
name: cluster |
|||
labels: |
|||
name: cluster |
@ -0,0 +1,3 @@ |
|||
#!/bin/bash |
|||
|
|||
kubectl -n cluster exec cluster-master -i --tty -- $@ |
@ -0,0 +1,12 @@ |
|||
#!/bin/bash |
|||
|
|||
# Clone the kube-openmpi repo. This provides OpenMPI in the cluster. |
|||
git clone https://github.com/everpeace/kube-openmpi cluster |
|||
|
|||
cd cluster |
|||
|
|||
# Generate the SSH key used by the cluster nodes for MPI comm. |
|||
./gen-ssh-key.sh |
|||
|
|||
|
|||
echo "Open the definitions/cluster_definition.yaml file and point it to your container image." |
@ -0,0 +1,14 @@ |
|||
#!/bin/bash |
|||
|
|||
# Create the Kubernetes resources. |
|||
kubectl create -f definitions/namespace_definition.yaml |
|||
|
|||
kubectl create -f definitions/account_definitions.yaml |
|||
|
|||
# Start the cluster. |
|||
cd cluster |
|||
|
|||
helm template chart --namespace cluster --name cluster -f ../definitions/cluster_definition.yaml -f ssh-key.yaml | kubectl -n cluster create -f - |
|||
|
|||
# Start watch to view cluster resource creation. |
|||
watch -n 0.5 kubectl -n cluster get pods -o wide |
@ -0,0 +1,13 @@ |
|||
#!/bin/bash |
|||
|
|||
# Stop the cluster. |
|||
cd cluster |
|||
|
|||
helm template chart --namespace cluster --name cluster -f ../definitions/cluster_definition.yaml -f ssh-key.yaml | kubectl -n cluster delete -f - |
|||
|
|||
# Delete the Kubernetes resources. |
|||
cd .. |
|||
|
|||
kubectl delete -f definitions/account_definitions.yaml |
|||
|
|||
kubectl delete -f definitions/namespace_definition.yaml |
Loading…
Reference in new issue