Skip to content

Instantly share code, notes, and snippets.

@goern
Last active February 26, 2016 13:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goern/9793a3c3466fde0c34c0 to your computer and use it in GitHub Desktop.
Save goern/9793a3c3466fde0c34c0 to your computer and use it in GitHub Desktop.
# This reused parts of https://access.redhat.com/solutions/2147871
sudo yum install -y atomic docker etcd kubernetes nfs-utils sos cockpit-sos cockpit-kubernetes cockpit
sudo systemctl start cockpit && sudo systemctl enable cockpit.socket
sudo systemctl enable docker && sudo systemctl start docker
sudo docker pull centos
sudo systemctl enable etcd && sudo systemctl start etcd
sudo systemctl enable kube-apiserver && sudo systemctl start kube-apiserver
sudo systemctl enable kube-scheduler && sudo systemctl start kube-scheduler
sudo systemctl enable kube-proxy && sudo systemctl start kube-proxy
sudo systemctl enable kubelet && sudo systemctl start kubelet
sudo rpm -Uvh https://repo.mongodb.org/yum/redhat/7/mongodb-org/3.2/x86_64/RPMS/mongodb-org-server-3.2.3-1.el7.x86_64.rpm
sudo rpm -Uvh https://repo.mongodb.org/yum/redhat/7/mongodb-org/3.2/x86_64/RPMS/mongodb-org-shell-3.2.3-1.el7.x86_64.rpm
sudo rpm -Uvh https://repo.mongodb.org/yum/redhat/7/mongodb-org/3.2/x86_64/RPMS/mongodb-org-mongos-3.2.3-1.el7.x86_64.rpm
cat <<EOF > ./pv1.yaml
apiVersion: "v1"
kind: "PersistentVolume"
metadata:
name: "pv0001"
spec:
capacity:
storage: "1Gi"
accessModes:
- "ReadWriteOnce"
nfs:
path: "/srv/nfs/vol0001"
server: "nfs-server"
persistentVolumeReclaimPolicy: "Recycle"
EOF
cat <<EOF > ./pvc1.yaml
apiVersion: "v1"
kind: "PersistentVolumeClaim"
metadata:
name: "claim-for-0001"
spec:
accessModes:
- "ReadWriteOnce"
resources:
requests:
storage: "512Mi"
EOF
cat <<EOF > ./pod.yaml
{
"apiVersion": "v1",
"kind": "Pod",
"metadata": {
"name": "nfs-test",
"labels": {
"name": "frontendhttp"
}
},
"spec": {
"containers": [{
"name": "myfrontend",
"image": "nak3/nfs-test",
"imagePullPolicy": "IfNotPresent",
"ports": [{
"containerPort": 80,
"name": "http-server"
}],
"volumeMounts": [{
"mountPath": "/mnt/nfs",
"name": "pvol"
}]
}],
"volumes": [{
"name": "pvol",
"persistentVolumeClaim": {
"claimName": "claim-for-0001"
}
}]
}
}
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment