Thursday, 27 August 2020

Getting started on OpenShift

 OK, guys, time to take the OpenShift plunge.

Need this for my work and I will setting it up in my home lab.

My references:

https://itnext.io/guide-installing-an-okd-4-5-cluster-508a2631cbee

https://medium.com/@craig_robinson/openshift-4-4-okd-bare-metal-install-on-vmware-home-lab-6841ce2d37eb

https://emarcel.com/installing-openshift-origin-in-a-home-lab/



Unfortunately, the above does not work, been trying so many days...

Firstly the IP addresses have to follow as per instructions as or else it will not work as it is hardcoded esp in the DNS

Sunday, 9 August 2020

Remove node from cluster

 kubectl get nodes

1) First drain the node

kubectl drain <node-name>

You might have to ignore daemonsets and local-data in the machine

kubectl drain <node-name> --ignore-daemonsets --delete-local-data

2) Edit instance group for nodes (Only if you are using kops)

kops edit ig nodes

Set the MIN and MAX size to whatever it is -1 Just save the file (nothing extra to be done)

You still might see some pods in the drained node that are related to daemonsets like networking plugin, fluentd for logs, kubedns/coredns etc

3) Finally delete the node

kubectl delete node <node-name>

4) Commit the state for KOPS in s3: (Only if you are using kops)

kops update cluster --yes

OR (if you are using kubeadm)

If you are using kubeadm and would like to reset the machine to a state which was there before running kubeadm join then run

kubeadm reset

Saturday, 8 August 2020

Pods not autostarting

 I realised that when i reboot my VMs, all the pods were not restarting.

Then I realised it was because my DB2 was not auto-started.

To start DB2 upon boot: https://www.ibm.com/support/pages/configure-db2-instance-start-automatically-boot-time


To determine if an instance is enabled to automatically start at boot time, execute this command logged in as the instance owner:

db2set DB2AUTOSTART -i db2inst1

A return of "YES" means the instance is set to start automatically. Otherwise it is not set.

To configure the instance to start automatically at boot:

db2iauto -on <instance name>

In the instance file <InstanceHome>/sqllib/profile.env there will be an entry like this:

DB2AUTOSTART='YES'

If there is an issue starting the DB2 instance, take a look at the following file:

<InstanceHome>/sqllib/db2dump/db2diag.log

kubectl get nodes NotReady

 Got this error: 


[root@unica12master .kube]# kubectl get nodes

NAME                        STATUS     ROLES    AGE   VERSION

unica12master.localdomain   NotReady   master   11m   v1.18.6

unica12node1.localdomain    NotReady   <none>   11m   v1.18.6

unica12node2.localdomain    NotReady   <none>   10m   v1.18.6




Upon checking: alse reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized (ned to install weave). See : https://stackoverflow.com/questions/52675934/network-plugin-is-not-ready-cni-config-uninitialized
(do this on the msater only)
$ export kubever=$(kubectl version | base64 | tr -d '\n')
$ kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$kubever"
[root@unica12master .kube]# kubectl describe nodes
Name:               unica12master.localdomain
Roles:              master
Labels:             beta.kubernetes.io/arch=amd64
                    beta.kubernetes.io/os=linux
                    kubernetes.io/arch=amd64
                    kubernetes.io/hostname=unica12master.localdomain
                    kubernetes.io/os=linux
                    node-role.kubernetes.io/master=
Annotations:        kubeadm.alpha.kubernetes.io/cri-socket: /var/run/dockershim.sock
                    node.alpha.kubernetes.io/ttl: 0
                    volumes.kubernetes.io/controller-managed-attach-detach: true
CreationTimestamp:  Sun, 09 Aug 2020 05:49:34 +0800
Taints:             node-role.kubernetes.io/master:NoSchedule
                    node.kubernetes.io/not-ready:NoSchedule
Unschedulable:      false
Lease:
  HolderIdentity:  unica12master.localdomain
  AcquireTime:     <unset>
  RenewTime:       Sun, 09 Aug 2020 05:59:53 +0800
