Friday, 4 September 2020

Installing Docker and Minikube

 

install docker-

 

sudo apt install docker.io

 

set user to docker group:-

sudo gpasswd -a  {user} docker

 

imp commands:-

docker image ls

docker container ls

docker run -p 80:80 -d richardchesterwood/k8s-fleetman-webapp-angular:release0-5

docker stop <containerId>

docker rm <containerId>

 

running mysql with storage persist scenario:

 

docker run --name sampleDockerDB -p 3306:3306 -e MYSQL_ROOT_PASSWORD=pass -d mysql:5

 

docker exec -it 3e bash

mysql -p{password}  `Comment:#no space after -p`

show databases;

apart from its internal file system, mysql stores data on actual hardware:

 

docker container inspect <containerId>

 

docker volume ls  `to list volumes mounted on actual hardware not docker image`

 

set default local volume to persist data:-

 

docker run --name viksDB -v mydata:/var/lib/mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=pass -d mysql:5

 

 

---------------------

 

- Starting with running minikube locally

 

https://kubernetes.io/docs/tasks/tools/install-minikube/

 

check if virtualization is supported on Linux,run the following command and verify that the output is non-empty:

grep -E --color 'vmx|svm' /proc/cpuinfo

 

 

Minikube also supports a --driver=none option that runs the Kubernetes components on the host and not in a VM. Using this driver requires Docker and a Linux environment but not a hypervisor.

 

Install kubectl

curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.19.0/bin/linux/amd64/kubectl

 

Make the kubectl binary executable.

 

chmod +x ./kubectl

 

Move the binary in to your PATH.

 

sudo mv ./kubectl /usr/local/bin/kubectl

 

Test to ensure the version you installed is up-to-date:

 

kubectl version --client

 

Install Minikube via direct download

 

curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 \

  && chmod +x minikube

sudo mv ./minikube /usr/local/bin/minikube

 

minikube start --vm-driver=none

 

(optional):-

 

minikube addons list

 

minikube addons enable dashboard

 

to get minikube dashboard url:-

 

minikube dashboard --url

 

access url in local machine using ssh tunnel:-

ssh -L 8081:localhost:42441 ubuntu@192.168.0.102

 

optional:

access docker within minikube

minikube docker-env

 

# To point your shell to minikube's docker-daemon, run:

# eval $(minikube -p minikube docker-env)

 

minikube ip

installing proper MINT and saving the vdi in safe location

 Mouse Scroll:-

 

sudo apt-get install imwheel && wget http://www.nicknorton.net/mousewheel.sh && chmod +x mousewheel.sh && ./mousewheel.sh

 

Use the usermod command to add the user to the sudo/root group:

 

adduser <username>

usermod -aG sudo <username>

userdel <username>

 

 

To Enable Snap in Linux Mint 20,

 

    Open terminal as root.

    Type the following command: # rm /etc/apt/preferences.d/nosnap.pref.   This will enable Snap.

    Now, update the package cache for apt with this command: # apt update

    Finally, install the snapd package: # apt install snapd

sudo snap install snap-store

 

Shared Folders:-

In Ubuntu, you need to add your username to the vboxsf group, using the adduser/addgroup command in terminal (sudo adduser <username> vboxsf), then logout and log back in, or reboot.

 

Move “Show Applications” right to left of the Dock:

 

“gsettings set org.gnome.shell.extensions.dash-to-dock show-apps-at-top true”

 

Installing Docker and Minikube

  install docker-   sudo apt install docker.io   set user to docker group:- sudo gpasswd -a   {user} docker   imp commands:- ...