Install K8S User Interface
- Download dashboard k8s yml
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml
- Start proxy, So that UI is accessible from container
kubectl proxy
- Access the login with following URL
http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/login
By default K8S dashboard config doesn't create any dummy (or) default accounts. On side note that default (or) anonymous doesn't have any access to either POD (or) Volumes. Hence for sandbox we may need to create account which have admin access. In production we may need to configure RBAC (or) Kerberos (or) SAML integration for corporate.
Create K8S admin account from following 3 commands
$ kubectl create serviceaccount dashboard -n default
$ kubectl create clusterrolebinding dashboard-admin -n default --clusterrole=cluster-admin --serviceaccount=default:dashboard
kubectl apply -f dashboard-adminuser.yml
kubectl apply -f admin-role-binding.yml
- Retrieve the admin token and use while login in K8S console
$ kubectl get secret $(kubectl get serviceaccount dashboard -o jsonpath="{.secrets[0].name}") -o jsonpath="{.data.token}" | base64 --decode
Following screenshot shows K8S in local after admin login
Publishing local images to docker hub
- Login using
docker login
- Push to docker hub
docker push ganeshgowtham/gowthg:latest
Following shows CLI verbose while pushing and docker hub
Spring Boot application
Sample SpringBoot app with Docker setup