User Tools

Site Tools


kubernetes

Kubernetes

Commands

    • Start local Kubernetes: minikube start
    • Start old version (1.15.0 for example): minikube start -p aged --kubernetes-version=v1.15.0
    • list services: minikube service list
    • get Kubernetes URL for a service: minikube service <resource_name>
    • start the dashboard: minikube dashboard
    • get minikube version: minikube version
    • get info about the cluster: kubectl cluster-info
    • Get version of k8s: kubectl version
    • display all pods across all namespaces: kubectl get pods -A
    • display state of resource: kubectl describe service <resource_name>
    • display infos of resource: kubectl get services <resource_name>
    • delete deployment: kubectl delete deployment <deployment_name>
    • namespace commands
      • List namespaces: kubectl get namespace
      • Create namespace: kubectl create namespace <namespace_name>

Installation

First starts looks like this:

$ minikube start
πŸ˜„  minikube v1.13.0 on Ubuntu 18.04
✨  Automatically selected the kvm2 driver
πŸ’Ύ  Downloading driver docker-machine-driver-kvm2:
    > docker-machine-driver-kvm2.sha256: 65 B / 65 B [-------] 100.00% ? p/s 0s
    > docker-machine-driver-kvm2: 13.81 MiB / 13.81 MiB  100.00% 1.13 MiB p/s 1
πŸ’Ώ  Downloading VM boot image ...
    > minikube-v1.13.0.iso.sha256: 65 B / 65 B [-------------] 100.00% ? p/s 0s
    > minikube-v1.13.0.iso: 173.73 MiB / 173.73 MiB  100.00% 1.61 MiB p/s 1m48s
πŸ‘  Starting control plane node minikube in cluster minikube
πŸ’Ύ  Downloading Kubernetes v1.19.0 preload ...
    > preloaded-images-k8s-v6-v1.19.0-docker-overlay2-amd64.tar.lz4: 486.28 MiB
πŸ”₯  Creating kvm2 VM (CPUs=2, Memory=2200MB, Disk=20000MB) ...
🐳  Preparing Kubernetes v1.19.0 on Docker 19.03.12 ...
πŸ”Ž  Verifying Kubernetes components...
🌟  Enabled addons: default-storageclass, storage-provisioner
πŸ’‘  kubectl not found. If you need it, try: 'minikube kubectl -- get pods -A'
πŸ„  Done! kubectl is now configured to use "minikube" by default

Helm

The package manager for Kubernetes

If install fails with Error: cannot re-use a name that is still in use the –replace flag can be used.

Post Setup Examples

After setup:

$ kubectl get pods -A
NAMESPACE              NAME                                        READY   STATUS    RESTARTS   AGE
kube-system            coredns-f9fd979d6-r2vhj                     1/1     Running   2          3h49m
kube-system            etcd-minikube                               1/1     Running   2          3h49m
kube-system            kube-apiserver-minikube                     1/1     Running   2          3h49m
kube-system            kube-controller-manager-minikube            1/1     Running   2          3h49m
kube-system            kube-proxy-tnk8g                            1/1     Running   2          3h49m
kube-system            kube-scheduler-minikube                     1/1     Running   2          3h49m
kube-system            storage-provisioner                         1/1     Running   5          3h49m
kubernetes-dashboard   dashboard-metrics-scraper-c95fcf479-b92v2   1/1     Running   2          3h45m
kubernetes-dashboard   kubernetes-dashboard-5c448bc4bf-tttfg       1/1     Running   2          3h45m
kubernetes.txt Β· Last modified: 2020/09/16 11:22 by pmay