Getting Started with KubeArmor: Installation and Setup Guide using a simple bash script


KubeArmor is a cloud-native runtime security enforcement system designed to enhance the security of your Kubernetes workloads. This guide will walk you through the installation process using a simple Bash script. We’ll cover how to clone the repository, run the script, and explain essential commands used during the setup.
Prerequisites
Before you begin, ensure you have the following tools installed on your system:
Helm: A package manager for Kubernetes to define, install, and upgrade applications.
kubectl: A command-line tool to interact with your Kubernetes cluster.
curl: A tool for transferring data with URLs.
Cloning the Repository To get started, you need to clone the repository where the installation script is hosted.
Clone the Repository
Open your terminal and run the following command to clone the repository:
git clone
https://github.com/RehanFazal77/KUBEARMOR-rehanfazal.git
Change to the directory containing the cloned repository:
cd KUBEARMOR-rehanfazal/install
Installation Script
The repository includes a Bash script named install_
kubearmor.sh
, which automates the installation of KubeArmor.
Adds the KubeArmor Helm repository.
Updates the Helm repository.
Installs or upgrades the KubeArmor operator using Helm.
Applies a sample KubeArmor configuration using kubectl.
Installs the KubeArmor CLI using curl.
Running the Script
Make the Script Executable
Use the
chmod +x
command to make the script executable. This command changes the file's permissions to allow it to be run as a program.chmod +x install_
kubearmor.sh
Execute the Script
Run the script to install KubeArmor:
./install_
kubearmor.sh
Understanding the chmod +x
Command
The chmod
command in Unix-like operating systems modifies file permissions. The +x
option adds execute permissions, making the file runnable. In this context:
chmod
: Command to change file permissions.+x
: Adds execute permissions.install_
kubearmor.sh
: The file being modified.
By making the script executable, you can run it directly from the command line.
Now to verify the installation: run the given command
First, Kubearmor creates a namespace named as kubearmor
run: kubectl get ns
it will show this
After that it install the require pods into the kubearmor namespace
then run: kubectl get pods --namespace kubearmor
it will show this
Conclusion
This guide has shown you how to clone the KubeArmor installation script from the GitHub repository, make it executable, and run it to install KubeArmor and then verify that kubearmor has installed correctly. If you have any issues or need further assistance, refer to the KubeArmor documentation or reach out to the community for support.
Subscribe to my newsletter
Read articles from Rehan Fazal directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
