Friday, 6 June 2025

Helm installation on rhel 9

 You can do install with 2 commands 

first one is

curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3

chmod 700 get_helm.sh

./get_helm.sh

or

directly install form online

curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash

memcache.go:265] "Unhandled Error" err="couldn't get current server API group list

 If you face the following error :  E0606 13:44:07.536927  102303 memcache.go:265] "Unhandled Error" err="couldn't get current server API group list: Get \"http://localhost:8080/api?timeout=32s\": dial tcp 127.0.0.1:8080: connect: connection refused"

For this you all need to do is change the follwoing 

grep server ~/.kube/config


if the result is like follows


server: https://127.0.0.1:6443


this is the reason it cause all you need to change it to 


server: https://controlnodeIP:6443


also you need to export the following


export  KUBECONFIG=/etc/rancher/rke2/rke2.yaml


that's all

RKE2 installation and configuration on rhel 9

Step 1

 

Update the server with following command

 

yum update -y

 

Step 2

 

Install Kubernetes before that we need to setup required kernel modules for that load the follwoing these are all need to be in all node

 

 modprobe br_netfilter

 modprobe ip_vs

 modprobe ip_vs_rr

 modprobe ip_vs_wrr

 modprobe ip_vs_sh

 modprobe overlay

 

then add the following module load to start on boot

 

cat > /etc/modules-load.d/kubernetes.conf << EOF

br_netfilter

ip_vs

ip_vs_rr

ip_vs_wrr

ip_vs_sh

overlay

EOF

 

add the following in kernel model

 

cat > /etc/sysctl.d/kubernetes.conf << EOF

net.ipv4.ip_forward = 1

net.bridge.bridge-nf-call-ip6tables = 1

net.bridge.bridge-nf-call-iptables = 1

EOF

 

enable it with following command

 

sysctl --system

 

Step 3

 

Disable the swap

 

swapoff -a

 

sed -e '/swap/s/^/#/g' -i /etc/fstab

 

Step 4

 

add the kubernetes repository

 

cat <<EOF | sudo tee /etc/yum.repos.d/kubernetes.repo

[kubernetes]

name=Kubernetes

baseurl=https://pkgs.k8s.io/core:/stable:/v1.29/rpm/

enabled=1

gpgcheck=1

gpgkey=https://pkgs.k8s.io/core:/stable:/v1.29/rpm/repodata/repomd.xml.key

exclude=kubelet kubeadm kubectl cri-tools kubernetes-cni

EOF

 

install with following command

 

dnf makecache; dnf install -y kubelet kubeadm kubectl --disableexcludes=kubernetes

 

The --disableexcludes=kubernetes flag ensures that packages from the Kubernetes repository are not excluded during installation.

 

now enable it and start the services

 

systemctl enable --now kubelet.service

 

Step 5

 

RKE2 installation with follwoing command

 

curl -sfL https://get.rke2.io | sh -

 

once it running the script this will install the rke2

 

in main server  create and the  followings

 

vi /etc/rancher/rke2/config.yaml

 

token: my-shared-secret

tls-san:

  - my-kubernetes-domain.com

  - another-kubernetes-domain.com

 

once this done need to enable the service and it will automatically start

 

systemctl enable --now kubelet.service

 

Once service is start then export the yaml file and also need to copy that as follow as

 

export KUBECONFIG=/etc/rancher/rke2/rke2.yaml

 

mkdir -p ~/.kube

 

cp /etc/rancher/rke2/rke2.yaml ~/.kube/config

 

modify the server from https://127.0.0.1:6443 to https://your cluster ip:6443

 

now you can try and get the nodes with the following command

 

kubectl get nodes

 

it will show the current nodes and it's roles

 

Step 6

 

Add the client.

 

"As RKE2 server nodes by default also run as agents you can get by with only running server nodes if you have

light user workloads. However if you want to segregate your control plane and user workloads you should run

agent nodes in your HA cluster as well."

 

curl -sfL https://get.rke2.io | sh -

 

for install agent run the follwing command


curl -sfL https://get.rke2.io | INSTALL_RKE2_TYPE="agent" sh -


vi /etc/rancher/rke2/config.yaml

 

add the following details and start the service


server: https://my-kubernetes-domain.com:9345

token: my-shared-secret


systemctl enable --now rke2-server.service

or

systemctl enable --now rke2-agent.service


Thursday, 14 May 2020

Permanent hostname setup for RHEL7

Step 1

Set the host name on NMTUI tool like following

nmtui


set host name  

then save and exit

Step 2

add the following line in last line of /etc/sysctl.conf

vi  /etc/sysctl.conf

kernel.hostname = hostname.example.com

then save and exit the editor and run the following command

sysctl -p

Step 3