Conditions:
  Type             Status  LastHeartbeatTime                 LastTransitionTime                Reason                       Message
  ----             ------  -----------------                 ------------------                ------                       -------
  MemoryPressure   False   Sun, 09 Aug 2020 05:59:44 +0800   Sun, 09 Aug 2020 05:49:31 +0800   KubeletHasSufficientMemory   kubelet has sufficient memory available
  DiskPressure     False   Sun, 09 Aug 2020 05:59:44 +0800   Sun, 09 Aug 2020 05:49:31 +0800   KubeletHasNoDiskPressure     kubelet has no disk pressure
  PIDPressure      False   Sun, 09 Aug 2020 05:59:44 +0800   Sun, 09 Aug 2020 05:49:31 +0800   KubeletHasSufficientPID      kubelet has sufficient PID available
  Ready            False   Sun, 09 Aug 2020 05:59:44 +0800   Sun, 09 Aug 2020 05:49:31 +0800   KubeletNotReady              runtime network not ready: NetworkReady=f                                                                        alse reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized
Addresses:
  InternalIP:  192.168.1.151
  Hostname:    unica12master.localdomain
Capacity:
  cpu:                2
  ephemeral-storage:  49250820Ki
  hugepages-1Gi:      0
  hugepages-2Mi:      0
  memory:             3880732Ki
  pods:               110
Allocatable:
  cpu:                2
  ephemeral-storage:  45389555637
  hugepages-1Gi:      0
  hugepages-2Mi:      0
  memory:             3778332Ki
  pods:               110
System Info:
  Machine ID:                 44cfb44606f9476bb54c62a10588dcd1
  System UUID:                A6554D56-C05F-515D-BD13-8D20A4DEAEF1
  Boot ID:                    033a9b2d-82eb-483c-a603-edec28fc35ac
  Kernel Version:             3.10.0-957.el7.x86_64
  OS Image:                   Red Hat Enterprise Linux
  Operating System:           linux
  Architecture:               amd64
  Container Runtime Version:  docker://1.13.1
  Kubelet Version:            v1.18.6
  Kube-Proxy Version:         v1.18.6
Non-terminated Pods:          (5 in total)
  Namespace                   Name                                                 CPU Requests  CPU Limits  Memory Requests  Memory Limits  AGE
  ---------                   ----                                                 ------------  ----------  ---------------  -------------  ---
  kube-system                 etcd-unica12master.localdomain                       0 (0%)        0 (0%)      0 (0%)           0 (0%)         10m
  kube-system                 kube-apiserver-unica12master.localdomain             250m (12%)    0 (0%)      0 (0%)           0 (0%)         10m
  kube-system                 kube-controller-manager-unica12master.localdomain    200m (10%)    0 (0%)      0 (0%)           0 (0%)         10m
  kube-system                 kube-proxy-bgb9q                                     0 (0%)        0 (0%)      0 (0%)           0 (0%)         10m
  kube-system                 kube-scheduler-unica12master.localdomain             100m (5%)     0 (0%)      0 (0%)           0 (0%)         10m
Allocated resources:
  (Total limits may be over 100 percent, i.e., overcommitted.)
  Resource           Requests    Limits
  --------           --------    ------
  cpu                550m (27%)  0 (0%)
  memory             0 (0%)      0 (0%)
  ephemeral-storage  0 (0%)      0 (0%)
  hugepages-1Gi      0 (0%)      0 (0%)
  hugepages-2Mi      0 (0%)      0 (0%)
