Wednesday, 30 June 2021

Very important for setting up OpenShift on bare metal

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


Very detailed but good tutorial

Tuesday, 29 June 2021

VirtualBox : Cannot enable nested VT-x/AMD-V without nested-paging and unresricted guest execution!

 Got this error after I enabled nested virtualization on my vm (was working previously):



Solution:https://github.com/GNS3/gns3-gui/issues/3032


  1. run this at command prompt: bcdedit /set hypervisorlaunchtype off
  2. turn off windows feature "Virtual Machine Platform" *Hyper-V)
  3. reboot






Monday, 28 June 2021

Connection to the server api.crc.testing:6443 was refused

 Troubleshoot using this: https://github.com/code-ready/crc/issues/1201

CRC - If u have error connecting to api server

Check this: https://github.com/code-ready/crc/issues/1212

 root@master:~# cat /sys/module/kvm_intel/parameters/nested

N

So I tried the following command:

root@master:~# modprobe -r kvm-intel
root@master:~# modprobe kvm-intel nested=1

Interesting CRC troubleshooting threads

https://github.com/code-ready/crc/issues/695

https://github.com/code-ready/crc/issues/1212

https://github.com/code-ready/crc/issues/1201

Friday, 25 June 2021

Invalid pull secret when crc start

Solution is copy the secret and paste into a file and run crc start -p <file> 






Thursday, 24 June 2021

Enable virtualization on VirtualBox

 In Windows, go to VirtualBox installation folders -> type cmd on the bar (it will pop up cmd in that folder) -> type VBoxManage modifyvm YourVirtualBoxName --nested-hw-virt on -> enter.


Now it should been ticked.

Tuesday, 15 June 2021

Another good site to setup single node openshift

 How to Setup Single Node OpenShift Cluster on RHEL 8 (linuxtechi.com)

CRC setup error

 If you have an error running CRC setup, restart and add more memory and CPU and rerun the following:

$ crc delete
$ crc cleanup
$ crc setup
$ crc start

https://github.com/code-ready/crc/issues/1485


[mars@rhel83 ~]$ crc setup

INFO Checking if running as non-root

INFO Checking if running inside WSL2

INFO Checking if admin-helper executable is cached

INFO Checking if running on a supported CPU architecture

INFO Checking minimum RAM requirements

INFO Checking if Virtualization is enabled

INFO Checking if KVM is enabled

INFO Checking if libvirt is installed

INFO Checking if user is part of libvirt group

INFO Checking if active user/process is currently part of the libvirt group

INFO Checking if libvirt daemon is running

INFO Checking if a supported libvirt version is installed

INFO Checking if crc-driver-libvirt is installed

INFO Checking if systemd-networkd is running

INFO Checking if NetworkManager is installed

INFO Checking if NetworkManager service is running

INFO Checking if /etc/NetworkManager/conf.d/crc-nm-dnsmasq.conf exists

INFO Writing Network Manager config for crc

INFO Using root access: Writing NetworkManager configuration to /etc/NetworkManager/conf.d/crc-nm-dnsmasq.conf

[sudo] password for mars:

INFO Using root access: Changing permissions for /etc/NetworkManager/conf.d/crc-nm-dnsmasq.conf to 644

INFO Using root access: Executing systemctl daemon-reload command

INFO Using root access: Executing systemctl reload NetworkManager

INFO Checking if /etc/NetworkManager/dnsmasq.d/crc.conf exists

INFO Writing dnsmasq config for crc

INFO Using root access: Writing NetworkManager configuration to /etc/NetworkManager/dnsmasq.d/crc.conf

INFO Using root access: Changing permissions for /etc/NetworkManager/dnsmasq.d/crc.conf to 644

INFO Using root access: Executing systemctl daemon-reload command

INFO Using root access: Executing systemctl reload NetworkManager

INFO Checking if libvirt 'crc' network is available

INFO Setting up libvirt 'crc' network

INFO Checking if libvirt 'crc' network is active

INFO Starting libvirt 'crc' network

INFO Checking if CRC bundle is extracted in '$HOME/.crc'

INFO Checking if /home/mars/.crc/cache/crc_libvirt_4.7.11.crcbundle exists

Your system is correctly setup for using CodeReady Containers, you can now run 'crc start' to start the OpenShift cluster

[mars@rhel83 ~]$ crc start

INFO Checking if running as non-root

INFO Checking if running inside WSL2

INFO Checking if admin-helper executable is cached

INFO Checking if running on a supported CPU architecture

INFO Checking minimum RAM requirements

INFO Checking if Virtualization is enabled

INFO Checking if KVM is enabled

INFO Checking if libvirt is installed

INFO Checking if user is part of libvirt group

INFO Checking if active user/process is currently part of the libvirt group

INFO Checking if libvirt daemon is running

INFO Checking if a supported libvirt version is installed

INFO Checking if crc-driver-libvirt is installed

INFO Checking if systemd-networkd is running

INFO Checking if NetworkManager is installed

INFO Checking if NetworkManager service is running

INFO Checking if /etc/NetworkManager/conf.d/crc-nm-dnsmasq.conf exists

