Howto connect to K8S dashboard in your local Docker Engine
Docker -> Settings -> Kubernetes -> Enable Kubernetes [Apply]
Open a command prompt and enter kubectl describe secret
Copy token
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.4.0/aio/deploy/recommended.yaml
kubectl proxy
`Goto Kubernetes Dashboard Login
Choose Token in Kubernetes dashboard and paste in token
Kubernetes log, User "system:serviceaccount:default:default" cannot get services in the namespace
DO NOT USE THIS IN PRODUCTION SETTINGS
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: rbac
subjects:
- kind: ServiceAccount
# Reference to upper's `metadata.name`
name: default
# Reference to upper's `metadata.namespace`
namespace: default
roleRef:
kind: ClusterRole
name: cluster-admin
apiGroup: rbac.authorization.k8s.io
kubectl apply -f rbac.yaml
kubectl delete -f rbac.yaml
View raw content of K8S config file
Command
Action
kubectl config view --raw
view raw content of K8S config file
Command
Action
kubectl config get-contexts
Get available contexts
kubectl config use-context <cluster-name>
set context to specified cluster
kubectl config delete-context <cluster-name>
set context to specified cluster
Command
Action
kubectl get nodes
get nodes
Command
Action
kubectl get pods
get pods
kubectl get pods --all-namespaces
get all pods in all namespaces
kubectl get pods --namespace=ingress-nginx
get all pods in the ingress-nginx namespace
Command
Action
kubectl apply -f deployment.yaml
deploy to kubernetes cluster
kubectl get deployments
get deployments of a kubernetes cluster
kubectl delete deployment <deployment-name>
delete a deployment by name
kubectl rollout restart deployment <deployment-name>
restart a deployment
Command
Action
kubectl get services
get services in a kubernetes cluster
kubectl delete svc <service-name>
delete a service by name
kubectl get pods
get pods
StorageClass and Persistent claim volumes
Command
Action
kubectl get pvc
get persisten claim volumes in a kubernetes cluster
kubectl get storageclass
get storage classes in a kubernetes cluster
Command
Action
kubectl get namespace
get namespaces kubernetes cluster
Command
Action
kubectl create secret generic mssql --from-literal=SA_PASSWORD="pa55w0rd!"
create a secret