U1.35 Ubuntu Quick Start (QS): Kubespray on premises. Install portainer. - chempkovsky/CS2WPF-and-CS2XAMARIN GitHub Wiki

Before we start

Portainer with nfsonc

login into u2004d01

Test managed-nfsonc-storage

  • Mark *managed-nfsonc-storage as default:
sudo kubectl get storageClass --all-namespaces -o wide
sudo kubectl patch storageclass managed-nfsonc-storage -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
sudo kubectl get storageClass -o wide
  • Install Portainer
sudo kubectl apply -n portainer -f https://raw.githubusercontent.com/portainer/k8s/master/deploy/manifests/portainer/portainer.yaml
sudo kubectl get pods -o wide -n portainer
Click to show the responce
yury@u2004d01:~/nfs-subdir-external-provisioner$ sudo kubectl apply -n portainer -f https://raw.githubusercontent.com/portainer/k8s/master/deploy/manifests/portainer/portainer.yaml
namespace/portainer created
serviceaccount/portainer-sa-clusteradmin created
persistentvolumeclaim/portainer created
clusterrolebinding.rbac.authorization.k8s.io/portainer created
service/portainer created
deployment.apps/portainer created
yury@u2004d01:~/nfs-subdir-external-provisioner$ sudo kubectl get pods -o wide -n portainer
NAME                        READY   STATUS    RESTARTS   AGE   IP             NODE       NOMINATED NODE   READINESS GATES
portainer-dcd599f8f-5vb78   1/1     Running   0          13s   10.233.72.13   u2004d03   <none>           <none>
yury@u2004d01:~/nfs-subdir-external-provisioner$
  • Delete Portainer
sudo kubectl delete -f https://raw.githubusercontent.com/portainer/k8s/master/deploy/manifests/portainer/portainer.yaml
sudo kubectl get pods -o wide -n portainer

Test managed-nfsond-storage

  • Mark the default managed-nfsonc-storage as non-default:
  • Mark the default managed-nfsond-storage as default:
sudo kubectl patch storageclass managed-nfsonc-storage -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"false"}}}'
sudo kubectl patch storageclass managed-nfsond-storage -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
sudo kubectl get storageClass -o wide
  • Install Portainer
sudo kubectl apply -n portainer -f https://raw.githubusercontent.com/portainer/k8s/master/deploy/manifests/portainer/portainer.yaml
sudo kubectl get pods -o wide -n portainer
Click to show the responce
yury@u2004d01:~/nfs-subdir-external-provisioner$ sudo kubectl patch storageclass managed-nfsonc-storage -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"false"}}}'
storageclass.storage.k8s.io/managed-nfsonc-storage patched
yury@u2004d01:~/nfs-subdir-external-provisioner$ sudo kubectl patch storageclass managed-nfsond-storage -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
storageclass.storage.k8s.io/managed-nfsond-storage patched
yury@u2004d01:~/nfs-subdir-external-provisioner$ sudo kubectl get storageClass -o wide
NAME                               PROVISIONER                              RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
managed-nfsonc-storage             nfsonc/nfs-subdir-external-provisioner   Delete          Immediate           false                  41m
managed-nfsond-storage (default)   nfsond/nfs-subdir-external-provisioner   Delete          Immediate           false                  43m
managed-nfsone-storage             nfsone/nfs-subdir-external-provisioner   Delete          Immediate           false                  20m
yury@u2004d01:~/nfs-subdir-external-provisioner$ sudo kubectl apply -n portainer -f https://raw.githubusercontent.com/portainer/k8s/master/deploy/manifests/portainer/portainer.yaml
namespace/portainer created
serviceaccount/portainer-sa-clusteradmin created
persistentvolumeclaim/portainer created
clusterrolebinding.rbac.authorization.k8s.io/portainer created
service/portainer created
deployment.apps/portainer created
yury@u2004d01:~/nfs-subdir-external-provisioner$ sudo kubectl get pods -o wide -n portainer
NAME                        READY   STATUS    RESTARTS   AGE   IP             NODE       NOMINATED NODE   READINESS GATES
portainer-dcd599f8f-xhtxd   1/1     Running   0          16s   10.233.72.14   u2004d03   <none>           <none>
  • Delete Portainer
sudo kubectl delete -f https://raw.githubusercontent.com/portainer/k8s/master/deploy/manifests/portainer/portainer.yaml
sudo kubectl get pods -o wide -n portainer

Test managed-nfsone-storage

  • Mark the default managed-nfsond-storage as non-default:
  • Mark the default managed-nfsone-storage as default:
sudo kubectl patch storageclass managed-nfsond-storage -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"false"}}}'
sudo kubectl patch storageclass managed-nfsone-storage -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
sudo kubectl get storageClass -o wide
  • Install Portainer
sudo kubectl apply -n portainer -f https://raw.githubusercontent.com/portainer/k8s/master/deploy/manifests/portainer/portainer.yaml
sudo kubectl patch deployments -n portainer portainer -p '{"spec": {"template": {"spec": {"nodeSelector": {"kubernetes.io/hostname": "'$(kubectl get pods -n portainer -o jsonpath='{ ..nodeName }')'"}}}}}' || (echo Failed to identify current node of portainer pod; exit 1)
sudo kubectl get pods -o wide -n portainer
Click to show the responce
yury@u2004d01:~/nfs-subdir-external-provisioner$ sudo kubectl patch storageclass managed-nfsone-storage -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
storageclass.storage.k8s.io/managed-nfsone-storage patched
yury@u2004d01:~/nfs-subdir-external-provisioner$ sudo kubectl get storageClass -o wide
NAME                               PROVISIONER                              RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
managed-nfsonc-storage             nfsonc/nfs-subdir-external-provisioner   Delete          Immediate           false                  64m
managed-nfsond-storage             nfsond/nfs-subdir-external-provisioner   Delete          Immediate           false                  67m
managed-nfsone-storage (default)   nfsone/nfs-subdir-external-provisioner   Delete          Immediate           false                  56s
yury@u2004d01:~/nfs-subdir-external-provisioner$ sudo kubectl apply -n portainer -f https://raw.githubusercontent.com/portainer/k8s/master/deploy/manifests/portainer/portainer.yaml
namespace/portainer created
serviceaccount/portainer-sa-clusteradmin created
persistentvolumeclaim/portainer created
clusterrolebinding.rbac.authorization.k8s.io/portainer created
service/portainer created
deployment.apps/portainer created
yury@u2004d01:~/nfs-subdir-external-provisioner$ sudo kubectl get pods -o wide -n portainer
NAME                        READY   STATUS    RESTARTS   AGE   IP             NODE       NOMINATED NODE   READINESS GATES
portainer-dcd599f8f-fvrnw   1/1     Running   0          15s   10.233.72.17   u2004d03   <none>           <none>

Running Portainer

  • as they say https and http are available
https://localhost:30779/ or http://localhost:30777/
  • with the browser at the hyper-v side six urls are available as well (tested)
http://u2004d01:30777/
http://u2004d02:30777/
http://u2004d03:30777/
https://u2004d01:30779/
https://u2004d02:30779/
https://u2004d03:30779/

picture

⚠️ **GitHub.com Fallback** ⚠️