Events:
  Type    Reason                   Age                From                                   Message
  ----    ------                   ----               ----                                   -------
  Normal  NodeHasSufficientMemory  10m (x4 over 10m)  kubelet, unica12master.localdomain     Node unica12master.localdomain status is now: NodeHasSufficientMemory
  Normal  NodeHasNoDiskPressure    10m (x4 over 10m)  kubelet, unica12master.localdomain     Node unica12master.localdomain status is now: NodeHasNoDiskPressure
  Normal  NodeHasSufficientPID     10m (x4 over 10m)  kubelet, unica12master.localdomain     Node unica12master.localdomain status is now: NodeHasSufficientPID
  Normal  Starting                 10m                kubelet, unica12master.localdomain     Starting kubelet.
  Normal  NodeAllocatableEnforced  10m                kubelet, unica12master.localdomain     Updated Node Allocatable limit across pods
  Normal  NodeHasSufficientMemory  10m                kubelet, unica12master.localdomain     Node unica12master.localdomain status is now: NodeHasSufficientMemory
  Normal  NodeHasNoDiskPressure    10m                kubelet, unica12master.localdomain     Node unica12master.localdomain status is now: NodeHasNoDiskPressure
  Normal  NodeHasSufficientPID     10m                kubelet, unica12master.localdomain     Node unica12master.localdomain status is now: NodeHasSufficientPID
  Normal  Starting                 10m                kube-proxy, unica12master.localdomain  Starting kube-proxy.


Name:               unica12node1.localdomain
Roles:              <none>
Labels:             beta.kubernetes.io/arch=amd64
                    beta.kubernetes.io/os=linux
                    kubernetes.io/arch=amd64
                    kubernetes.io/hostname=unica12node1.localdomain
                    kubernetes.io/os=linux
Annotations:        kubeadm.alpha.kubernetes.io/cri-socket: /var/run/dockershim.sock
                    node.alpha.kubernetes.io/ttl: 0
                    volumes.kubernetes.io/controller-managed-attach-detach: true
CreationTimestamp:  Sun, 09 Aug 2020 05:50:13 +0800
Taints:             node.kubernetes.io/not-ready:NoSchedule
Unschedulable:      false
Lease:
  HolderIdentity:  unica12node1.localdomain
  AcquireTime:     <unset>
  RenewTime:       Sun, 09 Aug 2020 05:59:53 +0800
Conditions:
  Type             Status  LastHeartbeatTime                 LastTransitionTime                Reason                       Message
  ----             ------  -----------------                 ------------------                ------                       -------
  MemoryPressure   False   Sun, 09 Aug 2020 05:55:43 +0800   Sun, 09 Aug 2020 05:50:13 +0800   KubeletHasSufficientMemory   kubelet has sufficient memory available
  DiskPressure     False   Sun, 09 Aug 2020 05:55:43 +0800   Sun, 09 Aug 2020 05:50:13 +0800   KubeletHasNoDiskPressure     kubelet has no disk pressure
  PIDPressure      False   Sun, 09 Aug 2020 05:55:43 +0800   Sun, 09 Aug 2020 05:50:13 +0800   KubeletHasSufficientPID      kubelet has sufficient PID available
  Ready            False   Sun, 09 Aug 2020 05:55:43 +0800   Sun, 09 Aug 2020 05:50:13 +0800   KubeletNotReady              runtime network not ready: NetworkReady=f                                                                        alse reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized
Addresses:
  InternalIP:  192.168.1.152
  Hostname:    unica12node1.localdomain
Capacity:
  cpu:                6
  ephemeral-storage:  49250820Ki
  hugepages-1Gi:      0
  hugepages-2Mi:      0
  memory:             16266432Ki
  pods:               110
Allocatable:
  cpu:                6
  ephemeral-storage:  45389555637
  hugepages-1Gi:      0
  hugepages-2Mi:      0
  memory:             16164032Ki
  pods:               110
System Info:
  Machine ID:                 81ea4d0c7f724822b21c1dc2f071bf77
  System UUID:                35FE4D56-2DF2-1860-9B73-16F895B11091
  Boot ID:                    a90cd1a4-44de-4ef4-96c0-19ef9fbf8cd1
  Kernel Version:             3.10.0-957.el7.x86_64
  OS Image:                   Red Hat Enterprise Linux
  Operating System:           linux
  Architecture:               amd64
  Container Runtime Version:  docker://1.13.1
  Kubelet Version:            v1.18.6
  Kube-Proxy Version:         v1.18.6