now add the following line that mentioned below in the following file last line  /etc/cloud/cloud.cfg

vi /etc/cloud/cloud.cfg

preserve_hostname: true

save and exit  

then reboot and try again.

How to provide full access for shm partition

For the full access permission for the /dev/shm, just modify the following file with following changes.

open the following file with vi editor

vi /usr/lib/dracut/modules.d/95fcoe/cleanup-fcoe.sh


Just modify the 7th line mkdir -m 0755 to 0777 


then save and restart your server and check

Thursday, 16 April 2020

How to change default kernel in rhel 7

Step 1 

check the running kernel version

uname -a


Step 2 

List the kernel 

awk -F\' '$1=="menuentry " {print $2}' /etc/grub2.cfg



Step 3 

set the kernel that you want to put it default with following command

grub2-set-default 2


Step 4

Changes to /etc/default/grub require rebuilding the grub.cfg file as follows

grub2-mkconfig -o /boot/grub2/grub.cfg

reboot and check


Friday, 20 September 2019

kernel: svc: failed to register nfsaclv2 RPC service (errno 111)

When I restart the NFS service I got the following error like the image below




So I resolved the issue by the following steps.

Step 1

Checked the rpcbind status with the following command

service rpcbind status





I got the error like rpcbind dead but pid file exists

so I just restart the rpcbind service with the following command

service rpcbind start


Step 2

Checked the rpcinfo with following command

rpcinfo -p



then I just restart the nfs service with the following command 

service nfs restart




 That's all.
 



Friday, 4 January 2019

unknown filesystem type 'lvm2_member'

Sometimes we have face this issue when mounting another existing Linux HDD or linux LVM. 

When we trying to mount the partition  it should be activated otherwise it will show the unknown filesystem type. for this we need to do 2 simple commands only. Run the following commands and check.

modprobe dm-mod

modprob utility is used to add loadable modules to kernel. this command load the necessary modules

vgchange -ay

to activate the volume

now scan the LVM

lvscan

you can use this command before starting modprobe also to check which are active and inactive.

Now mount the filesystem

mount /dev/volgrp/lgvol /mnt

Thursday, 20 December 2018

How to redirect tomcat from apache with workers properties

Step 1

In this we are going to see the redirection tomcat from apache. For this we need to do the following steps.

First create workers.properties file and add the below mentioned details.

touch workers.properties

vi workers.properties

add

worker.list=tst

worker.tst.type=ajp13
worker.tst.port=8009
worker.tst.host=tomcat ip or hostname

Step 2

Add the workers.propertis details in apache config file.

vi /usr/local/apache2.x/conf/httpd.conf

JkExtractSSL On
JkHTTPSIndicator HTTPS
JkSESSIONIndicator SSL_SESSION_ID
JkCIPHERIndicator SSL_CIPHER
JkCERTSIndicator SSL_CLIENT_CERT
JkWorkersFile  "/usr/local/apache2.x/conf/workers.properties"
JkLogFile               "/usr/local/apache2/logs/mod_jk.log"
JkShmFile               "/usr/local/apache2/logs/jkshmi.log"
JkLogLevel              error


Now save and close it

Step 3

Now we need to add the few more details in http-ssl.conf

vi /usr/local/apache2.x/conf/extra/http-ssl.conf

add the below details before </VirtualHost>

JKMount /example tst
JKMount /example/* tst
JKMount /* tst

example --> is that you have the context name of tomcat web like http://192.168.1.2:8080/example

That's all ...

Tuesday, 20 November 2018

SFTP connection for single user to single directory

How to restict a user to use another directory?

Step 1

Create a directory with following command

mkdir /sftp-test

mkdir /sftp-test/sftp

then create a user and group 

groupadd usersftp

useradd -g usersftp-d /sftp-test -s /sbin/nologin sftpuser

Step 2

Edit the sshd_config file to allow the user to access perticular directory.

vi /etc/ssh/sshd_config

add the following lines and # the following

 Subsystem      sftp    /usr/libexec/openssh/sftp-server
#Subsystem      sftp    /usr/libexec/openssh/sftp-server

add the following 

Subsystem sftp internal-sftp

Match Group exchange
        ChrootDirectory %h
        ForceCommand internal-sftp
        AllowTcpForwarding no
        X11Forwarding no 


Step 3

Now we need to set the permissionas follows

chown root:root /sftp-test

chown sftpuser:root  /sftp-test/sftp

now restart the sshd and check it will work 100%

service sshd restart



 

Thursday, 4 October 2018

problem making ssl connection

For this issue you need to install below packages

yum -y install ca-certificates openssl nss

This issue cause only if your using centos 6 

Thanks

Helm installation on rhel 9

 You can do install with 2 commands  first one is curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-hel...