starting minikube to use KVM




[root@localhost ~]# minikube start --vm-driver=kvm
Starting local Kubernetes v1.6.4 cluster...
Starting VM...
Moving files into cluster...
Setting up certs...
Starting cluster components...
Connecting to cluster...
Setting up kubeconfig...
Kubectl is now configured to use the cluster.
You have new mail in /var/spool/mail/root
[root@localhost ~]# 

[root@localhost ~]# minikube start --vm-driver=kvm
Starting local Kubernetes v1.6.4 cluster...
Starting VM...
Moving files into cluster...
Setting up certs...
Starting cluster components...
Connecting to cluster...
Setting up kubeconfig...
Kubectl is now configured to use the cluster.
You have new mail in /var/spool/mail/root
[root@localhost ~]# 


[root@localhost ~]# kubectl run hello-minikube --image=gcr.io/google_^Cntainers/echoserver:1.4 --port=8080
[root@localhost ~]# docker images
REPOSITORY                    TAG                 IMAGE ID            CREATED             SIZE
registry                      2                   c2a449c9f834        10 days ago         33.2MB
ubuntu                        latest              d355ed3537e9        2 weeks ago         119MB
localhost:5000/myfirstimage   latest              d355ed3537e9        2 weeks ago         119MB
dockercloud/client            latest              a073d03b69b4        4 weeks ago         15.4MB
[root@localhost ~]# docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES
0c57d7f80eb6        registry:2          "/entrypoint.sh /e..."   About an hour ago   Up About an hour    0.0.0.0:5000->5000/tcp   registry
[root@localhost ~]# kubectl run hello-minikube --image=docker.io/ubuntu --port=8080
deployment "hello-minikube" created
[root@localhost ~]# kubectl get pods
NAME                             READY     STATUS              RESTARTS   AGE
hello-minikube-163058685-8xj26   0/1       ContainerCreating   0          14s
[root@localhost ~]# kubectl get pods
NAME                             READY     STATUS              RESTARTS   AGE
hello-minikube-163058685-8xj26   0/1       ContainerCreating   0          23s
[root@localhost ~]# kubectl get pods
NAME                             READY     STATUS      RESTARTS   AGE
hello-minikube-163058685-8xj26   0/1       Completed   1          25s
[root@localhost ~]# kubectl get pods
NAME                             READY     STATUS             RESTARTS   AGE
hello-minikube-163058685-8xj26   0/1       CrashLoopBackOff   1          27s
[root@localhost ~]# 


[root@localhost ~]# kubectl get all
NAME                                  READY     STATUS             RESTARTS   AGE
po/hello-minikube-163058685-8xj26     0/1       CrashLoopBackOff   14         49m
po/hello-minikube2-1263410966-9qj51   1/1       Running            0          38m

NAME                  CLUSTER-IP   EXTERNAL-IP   PORT(S)          AGE
svc/hello-minikube    10.0.0.103         8080:30904/TCP   39m
svc/hello-minikube2   10.0.0.19           8080:30451/TCP   37m
svc/kubernetes        10.0.0.1            443/TCP          1h

NAME                     DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
deploy/hello-minikube    1         1         1            0           49m
deploy/hello-minikube2   1         1         1            1           38m

NAME                            DESIRED   CURRENT   READY     AGE
rs/hello-minikube-163058685     1         1         0         49m
rs/hello-minikube2-1263410966   1         1         1         38m
[root@localhost ~]# 


[root@localhost ~]# kubectl get pods
NAME                               READY     STATUS             RESTARTS   AGE
hello-minikube-163058685-8xj26     0/1       CrashLoopBackOff   15         57m
hello-minikube2-1263410966-9qj51   1/1       Running            0          46m
[root@localhost ~]# kubectl logs hello-minikube-163058685-8xj26
[root@localhost ~]# kubectl logs hello-minikube2-1263410966-9qj51
172.17.0.1 - - [09/Jul/2017:02:55:25 +0000] "GET / HTTP/1.1" 200 396 "-" "curl/7.29.0"
[root@localhost ~]# kubectl exec  hello-minikube2-1263410966-9qj51 env
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=hello-minikube2-1263410966-9qj51
KUBERNETES_PORT_443_TCP=tcp://10.0.0.1:443
KUBERNETES_PORT_443_TCP_PROTO=tcp
HELLO_MINIKUBE_SERVICE_HOST=10.0.0.103
HELLO_MINIKUBE_SERVICE_PORT=8080
KUBERNETES_SERVICE_PORT_HTTPS=443
HELLO_MINIKUBE_PORT_8080_TCP_PORT=8080
HELLO_MINIKUBE_PORT_8080_TCP_ADDR=10.0.0.103
KUBERNETES_SERVICE_PORT=443
HELLO_MINIKUBE_PORT_8080_TCP=tcp://10.0.0.103:8080
HELLO_MINIKUBE_PORT_8080_TCP_PROTO=tcp
KUBERNETES_SERVICE_HOST=10.0.0.1
KUBERNETES_PORT=tcp://10.0.0.1:443
KUBERNETES_PORT_443_TCP_PORT=443
KUBERNETES_PORT_443_TCP_ADDR=10.0.0.1
HELLO_MINIKUBE_PORT=tcp://10.0.0.103:8080
HOME=/root