Non-terminated Pods:          (1 in total)
  Namespace                   Name                CPU Requests  CPU Limits  Memory Requests  Memory Limits  AGE
  ---------                   ----                ------------  ----------  ---------------  -------------  ---
  kube-system                 kube-proxy-snxhr    0 (0%)        0 (0%)      0 (0%)           0 (0%)         9m50s
Allocated resources:
  (Total limits may be over 100 percent, i.e., overcommitted.)
  Resource           Requests  Limits
  --------           --------  ------
  cpu                0 (0%)    0 (0%)
  memory             0 (0%)    0 (0%)
  ephemeral-storage  0 (0%)    0 (0%)
  hugepages-1Gi      0 (0%)    0 (0%)
  hugepages-2Mi      0 (0%)    0 (0%)
Events:
  Type    Reason                   Age                    From                                  Message
  ----    ------                   ----                   ----                                  -------
  Normal  Starting                 9m50s                  kubelet, unica12node1.localdomain     Starting kubelet.
  Normal  NodeHasSufficientMemory  9m50s (x2 over 9m50s)  kubelet, unica12node1.localdomain     Node unica12node1.localdomain status is now: NodeHasSufficientMemory
  Normal  NodeHasNoDiskPressure    9m50s (x2 over 9m50s)  kubelet, unica12node1.localdomain     Node unica12node1.localdomain status is now: NodeHasNoDiskPressure
  Normal  NodeHasSufficientPID     9m50s (x2 over 9m50s)  kubelet, unica12node1.localdomain     Node unica12node1.localdomain status is now: NodeHasSufficientPID
  Normal  NodeAllocatableEnforced  9m50s                  kubelet, unica12node1.localdomain     Updated Node Allocatable limit across pods
  Normal  Starting                 9m39s                  kube-proxy, unica12node1.localdomain  Starting kube-proxy.


Name:               unica12node2.localdomain
Roles:              <none>
Labels:             beta.kubernetes.io/arch=amd64
                    beta.kubernetes.io/os=linux
                    kubernetes.io/arch=amd64
                    kubernetes.io/hostname=unica12node2.localdomain
                    kubernetes.io/os=linux
Annotations:        kubeadm.alpha.kubernetes.io/cri-socket: /var/run/dockershim.sock
                    node.alpha.kubernetes.io/ttl: 0
                    volumes.kubernetes.io/controller-managed-attach-detach: true
CreationTimestamp:  Sun, 09 Aug 2020 05:50:29 +0800
Taints:             node.kubernetes.io/not-ready:NoSchedule
Unschedulable:      false
Lease:
  HolderIdentity:  unica12node2.localdomain
  AcquireTime:     <unset>
  RenewTime:       Sun, 09 Aug 2020 05:59:59 +0800
Conditions:
  Type             Status  LastHeartbeatTime                 LastTransitionTime                Reason                       Message
  ----             ------  -----------------                 ------------------                ------                       -------
  MemoryPressure   False   Sun, 09 Aug 2020 05:55:59 +0800   Sun, 09 Aug 2020 05:50:29 +0800   KubeletHasSufficientMemory   kubelet has sufficient memory available
  DiskPressure     False   Sun, 09 Aug 2020 05:55:59 +0800   Sun, 09 Aug 2020 05:50:29 +0800   KubeletHasNoDiskPressure     kubelet has no disk pressure
  PIDPressure      False   Sun, 09 Aug 2020 05:55:59 +0800   Sun, 09 Aug 2020 05:50:29 +0800   KubeletHasSufficientPID      kubelet has sufficient PID available
  Ready            False   Sun, 09 Aug 2020 05:55:59 +0800   Sun, 09 Aug 2020 05:50:29 +0800   KubeletNotReady              runtime network not ready: NetworkReady=f                                                                        alse reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized
Addresses:
  InternalIP:  192.168.1.153
  Hostname:    unica12node2.localdomain