INFO Checking if /etc/NetworkManager/dnsmasq.d/crc.conf exists

INFO Checking if libvirt 'crc' network is available

INFO Checking if libvirt 'crc' network is active

CodeReady Containers requires a pull secret to download content from Red Hat.

You can copy it from the Pull Secret section of https://cloud.redhat.com/openshift/create/local.

? Please enter the pull secret **********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************

WARN Cannot add pull secret to keyring: failed to unlock correct collection '/org/freedesktop/secrets/collection/login'

INFO Loading bundle: crc_libvirt_4.7.11.crcbundle...

INFO Creating CodeReady Containers VM for OpenShift 4.7.11...

INFO Starting CodeReady Containers VM for OpenShift 4.7.11...

INFO CodeReady Containers instance is running with IP 192.168.130.11

INFO CodeReady Containers VM is running

INFO Generating new SSH Key pair...

INFO Updating authorized keys...

INFO Copying kubeconfig file to instance dir...

INFO Starting network time synchronization in CodeReady Containers VM

INFO Check internal and public DNS query...

INFO Check DNS query from host...

INFO Adding user's pull secret to instance disk...

INFO Verifying validity of the kubelet certificates...

INFO Starting OpenShift kubelet service

INFO Waiting for kube-apiserver availability... [takes around 2min]

INFO Adding user's pull secret to the cluster...

INFO Generating new password for the kubeadmin user

INFO Updating cluster ID...

INFO Starting OpenShift cluster... [waiting for the cluster to stabilize]

INFO 7 operators are progressing: authentication, dns, image-registry, network, openshift-controller-manager, ...

INFO 6 operators are progressing: authentication, dns, image-registry, network, openshift-controller-manager, ...

INFO 4 operators are progressing: authentication, image-registry, kube-apiserver, openshift-controller-manager

INFO 4 operators are progressing: authentication, image-registry, kube-apiserver, openshift-controller-manager

INFO 5 operators are progressing: authentication, image-registry, kube-apiserver, openshift-controller-manager, operator-lifecycle-manager-packageserver

INFO All operators are available. Ensuring stability...

ERRO Cluster is not ready: cluster operators are still not stable after 11m30.841378628s

INFO Adding crc-admin and crc-developer contexts to kubeconfig...

Started the OpenShift cluster.


The server is accessible via web console at:

  https://console-openshift-console.apps-crc.testing


Log in as administrator:

  Username: kubeadmin

  Password: RHWvU-6HoEU-7NqXQ-pgcNw


Log in as user:

  Username: developer

  Password: developer


Use the 'oc' command line interface:

  $ eval $(crc oc-env)

  $ oc login -u developer https://api.crc.testing:6443


Monday, 14 June 2021

Openshift CRC error

 I got this error:

Last login: Tue Jun 15 11:52:57 2021

[root@rhel83 ~]# hostname

rhel83.localdomain

[root@rhel83 ~]# su - mars

[mars@rhel83 ~]$ crc setup

INFO Checking if running as non-root

INFO Checking if running inside WSL2

INFO Checking if admin-helper executable is cached

INFO Checking if running on a supported CPU architecture

INFO Checking minimum RAM requirements

INFO Checking if Virtualization is enabled

INFO Setting up virtualization

You need to enable virtualization in BIOS



But actually, virtualization is already enabled. 
 
I tried turning on neste virtualization but it didn't work:
https://pve.proxmox.com/wiki/Nested_Virtualization
https://forum.proxmox.com/threads/nested-virtualization.25996/

But still same error. Till I came across this post:
https://www.cbulon.nl/tag/proxmox/

My savior!!!

Important - need to run these 2 commands after reboot:
# modprobe -r kvm_intel
# modprobe kvm_intel

docker push connect: connection refused

 The push refers to a repository [192.168.0.82:5000/tomcat-unica-journey-12.1]

Put http://192.168.0.82:5000/v1/repositories/tomcat-unica-journey-12.1/: dial tcp 192.168.0.82:5000: connect: connection refused

The push refers to a repository [192.168.0.82:5000/tomcat-unica-centralizedoffers-12.1]

Put http://192.168.0.82:5000/v1/repositories/tomcat-unica-centralizedoffers-12.1/: dial tcp 192.168.0.82:5000: connect: connection refused

The push refers to a repository [192.168.0.82:5000/tomcat-unica-interact-12.1]

Put http://192.168.0.82:5000/v1/repositories/tomcat-unica-interact-12.1/: dial tcp 192.168.0.82:5000: connect: connection refused

The push refers to a repository [192.168.0.82:5000/tomcat-unica-plan-12.1]

Put http://192.168.0.82:5000/v1/repositories/tomcat-unica-plan-12.1/: dial tcp 192.168.0.82:5000: connect: connection refused

The push refers to a repository [192.168.0.82:5000/tomcat-unica-platform-12.1]

Put http://192.168.0.82:5000/v1/repositories/tomcat-unica-platform-12.1/: dial tcp 192.168.0.82:5000: connect: connection refused