How to install Minikube and start with Kubernetes on an EC2 instance




https://github.com/kubernetes/minikube
Resources:  https://kubernetes.io/docs/tutorials/kubernetes-basics/cluster-intro/

Note: virtualBox cannot be installed on Ec2.
So i installed it on a physical hardware on linux and enabled started minikube...
But my Linux machine was running KVM already, so there was some conflicts, so I have enable minikube to run with KVM..

ip-172-31-14-214 - this refers to an AWS EC2 instance:

root@ip-172-31-14-214:~# git clone https://github.com/kubernetes/minikube.git
Cloning into 'minikube'...
remote: Counting objects: 41738, done.
remote: Compressing objects: 100% (94/94), done.
remote: Total 41738 (delta 17), reused 30 (delta 3), pack-reused 41637
Receiving objects: 100% (41738/41738), 35.05 MiB | 18.53 MiB/s, done.
Resolving deltas: 100% (23528/23528), done.
Checking connectivity... done.


root@ip-172-31-14-214:~/minikube/pkg/minikube# curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 78.7M  100 78.7M    0     0  49.3M      0  0:00:01  0:00:01 --:--:-- 49.3M
root@ip-172-31-14-214:~/minikube/pkg/minikube# minikube version
minikube version: v0.20.0
root@ip-172-31-14-214:~/minikube/pkg/minikube#


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

root@ip-172-31-14-214:~/minikube/pkg/minikube# minikube start
========================================
kubectl could not be found on your path. kubectl is a requirement for using minikube
To install kubectl, please run the following:

curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.6.4/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/

To disable this message, run the following:

minikube config set WantKubectlDownloadMsg false
========================================
Starting local Kubernetes v1.6.4 cluster...
Starting VM...
Downloading Minikube ISO
 90.95 MB / 90.95 MB [==============================================] 100.00% 0s
E0707 02:01:32.049221    8488 start.go:127] Error starting host: Error creating host: Error executing step: Running precreate checks.
: VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path.

 Retrying.
E0707 02:01:32.049578    8488 start.go:133] Error starting host:  Error creating host: Error executing step: Running precreate checks.
: VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path
================================================================================
An error has occurred. Would you like to opt in to sending anonymized crash
information to minikube to help prevent future errors?
To opt out of these messages, run the command:
        minikube config set WantReportErrorPrompt false
================================================================================
Please enter your response [Y/n]:
y
root@ip-172-31-14-214:~/minikube/pkg/minikube#
root@ip-172-31-14-214:~/minikube/pkg/minikube#
root@ip-172-31-14-214:~/minikube/pkg/minikube#
root@ip-172-31-14-214:~/minikube/pkg/minikube# curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.6.4/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 67.4M  100 67.4M    0     0  53.7M      0  0:00:01  0:00:01 --:--:-- 53.8M
root@ip-172-31-14-214:~/minikube/pkg/minikube#

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


root@ip-172-31-14-214:~/minikube/pkg/minikube# minikube start
Starting local Kubernetes v1.6.4 cluster...
Starting VM...
E0707 02:11:26.003862   18952 start.go:127] Error starting host: Error creating host: Error executing step: Running precreate checks.
: This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory.

 Retrying.
E0707 02:11:26.005007   18952 start.go:133] Error starting host:  Error creating host: Error executing step: Running precreate checks.
: This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory
root@ip-172-31-14-214:~/minikube/pkg/minikube# apt install virtualbox-ext-pack
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  virtualbox-ext-pack
0 upgraded, 1 newly installed, 0 to remove and 17 not upgraded.
Need to get 11.8 kB of archives.
After this operation, 129 kB of additional disk space will be used.
Get:1 http://us-east-2.ec2.archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 virtualbox-ext-pack all 5.0.40-0ubuntu1.16.04.1 [11.8 kB]
Fetched 11.8 kB in 0s (59.5 kB/s)
Preconfiguring packages ...
Selecting previously unselected package virtualbox-ext-pack.
(Reading database ... 82642 files and directories currently installed.)
Preparing to unpack .../virtualbox-ext-pack_5.0.40-0ubuntu1.16.04.1_all.deb ...
License has already been accepted.
Unpacking virtualbox-ext-pack (5.0.40-0ubuntu1.16.04.1) ...
Setting up virtualbox-ext-pack (5.0.40-0ubuntu1.16.04.1) ...
virtualbox-ext-pack: downloading: http://download.virtualbox.org/virtualbox/5.0.40/Oracle_VM_VirtualBox_Extension_Pack-5.0.40.vbox-extpack
The file will be downloaded into /usr/share/virtualbox-ext-pack
License accepted.
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Successfully installed "Oracle VM VirtualBox Extension Pack".
root@ip-172-31-14-214:~/minikube/pkg/minikube#

Please follow the above same steps to create in a local Linux machine, then start the minikube using the syntax given in next "post"

Installing Ingress Controller - Kubernetes

Installing the Ingress Controller Prerequisites Make sure you have access to the Ingress controller image: For NGINX Ingress controll...