Minikube Operations: Difference between revisions
(→Addons) |
|||
Line 53: | Line 53: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==Start with Admission Controller Enabled== | ===Start with Admission Controller Enabled=== | ||
See [[#Enable_Pod_Security_Policies|Enable Pod Security Policies]] below for an example how to start with a PodSecurityPolicy admission controller. | See [[#Enable_Pod_Security_Policies|Enable Pod Security Policies]] below for an example how to start with a PodSecurityPolicy admission controller. | ||
Revision as of 00:28, 2 October 2020
External
Internal
Overview
Administration is done with minikube
.
Addons
minikube instance must be running for "addons" to work.
minikube addons list
minikube addons enable <addon-name>
Start
minikube start
minikube v1.12.3 on Darwin 10.14.6
✨ Automatically selected the docker driver
👍 Starting control plane node minikube in cluster minikube
🚜 Pulling base image ...
💾 Downloading Kubernetes v1.18.3 preload ...
> preloaded-images-k8s-v5-v1.18.3-docker-overlay2-amd64.tar.lz4: 510.91 MiB
🔥 Creating docker container (CPUs=2, Memory=8100MB) ...
🐳 Preparing Kubernetes v1.18.3 on Docker 19.03.8 ...
🔎 Verifying Kubernetes components...
🌟 Enabled addons: default-storageclass, storage-provisioner
🏄 Done! kubectl is now configured to use "minikube"
❗ /usr/local/bin/kubectl is version 1.16.6-beta.0, which may be incompatible with Kubernetes 1.18.3.
💡 You can also use 'minikube kubectl -- get pods' to invoke a matching version
Kubernetes Configuration at Startup
minikube start --extra-config=.... --extra-config=...
minikube start --extra-config=apiserver.enable-admission-plugins=PodSecurityPolicy
Start with Admission Controller Enabled
See Enable Pod Security Policies below for an example how to start with a PodSecurityPolicy admission controller.
Status
minikube status
minikube
type: Control Plane
host: Running
kubelet: Running
apiserver: Running
kubeconfig: Configured
Stop
minikube stop
✋ Stopping node "minikube" ...
🛑 Powering off "minikube" via SSH ...
🛑 1 nodes stopped.
Dashboard
minikube dashboard
Version
minikube version
Delete
Deletes a local Kubernetes cluster. This command deletes the VM, and removes all associated files.
minikube delete --all --purge
--all deletes all profiles.
--purge deletes delete the '.minikube' folder from the user directory.
Enable Pod Security Policies
minikube stop
minikube start --extra-config=apiserver.enable-admission-plugins=PodSecurityPolicy --addons=pod-security-policy
CRI-O
Troubleshooting
minikube logs
minikube start --alsologtostderr --v=2
Obtaining details about kube-apiserver startup arguments:
kubectl -n kube-system describe pod kube-apiserver-minikube
SSH into the minikube VM:
minikube ssh
To get more details about IP and port:
minikube ssh --v=2 --alsologtostderr
Then you can use the IP address (127.0.0.1) and the port to connect via native SSH:
ssh docker@127.0.0.1 -p 32799 -i ~/.minikube/machines/minikube/id_rsa
For file transfer, a local directory can be mounted into the minikube VM (failed last time I tried it):
minikube mount ~/tmp/minikube:/tmp/temporary
Files can be transferred back and forth via scp:
scp -P 32799 -i ~/.minikube/machines/minikube/id_rsa docker@127.0.0.1:/var/tmp/minikube/kubeadm.yaml .