Installing Microk8s on CentOs7

Installing Microk8s on CentOs7

Microk8s is a high availability, low-ops, production-ready kubernetes for developers, cloud, clusters, workstations, Edge, and IoT.

Minikube likewise lets you set up a single-node Kubernetes cluster locally,?but with one major difference: it's VM-based, which means it'll operate best in a virtual machine,?mostly on Mac and Windows, but also on Linux. MicroK8s, on the other hand, were created with?Linux in mind and do not require a virtual machine.

Instead, it's straightforward to install?as a snap package with only one command. Because MicroK8s does not require a virtual machine,?there are more resources available on the provided system to run applications, making it ideal for?edge deployments. It's even possible to use it to set up Kubernetes on a Raspberry Pi!

Follow below steps to install microk8s on CentOs7 :

[root@node1 ~]# hostname

node1.example.com

[root@node1 ~]# cat /etc/os-release

NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
[root@node1 ~]#
        

Install epel yum repos

[root@node1 ~]# yum install epel-release        

Install snapd

[root@node1 ~]# yum install snapd        

Enable main snap communication socket

[root@node1 ~]# systemctl enable --now snapd.socket        

Create a symbolic link to enable classic snap support

[root@node1 ~]# ln -s /var/lib/snapd/snap /snap        

To verify snap's paths are changed correctly, log out and back in again, or restart?your machine.

[root@node1 ~]# snap install microk8s --classic

2021-09-29T12:46:21-04:00 INFO Waiting for automatic snapd restart..
microk8s (1.21/stable) v1.21.5 from Canonical? installed.
[root@node1 ~]#

        

Check microk8s status

[root@node1 ~]# microk8s status
microk8s is running
high-availability: no
? datastore master nodes: 127.0.0.1:19001
? datastore standby nodes: none
addons:
? enabled:
? ? ha-cluster? ? ? ? ? ?# Configure high availability on the current node
? disabled:
? ? ambassador? ? ? ? ? ?# Ambassador API Gateway and Ingress
? ? cilium? ? ? ? ? ? ? ?# SDN, fast with full network policy
? ? dashboard? ? ? ? ? ? # The Kubernetes dashboard
? ? dns? ? ? ? ? ? ? ? ? # CoreDNS
? ? fluentd? ? ? ? ? ? ? # Elasticsearch-Fluentd-Kibana logging and monitoring
? ? gpu? ? ? ? ? ? ? ? ? # Automatic enablement of Nvidia CUDA
? ? helm? ? ? ? ? ? ? ? ?# Helm 2 - the package manager for Kubernetes
? ? helm3? ? ? ? ? ? ? ? # Helm 3 - Kubernetes package manager
? ? host-access? ? ? ? ? # Allow Pods connecting to Host services smoothly
? ? ingress? ? ? ? ? ? ? # Ingress controller for external access
? ? istio? ? ? ? ? ? ? ? # Core Istio service mesh services
? ? jaeger? ? ? ? ? ? ? ?# Kubernetes Jaeger operator with its simple config
? ? keda? ? ? ? ? ? ? ? ?# Kubernetes-based Event Driven Autoscaling
? ? knative? ? ? ? ? ? ? # The Knative framework on Kubernetes.
? ? kubeflow? ? ? ? ? ? ?# Kubeflow for easy ML deployments
? ? linkerd? ? ? ? ? ? ? # Linkerd is a service mesh for Kubernetes and other frameworks
? ? metallb? ? ? ? ? ? ? # Loadbalancer for your Kubernetes cluster
? ? metrics-server? ? ? ?# K8s Metrics Server for API access to service metrics
? ? multus? ? ? ? ? ? ? ?# Multus CNI enables attaching multiple network interfaces to pods
? ? openebs? ? ? ? ? ? ? # OpenEBS is the open-source storage solution for Kubernetes
? ? openfaas? ? ? ? ? ? ?# openfaas serverless framework
? ? portainer? ? ? ? ? ? # Portainer UI for your Kubernetes cluster
? ? prometheus? ? ? ? ? ?# Prometheus operator for monitoring and logging
? ? rbac? ? ? ? ? ? ? ? ?# Role-Based Access Control for authorisation
? ? registry? ? ? ? ? ? ?# Private image registry exposed on localhost:32000
? ? storage? ? ? ? ? ? ? # Storage class; allocates storage from host directory
? ? traefik? ? ? ? ? ? ? # traefik Ingress controller for external access
[root@node1 ~]#

        
No alt text provided for this image

That's it. I hope you found this to be useful in some way. I'll be back with some more interesting new Kubernetes articles soon.

Asghar Ali Khan

Senior Consultant Cyber Security and Monitoring at European Investment Bank Luxembourg

1 年

It didnt work with me, throwing error , took long time without show status so i have to stop it. microk8s status --wait-ready ^CTraceback (most recent call last): ?File "/snap/microk8s/5016/scripts/wrappers/status.py", line 200, in <module> ??isReady = wait_for_ready(timeout) ?File "/var/lib/snapd/snap/microk8s/5016/scripts/wrappers/common/utils.py", line 166, in wait_for_ready ??time.sleep(2) sudo journalctl -u snap.microk8s.daemon-etcd -- Logs begin at Thu 2023-04-06 16:43:37 CEST, end at Thu 2023-04-06 17:10:18 CEST. -- Apr 06 16:51:14 sc4snmp.securelab.com systemd[1]: Started Service for snap application microk8s.daemon-etcd. any help?

回复
anusha madhavarapu

Senior SRE DevOps Engineer at Verizon | AWS | Kubernetes | Docker | CICD | Sonarqube | Qtest | New Relic | ELK | Grafana | Ansible | Python

2 年

snap install microk8s --classic is failing as I dont have sudo access. I am executing the snap command as root.. How to bipass this error "sudo LD_LIBRARY_PATH=/snap/microk8s/3021/lib:/snap/microk8s/3021/usr/lib:/snap/microk8s/3021/lib/x86_64-linux-gnu:/snap/microk8s/3021/usr/lib/x86_64-linux-gnu touch /var/snap/microk8s/3021/var/lock/no-etcd /snap/microk8s/3021/actions/common/utils.sh: line 81: sudo: command not found"

回复
Prayag Sangode

Senior Technical Architect at T-Systems - Google Cloud DevOps

3 年

How about installing in a new Linux VM?

回复
F. Daniel Montero Harlow

Energy services architect at Minsait

3 年

Hi. Have you been able to enable helm3 addon? I got some certificate problem when getting helm using curl. Thank you.

回复

要查看或添加评论,请登录

Prayag Sangode的更多文章

社区洞察

其他会员也浏览了