<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>rocky linux &#8211; Blog of Kliment Andreev &#8211; A place so I won&#039;t forget things</title>
	<atom:link href="https://blog.andreev.it/tag/rocky-linux/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.andreev.it</link>
	<description></description>
	<lastBuildDate>Sun, 22 Oct 2023 13:21:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>Install Kubernetes with CRI-O and Cilium on Rocky Linux 9 / VMware / Bare Metal</title>
		<link>https://blog.andreev.it/2023/10/install-kubernetes-with-cri-o-and-cilium-on-rocky-linux-9/</link>
					<comments>https://blog.andreev.it/2023/10/install-kubernetes-with-cri-o-and-cilium-on-rocky-linux-9/#respond</comments>
		
		<dc:creator><![CDATA[Kliment Andreev]]></dc:creator>
		<pubDate>Mon, 09 Oct 2023 16:18:16 +0000</pubDate>
				<category><![CDATA[Containers]]></category>
		<category><![CDATA[DevOps]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[ESX/ESXi]]></category>
		<category><![CDATA[Rocky Linux]]></category>
		<category><![CDATA[Cilium]]></category>
		<category><![CDATA[CRI-O]]></category>
		<category><![CDATA[ESXi]]></category>
		<category><![CDATA[Kubernetes]]></category>
		<category><![CDATA[MetalLB]]></category>
		<category><![CDATA[rocky linux]]></category>
		<category><![CDATA[VMware]]></category>
		<guid isPermaLink="false">https://blog.andreev.it/?p=9532</guid>

					<description><![CDATA[In this post, I&#8217;ll build a Kubernetes cluster with one master and two nodes&#8230;]]></description>
										<content:encoded><![CDATA[<div id="bsf_rt_marker"></div><p>In this post, I&#8217;ll build a Kubernetes cluster with one master and two nodes using CRI-O and Cilium. I have DNS in my environment but you can use the hosts files if needed.<br />
The OS will be Rocky Linux 9 running on ESXi 8.x but this should work on any other bare metal server too. The config for the nodes is:</p>
<p>&#8211; Master: 2 CPUs, 4GB RAM<br />
&#8211; Workers: 2 CPUs, 8GB RAM.</p>
<p>First, we&#8217;ll have to disable swap and put SELinux in permissive mode.<br />
<strong>Do this on all nodes (master + workers).</strong></p>
<pre class="brush: bash; title: ; notranslate">
sudo swapoff -a
sudo sed -i &#039;/ swap / s/^\(.*\)$/#\1/g&#039; /etc/fstab
sudo setenforce 0
sudo sed -i &#039;s/^SELINUX=enforcing$/SELINUX=permissive/&#039; /etc/selinux/config
</pre>
<p>Now, we have to open some firewall ports for Kubernetes..<br />
<strong>Do this on the master node only.</strong></p>
<pre class="brush: bash; title: ; notranslate">
sudo firewall-cmd --permanent --add-port=6443/tcp
sudo firewall-cmd --permanent --add-port=2379-2380/tcp
sudo firewall-cmd --permanent --add-port=10250/tcp
sudo firewall-cmd --permanent --add-port=10259/tcp
sudo firewall-cmd --permanent --add-port=10257/tcp
sudo firewall-cmd --reload
</pre>
<p><strong>Do this on the workers only.</strong></p>
<pre class="brush: bash; title: ; notranslate">
sudo firewall-cmd --permanent --add-port=10250/tcp
sudo firewall-cmd --permanent --add-port=30000-32767/tcp   
sudo firewall-cmd --reload
</pre>
<p>In addition, we&#8217;ll have to open the firewall ports for Cilium.<br />
<strong>Do this on all nodes</strong>.</p>
<pre class="brush: bash; title: ; notranslate">
sudo firewall-cmd --permanent --add-port=4240/tcp 
sudo firewall-cmd --permanent --add-port=8472/udp 
sudo firewall-cmd --reload
</pre>
<p>Now, we have to make some changes that are also required. Some necessary modules and IPtables change.<br />
<strong>Do this on all nodes.</strong></p>
<pre class="brush: bash; title: ; notranslate">
cat &lt;&lt;EOF | sudo tee /etc/modules-load.d/k8s.conf
overlay
br_netfilter
EOF

sudo modprobe overlay
sudo modprobe br_netfilter

# sysctl params required by setup, params persist across reboots
cat &lt;&lt;EOF | sudo tee /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-iptables  = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.ipv4.ip_forward                 = 1
EOF

# Apply sysctl params without reboot
sudo sysctl --system
</pre>
<p>We have to install CRI-O container runtime.<br />
<strong>Do this on all nodes.</strong></p>
<pre class="brush: bash; title: ; notranslate">
VERSION=1.22
sudo curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable.repo https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/CentOS_8/devel:kubic:libcontainers:stable.repo
sudo curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable:cri-o:${VERSION}.repo https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable:cri-o:${VERSION}/CentOS_8/devel:kubic:libcontainers:stable:cri-o:${VERSION}.repo
sudo dnf -y install cri-o cri-tools
sudo systemctl enable --now crio
sudo systemctl status crio
</pre>
<p>Then, we have to install Kubernetes.<br />
<strong>Do this on all nodes.</strong></p>
<pre class="brush: bash; title: ; notranslate">
cat &lt;&lt;EOF | sudo tee /etc/yum.repos.d/kubernetes.repo
&#x5B;kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-\$basearch
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
exclude=kubelet kubeadm kubectl
EOF
sudo dnf install -y kubelet kubeadm kubectl --disableexcludes=kubernetes
sudo systemctl enable --now kubelet
</pre>
<p><strong>On the master node only</strong>, initialize the cluster. Replace <strong>master.homelab.com</strong> with your master IP if you don&#8217;t use DNS.</p>
<pre class="brush: bash; title: ; notranslate">
sudo kubeadm init --control-plane-endpoint master.homelab.local:6443
</pre>
<p>You&#8217;ll get an output that says how to join the nodes, something like kubeadm join master&#8230; + a token<br />
<strong>On the master node</strong>, add these lines.</p>
<pre class="brush: bash; title: ; notranslate">
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
</pre>
<p>Join the nodes to the cluster.<br />
<strong>Do this on workers only.</strong></p>
<pre class="brush: bash; title: ; notranslate">
sudo kubeadm join master.homelab.local:6443 --token t2yir0.7n49rn6r57msy4j4 \
        --discovery-token-ca-cert-hash sha256:563360fcf60c49be91cdcf6486a4954c579a80c54503127ee0682ab8f86ec840
</pre>
<p>Check the nodes.<br />
<strong>Do this on the master node.</strong></p>
<pre class="brush: bash; highlight: [1]; title: ; notranslate">
kubectl get nodes
NAME                   STATUS   ROLES           AGE    VERSION
master.homelab.local   Ready    control-plane   116s   v1.28.2
node1.homelab.local    Ready    &lt;none&gt;          89s    v1.28.2
node2.homelab.local    Ready    &lt;none&gt;          85s    v1.28.2
</pre>
<p>&#8230;then check all the pods.<br />
<strong>Do this on the master node.</strong></p>
<pre class="brush: bash; highlight: [1]; title: ; notranslate">
kubectl get pods --all-namespaces
NAMESPACE     NAME                                           READY   STATUS    RESTARTS   AGE
kube-system   coredns-5dd5756b68-5ljgg                       1/1     Running   0          2m
kube-system   coredns-5dd5756b68-jp8tq                       1/1     Running   0          2m
kube-system   etcd-master.homelab.local                      1/1     Running   0          2m6s
kube-system   kube-apiserver-master.homelab.local            1/1     Running   0          2m6s
kube-system   kube-controller-manager-master.homelab.local   1/1     Running   0          2m6s
kube-system   kube-proxy-2z64r                               1/1     Running   0          2m
kube-system   kube-proxy-mrwjv                               1/1     Running   0          96s
kube-system   kube-proxy-nj5q4                               1/1     Running   0          100s
kube-system   kube-scheduler-master.homelab.local            1/1     Running   0          2m6s
</pre>
<p>Install Cilium<strong> on the master node only.</strong></p>
<pre class="brush: bash; title: ; notranslate">
CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/main/stable.txt)
CLI_ARCH=amd64
if &#x5B; &quot;$(uname -m)&quot; = &quot;aarch64&quot; ]; then CLI_ARCH=arm64; fi
curl -L --fail --remote-name-all https://github.com/cilium/cilium-cli/releases/download/${CILIUM_CLI_VERSION}/cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum}
sha256sum --check cilium-linux-${CLI_ARCH}.tar.gz.sha256sum
sudo tar xzvfC cilium-linux-${CLI_ARCH}.tar.gz /usr/local/bin
rm cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum}
cilium install --version 1.14.2
</pre>
<p>Check the status.</p>
<pre class="brush: bash; title: ; notranslate">
cilium status --wait
</pre>
<p>You should see something like this. </p>
<pre class="brush: bash; title: ; notranslate">
    /¯¯\
 /¯¯\__/¯¯\    Cilium:             OK
 \__/¯¯\__/    Operator:           OK
 /¯¯\__/¯¯\    Envoy DaemonSet:    disabled (using embedded mode)
 \__/¯¯\__/    Hubble Relay:       disabled
    \__/       ClusterMesh:        disabled

DaemonSet              cilium             Desired: 3, Ready: 3/3, Available: 3/3
Deployment             cilium-operator    Desired: 1, Ready: 1/1, Available: 1/1
Containers:            cilium             Running: 3
                       cilium-operator    Running: 1
Cluster Pods:          2/2 managed by Cilium
Helm chart version:    1.14.2
Image versions         cilium             quay.io/cilium/cilium:v1.14.2@sha256:6263f3a3d5d63b267b538298dbeb5ae87da3efacf09a2c620446c873ba807d35: 3
                       cilium-operator    quay.io/cilium/operator-generic:v1.14.2@sha256:52f70250dea22e506959439a7c4ea31b10fe8375db62f5c27ab746e3a2af866d: 1
</pre>
<p>Then you can run the connectivity test. Some of the egress test will fail because we don&#8217;t have a public IP on the cluster.</p>
<pre class="brush: bash; title: ; notranslate">
cilium connectivity test
</pre>
<p>You should be able to run your deployments now. If you need to access the pods using URL use something like NodePort or port-forwarding. It&#8217;s very cumbersome and inefficient, but you can use a load balancer with MetalLB. Read <a href="https://blog.andreev.it/2023/10/install-metallb-on-kubernetes-cluster-running-on-vmware-vms-or-bare-metal-server/" rel="noopener" target="_blank">this</a> post to see how to do that. It&#8217;s separated from this post, because it&#8217;s a separate topic than just k8s, container runtime and CNI.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.andreev.it/2023/10/install-kubernetes-with-cri-o-and-cilium-on-rocky-linux-9/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Rocky Linux: Install the pre-release on VMware and WordPress</title>
		<link>https://blog.andreev.it/2021/05/rocky-linux-install-the-pre-release-on-vmware-and-wordpress/</link>
					<comments>https://blog.andreev.it/2021/05/rocky-linux-install-the-pre-release-on-vmware-and-wordpress/#respond</comments>
		
		<dc:creator><![CDATA[Kliment Andreev]]></dc:creator>
		<pubDate>Sat, 01 May 2021 17:05:50 +0000</pubDate>
				<category><![CDATA[ESX/ESXi]]></category>
		<category><![CDATA[Rocky Linux]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[rocky linux]]></category>
		<guid isPermaLink="false">https://blog.andreev.it/?p=8861</guid>

					<description><![CDATA[Rocky Linux was finally release today (5/1/2021) and I&#8217;ve decided to try it in&#8230;]]></description>
										<content:encoded><![CDATA[<div id="bsf_rt_marker"></div><p>Rocky Linux was finally release today (5/1/2021) and I&#8217;ve decided to try it in my lab. I&#8217;ve downloaded the minimal ISO (Rocky-8.3-x86_64-minimal) and installed it under my vCenter version 6.x.<br />
I chose CentOS 8 as a base OS and after I mounted the ISO, I got an error saying <strong>ERROR Verification failed: (0x1A) Security Violation</strong>. If this is the case, shut down the guest, go to <strong>Settings | VM Options</strong> and if you expand <strong>Boot Options</strong>, change the <strong>Firmware</strong> from <strong>EFI </strong>to <strong>BIOS</strong>. This should do the trick.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2021/05/P154-01.png"><img fetchpriority="high" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2021/05/P154-01.png" alt="" width="865" height="472" class="aligncenter size-full wp-image-8864" srcset="https://blog.andreev.it/wp-content/uploads/2021/05/P154-01.png 865w, https://blog.andreev.it/wp-content/uploads/2021/05/P154-01-300x164.png 300w, https://blog.andreev.it/wp-content/uploads/2021/05/P154-01-768x419.png 768w, https://blog.andreev.it/wp-content/uploads/2021/05/P154-01-585x319.png 585w" sizes="(max-width: 865px) 100vw, 865px" /></a><br />
What you&#8217;ll see next is pretty much the same as any other CentOS 7/8 installation.</p>
<p><a href="https://blog.andreev.it/wp-content/uploads/2021/05/P154-02.png"><img decoding="async" src="https://blog.andreev.it/wp-content/uploads/2021/05/P154-02.png" alt="" width="792" height="592" class="aligncenter size-full wp-image-8866" srcset="https://blog.andreev.it/wp-content/uploads/2021/05/P154-02.png 792w, https://blog.andreev.it/wp-content/uploads/2021/05/P154-02-300x224.png 300w, https://blog.andreev.it/wp-content/uploads/2021/05/P154-02-768x574.png 768w, https://blog.andreev.it/wp-content/uploads/2021/05/P154-02-585x437.png 585w" sizes="(max-width: 792px) 100vw, 792px" /></a><br />
<strong>NOTE: The current version is not considered for production.</strong><br />
Do the same as you do with any other CentOS install. Partition the hard drive, change the root password, configure the network and add a user.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2021/05/P154-03.png"><img decoding="async" src="https://blog.andreev.it/wp-content/uploads/2021/05/P154-03.png" alt="" width="786" height="590" class="aligncenter size-full wp-image-8867" srcset="https://blog.andreev.it/wp-content/uploads/2021/05/P154-03.png 786w, https://blog.andreev.it/wp-content/uploads/2021/05/P154-03-300x225.png 300w, https://blog.andreev.it/wp-content/uploads/2021/05/P154-03-768x576.png 768w, https://blog.andreev.it/wp-content/uploads/2021/05/P154-03-585x439.png 585w" sizes="(max-width: 786px) 100vw, 786px" /></a><br />
Once the server is up, you&#8217;ll see the login prompt.<br />
<a href="https://blog.andreev.it/wp-content/uploads/2021/05/P154-04.png"><img loading="lazy" decoding="async" src="https://blog.andreev.it/wp-content/uploads/2021/05/P154-04.png" alt="" width="673" height="451" class="aligncenter size-full wp-image-8868" srcset="https://blog.andreev.it/wp-content/uploads/2021/05/P154-04.png 673w, https://blog.andreev.it/wp-content/uploads/2021/05/P154-04-300x201.png 300w, https://blog.andreev.it/wp-content/uploads/2021/05/P154-04-585x392.png 585w, https://blog.andreev.it/wp-content/uploads/2021/05/P154-04-263x175.png 263w" sizes="(max-width: 673px) 100vw, 673px" /></a><br />
Check the kernel version and the release.</p>
<pre class="brush: bash; highlight: [1,3]; title: ; notranslate">
uname -a
Linux rocky.andreev.local 4.18.0-240.22.1.el8.x86_64 #1 SMP Mon Apr 12 04:29:16 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
cat /etc/redhat-release
Rocky Linux release 8.3
</pre>
<p>By default, both the firewall and SELinux are enabled. </p>
<pre class="brush: bash; title: ; notranslate">
systemctl status firewalld
sestatus
</pre>
<p>You can use <strong>dnf</strong>, <strong>yum </strong>or <strong>rpm </strong>to manage the packages. If you need to change the network settings, use <strong>nmtui</strong>.<br />
Let&#8217;s install WordPress now. As root or using sudo, install Apache, PHP and MariaDB.</p>
<pre class="brush: bash; title: ; notranslate">
dnf install httpd php php-mysqlnd mariadb-server wget php-json
</pre>
<p>Start the Apache and MariaDB and enable them on both to start on reboot.</p>
<pre class="brush: bash; title: ; notranslate">
systemctl enable httpd --now
systemctl enable mariadb --now
</pre>
<p>Open port 80 on the firewall for the Apache. </p>
<pre class="brush: bash; title: ; notranslate">
firewall-cmd --permanent --zone=public --add-service=http --permanent
firewall-cmd --reload
</pre>
<p>Do the initian MariaDB configuration and specify the new root password for the SQL server.</p>
<pre class="brush: bash; title: ; notranslate">
mysql_secure_installation
</pre>
<p>Log as the SQL root user to MariaDB.</p>
<pre class="brush: bash; title: ; notranslate">
mysql -u root -p
</pre>
<p>Create the database and the WordPress user.</p>
<pre class="brush: sql; title: ; notranslate">
CREATE DATABASE wordpress;
GRANT ALL ON wordpress.* TO 'wpadmin'@'localhost' IDENTIFIED BY 'supersecret';
FLUSH PRIVILEGES;
</pre>
<p>Get the latest WordPress release under /tmp, unzip it and copy it where it belongs (root Apache data directory).</p>
<pre class="brush: bash; title: ; notranslate">
cd /tmp
wget https://www.wordpress.org/latest.zip
unzip latest.zip
mv wordpress/* /var/www/html/
chown -R apache:apache /var/www/html
</pre>
<p>Change the SELinux context for the root Apache data directory. </p>
<pre class="brush: bash; title: ; notranslate">
chcon -t httpd_sys_rw_content_t /var/www/html -R
</pre>
<p>At this point, you can access your WordPress install at http://your_IP_or_hostname.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.andreev.it/2021/05/rocky-linux-install-the-pre-release-on-vmware-and-wordpress/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
