Integration of Kubernetes(using NFS-server & 3rd party NFS-client Dynamic provisioning) with Jenkins and Github

To create resources like Pods, Deployment, PVC and Service, etc on the top of K8s.

[root@server ~]# mkdir /storage
[root@server ~]# chmod 0777 -R /storage
[root@server ~]# ls -ahl / | grep storage
drwxrwxrwx. 4 root root 4.0K Jun 21 02:28 storage
[root@server ~]# cat /etc/exports
/storage *(rw,no_root_squash)
[root@server ~]# exportfs -rv
exporting *:/storage
[root@server ~]# showmount -e 192.168.99.102
[root@server ~]# kubectl get clusterrole,role | grep nfs [root@server ~]# kubectl apply -f rbac-nfs-dynamic-provisioner.yml
serviceaccount/nfs-dynamic-provisioner created
clusterrole.rbac.authorization.k8s.io/nfs-dynamic-provisioner-clusterRole created
clusterrolebinding.rbac.authorization.k8s.io/nfs-dynamic-provisioner-rolebinding created
role.rbac.authorization.k8s.io/nfs-dynamic-provisioner-otherRoles created
rolebinding.rbac.authorization.k8s.io/nfs-dynamic-provisioner-otherRoles created
[root@server ~]# kubectl get clusterrole,role | grep nfs
clusterrole.rbac.authorization.k8s.io/nfs-dynamic-provisioner-clusterRole 2020-06-20T17:27:36Z
role.rbac.authorization.k8s.io/nfs-dynamic-provisioner-otherRoles 2020-06-20T17:27:36Z
[root@server ~]# kubectl apply -f nfs-storage-class.yml
storageclass.storage.k8s.io/nfs-storageclass created
[root@server ~]# kubectl get sc
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
nfs-storageclass nfs-storageclass Delete Immediate false 37h
standard (default) k8s.io/minikube-hostpath Delete Immediate false 39d
[root@server ~]# kubectl apply -f nfs-client-pod-dynamic-provisioner.yml
deployment.apps/nfs-client-pod-dynamic-provisioner created
[root@server ~]# kubectl get pods
NAME READY STATUS RESTARTS AGE
nfs-client-pod-dynamic-provisioner-684557596c-x4z6v 1/1 Running 0 9m28s
[root@server ~]# kubectl describe pods nfs-client-pod-dynamic-provisioner-684557596c-x4z6v | grep Volumes -A 5Volumes:
nfs-provisioner-volume:
Type: NFS (an NFS mount that lasts the lifetime of a pod)
Server: 192.168.99.102
Path: /storage
ReadOnly: false
[root@server ~]# kubectl config view
apiVersion: v1
clusters:
- cluster:
certificate-authority: /root/ca.crt
server: https://192.168.99.101:8443
name: mycluster
contexts:
- context:
cluster: mycluster
user: jen
name: mycontext
current-context: mycontext
kind: Config
preferences: {}
users:
- name: jen
user:
client-certificate: /root/client.crt
client-key: /root/client.key

Job1

Job2

Job3

Job4

I'm a computer science undergraduate and my primary area of work is under Linux, CloudComputing, DevOps culture, and various open-source tools and technologies