Capacity:
  cpu:                6
  ephemeral-storage:  49250820Ki
  hugepages-1Gi:      0
  hugepages-2Mi:      0
  memory:             16266432Ki
  pods:               110
Allocatable:
  cpu:                6
  ephemeral-storage:  45389555637
  hugepages-1Gi:      0
  hugepages-2Mi:      0
  memory:             16164032Ki
  pods:               110
System Info:
  Machine ID:                 2776e487ba884dc8b59c196d17b1354b
  System UUID:                CCB04D56-2D23-EF34-CC74-BD921B461E06
  Boot ID:                    06a85a26-dc33-447f-894d-4eccbac0be5e
  Kernel Version:             3.10.0-957.el7.x86_64
  OS Image:                   Red Hat Enterprise Linux
  Operating System:           linux
  Architecture:               amd64
  Container Runtime Version:  docker://1.13.1
  Kubelet Version:            v1.18.6
  Kube-Proxy Version:         v1.18.6
Non-terminated Pods:          (1 in total)
  Namespace                   Name                CPU Requests  CPU Limits  Memory Requests  Memory Limits  AGE
  ---------                   ----                ------------  ----------  ---------------  -------------  ---
  kube-system                 kube-proxy-hj582    0 (0%)        0 (0%)      0 (0%)           0 (0%)         9m34s
Allocated resources:
  (Total limits may be over 100 percent, i.e., overcommitted.)
  Resource           Requests  Limits
  --------           --------  ------
  cpu                0 (0%)    0 (0%)
  memory             0 (0%)    0 (0%)
  ephemeral-storage  0 (0%)    0 (0%)
  hugepages-1Gi      0 (0%)    0 (0%)
  hugepages-2Mi      0 (0%)    0 (0%)
Events:
  Type    Reason                   Age                    From                                  Message
  ----    ------                   ----                   ----                                  -------
  Normal  Starting                 9m34s                  kubelet, unica12node2.localdomain     Starting kubelet.
  Normal  NodeHasSufficientMemory  9m34s (x2 over 9m34s)  kubelet, unica12node2.localdomain     Node unica12node2.localdomain status is now: NodeHasSufficientMemory
  Normal  NodeHasNoDiskPressure    9m34s (x2 over 9m34s)  kubelet, unica12node2.localdomain     Node unica12node2.localdomain status is now: NodeHasNoDiskPressure
  Normal  NodeHasSufficientPID     9m34s (x2 over 9m34s)  kubelet, unica12node2.localdomain     Node unica12node2.localdomain status is now: NodeHasSufficientPID
  Normal  NodeAllocatableEnforced  9m34s                  kubelet, unica12node2.localdomain     Updated Node Allocatable limit across pods
  Normal  Starting                 9m23s                  kube-proxy, unica12node2.localdomain  Starting kube-proxy.

Tuesday, 4 August 2020

Download Cloudera Quickstart VMs

Apparently you can't download these anymore but someone found this:

And here are the links:-)

Dropdown Title: Select a Platform
Dropdown Type: downloadType
Option Title: Virtual Box
Option Value: vb
Download Location: https://downloads.cloudera.com/demo_vm/virtualbox/cloudera-quickstart-vm-5.13.0-0-virtualbox.zip
Download Type: asset
Option Title: VMWare
Option Value: vmw
Download Location: https://downloads.cloudera.com/demo_vm/vmware/cloudera-quickstart-vm-5.13.0-0-vmware.zip
Download Type: asset
Option Title: KVM
Option Value: kvm
Download Location: https://downloads.cloudera.com/demo_vm/kvm/cloudera-quickstart-vm-5.13.0-0-kvm.zip
Download Type: asset
Option Title: Docker Image
Option Value: docker
Download Location: https://downloads.cloudera.com/demo_vm/docker/cloudera-quickstart-vm-5.13.0-0-beta-docker.tar.gz
Download Type: asset


For information on how to run them:

PVC in terminating state

Referencee:https://veducate.co.uk/kubernetes-pvc-terminating/  I still had errors performing deployment, till I released that although I pre...