CSDN is really really stupid community.People just as the copier day by day.
Purposes:
- Set up the kubernetes development for locally testing or other goals which you want to archieve
- Lead the people which want to study the kubernetes to the correct way
Preparation:
Windows Platform
1.Installation of docker desktop and enable the kubernetes inside the docker deskop.
Tips:
You may meet a lot of troubles on the way to deploy your kubernetes.But the good news is that alibaba have the open github repository for this problem.github.com/AliyunConta…
Do not open the WSL2 engine for the docker desktop!!! If not , you can not accee the pods out of the k8s container.
2.Install the minikube via the chocolaty. chocolatey.org/
3.Start your minikube with this command
minikube start --image-mirror-country='cn' --driver=hyperv
Note: You must open the your kubernetes with hyperv driver, otherwise you can not access the pods inside your k8s container.Additionally, i also hate the china gateway!
Build your docker image and send it to k8s
You may want to use your locally built docker image and do not suppose to create the online docker image repo.
Firstly, you need to connect to the docker daemon inside the k8s engine by this command.
minikube docker-env
For me , on the windows platform, you may get these outputs in command console.
$Env:DOCKER_HOST = "tcp://172.22.68.68:2376"
$Env:DOCKER_CERT_PATH = "C:\Users\Administrator\.minikube\certs"
$Env:MINIKUBE_ACTIVE_DOCKERD = "minikube"
# To point your shell to minikube's docker-daemon, run:
# & minikube -p minikube docker-env | Invoke-Expression
Next, execute the final command.
& minikube -p minikube docker-env | Invoke-Expression
Now , you can build your docker image for k8s.If you create the new command console , you need repeat the steps before you have done.
Enjoy it!!!
You can also learn more from the k8s offical website.Such as ingress,deployment,service and things like that.
K8S