OKD Continued
Storage
- NFS storage for persistant volumes is provided by another host
General use PV example
- label can be used to easily tie a PV to a specific pod
- change capacity to your desired size
- change accessModes to your desired setting
- change nfs path and server to match your environment
- change persistentVolumeReclaimPolicy to your desired mode
pv-example.yml
apiVersion: v1
kind: PersistentVolume
metadata:
name: PV
labels:
project: any
spec:
capacity:
storage: 5Gi
accessModes:
- ReadWriteOnce
nfs:
path: /srv/oci/nfs/PV
server: 192.168.122.1
persistentVolumeReclaimPolicy: Recycle
sed one liner to create multiple PV definitions
for i in $(seq -w 001 020); do cp pv-example.yml pv${i}.yml; sed -i "s/PV/pv${i}/g" pv${i}.yml; done
create the PVs in OKD
for i in `ls pv0*yml`; do oc create -f ${i}; done
Cleaning up Evicted pods
for project in $(oc get projects | awk '{print $1}'); do for evicted in $(oc get pods -n ${project} | grep "Evicted" | awk '{print $1}'); do oc delete pod ${evicted} -n ${project}; done; done
LetsEncrypt certs
git clone https://github.com/Neilpang/acme.sh.git