Install Dashboard on Cluster
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.4.0/aio/deploy/recommended.yaml
Verify the deployment
kubectl -n kubernetes-dashboard get pods
Proxy Cluster
kubectl proxy
Access Dashboard in browser via http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/#/login
Create a file oke-admin-service-account.yaml to create a Service Account with the following contents:
apiVersion: v1
kind: ServiceAccount
metadata:
name: oke-admin
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: oke-admin
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: oke-admin
namespace: kube-system
Apply the yaml file just created to have the ClusterRoleBinding and ServiceAccount resources created kubectl apply -f oke-admin-service-account.yaml
Using the now newly service account, retrieve the token kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep oke-admin | awk '{print $1}')
Create a yaml file with the definition of a deployment and a service (of type LoadBalancer)
apiVersion: apps/v1
kind: Deployment
metadata:
name: docker-hello-world
labels:
app: docker-hello-world
spec:
selector:
matchLabels:
app: docker-hello-world
replicas: 3
template:
metadata:
labels:
app: docker-hello-world
spec:
containers:
- name: docker-hello-world
image: scottsbaldwin/docker-hello-world:latest
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: docker-hello-world-svc
spec:
selector:
app: docker-hello-world
ports:
- port: 8088
targetPort: 80
type: LoadBalancer
Apply this file to create the application resources
kubectl create -f hello-world-app.yaml