Dropping Kali in your test space
k8s testing with kali linux
Setting up docker
Add User to Docker Group
After installing Docker, add your user to the Docker group to run Docker commands without sudo.
Add User to Docker Group:
sudo usermod -aG docker $USERRefresh Group Membership:
newgrp dockerVerify Group Membership:
groups $USER
docker ps
This command lists running containers. We have nothing running as it's a new environment
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTSdocker run hello-world
The docker run hello-world command is a simple way to verify that Docker is installed and functioning correctly on your system.
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(arm64v8)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/get-started/start minikube
Download minikube for your architechture
Minikube is an open-source tool that enables you to run a single-node Kubernetes cluster locally on your machine. Minikube runs a Kubernetes cluster in a virtual machine (VM) on your computer, which allows developers to create and manage Kubernetes environments without needing a full-blown, multi-node cluster.
get nodes
describe node
Lets create a deployment file and service file for nginx
nginx-deployment.yaml
nginx-service.yaml
Apply the configurations...
Verify the deployment and service...
Getting deployments and services
Now lets get pods
Creating a kali dockerfile and pushing to docker hub
Here's what we're going to do to get kali pushed to our repo and then deployed
Create the kali dockerfile
Build the docker image
Push that image to Docker Hub
Deploy image to K8s
Apply the deployment to K8s
Create the docker file
Build the docker image
make sure to substitute your docker hub username and image name
docker build -t <your-docker-username>/<your-image-name> .
Now lets push this to our docker hub repo (this could take a while)
Once the push is finished lets create a deployment yaml for our image
Deploy the image to k8s
Last updated