The push refers to a repository [192.168.0.82:5000/tomcat-unica-insights-12.1]

Put http://192.168.0.82:5000/v1/repositories/tomcat-unica-insights-12.1/: dial tcp 192.168.0.82:5000: connect: connection refused

The push refers to a repository [192.168.0.82:5000/tomcat-unica-assetpicker-12.1]

Put http://192.168.0.82:5000/v1/repositories/tomcat-unica-assetpicker-12.1/: dial tcp 192.168.0.82:5000: connect: connection refused

The push refers to a repository [192.168.0.82:5000/tomcat-unica-campaign-12.1]

Put http://192.168.0.82:5000/v1/repositories/tomcat-unica-campaign-12.1/: dial tcp 192.168.0.82:5000: connect: connection refused

The push refers to a repository [192.168.0.82:5000/unica-install-12.1]

Put http://192.168.0.82:5000/v1/repositories/unica-install-12.1/: dial tcp 192.168.0.82:5000: connect: connection refused

The push refers to a repository [192.168.0.82:5000/unica-journey-12.1]

Put http://192.168.0.82:5000/v1/repositories/unica-journey-12.1/: dial tcp 192.168.0.82:5000: connect: connection refused

The push refers to a repository [192.168.0.82:5000/unica-director-12.1]

Put http://192.168.0.82:5000/v1/repositories/unica-director-12.1/: dial tcp 192.168.0.82:5000: connect: connection refused

The push refers to a repository [192.168.0.82:5000/unica-listener-12.1]

Put http://192.168.0.82:5000/v1/repositories/unica-listener-12.1/: dial tcp 192.168.0.82:5000: connect: connection refused




[root@unica12master 12.1]# docker ps | grep registry
[root@unica12master 12.1]#

This means not running



[root@unica12master 12.1]# docker run -d -p 5000:5000 --restart=always --name registry registry:2
Unable to find image 'registry:2' locally
Trying to pull repository registry.access.redhat.com/registry ...
Pulling repository registry.access.redhat.com/registry
Trying to pull repository registry.redhat.io/registry ...
Trying to pull repository docker.io/library/registry ...
2: Pulling from docker.io/library/registry
ddad3d7c1e96: Pull complete
6eda6749503f: Pull complete
363ab70c2143: Pull complete
5b94580856e6: Pull complete
12008541203a: Pull complete
Digest: sha256:bac2d7050dc4826516650267fe7dc6627e9e11ad653daca0641437abdf18df27
Status: Downloaded newer image for docker.io/registry:2
477a2c466dfdbf6fead8110eb3ed2b095afab7ae6811b8308c461dcf17cc021a
[root@unica12master 12.1]# docker ps | grep registry
477a2c466dfd        registry:2               "/entrypoint.sh /e..."   22 seconds ago      Up 20 seconds       0.0.0.0:5000->5000/tcp   registry




Error: namespaces "default" is forbidden: User "system:serviceaccount:kube-system:default" cannot get resource "namespaces" in API group "" in the namespace "default"

 [root@unica12master Helm-updated-v12.1-db2]# ./start

-bash: ./start: No such file or directory

[root@unica12master Helm-updated-v12.1-db2]# ./startunicamaster.sh

start pv

persistentvolume/pv2 unchanged

start matrix server

start ng

Error: release nginx failed: namespaces "default" is forbidden: User "system:serviceaccount:kube-system:default" cannot get resource "namespaces" in API group "" in the namespace "default"

start unica

Error: release hcl failed: namespaces "default" is forbidden: User "system:serviceaccount:kube-system:default" cannot get resource "namespaces" in API group "" in the namespace "default"




Solution:
[root@unica12master Helm-updated-v12.1-db2]# kubectl create serviceaccount --namespace kube-system tiller
serviceaccount/tiller created

[root@unica12master Helm-updated-v12.1-db2]# kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
clusterrolebinding.rbac.authorization.k8s.io/tiller-cluster-rule created

[root@unica12master Helm-updated-v12.1-db2]# kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
deployment.apps/tiller-deploy patched

Unable to get an update from the "stable" chart repository (https://kubernetes-charts.storage.googleapis.com)

 Change in helm repo


[root@unica12master Helm-updated-v12.1-db2]# helm repo list

NAME    URL

stable  https://kubernetes-charts.storage.googleapis.com

local   http://127.0.0.1:8879/charts

[root@unica12master Helm-updated-v12.1-db2]# helm repo update

Hang tight while we grab the latest from your chart repositories...

...Skip local chart repository

...Unable to get an update from the "stable" chart repository (https://kubernetes-charts.storage.googleapis.com):

        Failed to fetch https://kubernetes-charts.storage.googleapis.com/index.yaml : 403 Forbidden

Update Complete.



Solution : need to change helm repo location:
https://helm.sh/blog/new-location-stable-incubator-charts/

Kubernetes and Cloud Weave

 Need to run this command

 kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"

Instead of this:

# kubectl apply -f "https://cloud.weave.works/k8s/net?k8sversion=$kubever" 


Reference: https://www.weave.works/docs/net/latest/kubernetes/kube-addon/

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...