minikube
$curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.8.0/minikube-linux-amd64
$ chmod +x minikube
$ sudo mv minikube /usr/local/bin/
kubectl
$ curl -Lo kubectl http://storage.googleapis.com/kubernetes-release/release/v1.3.0/bin/linux/amd64/kubectl
$ chmod +x kubectl
$ sudo mv kubectl /usr/local/bin/
1. 下载minikube
https://storage.googleapis.com/minikube/releases/v0.16.0/minikube-linux-amd64
chmod +x minikube-linux-amd64
mv minikube-linux-amd64 /usr/local/bin
2. 下载kubectl
http://storage.googleapis.com/kubernetes-release/release/v1.3.0/bin/linux/amd64/kubectl
chmod +x kubectl
mv kubectl /usr/local/bin
3. 下载docker-machine-driver-kvm驱动
sudo curl -L https://github.com/dhiltgen/docker-machine-kvm/releases/download/v0.7.0/docker-machine-driver-kvm -o /usr/local/bin/docker-machine-driver-kvm
sudo chmod +x /usr/local/bin/docker-machine-driver-kvm
4. 安装kvm驱动
https://github.com/kubernetes/minikube/blob/v0.16.0/DRIVERS.md#kvm-driver
centos:
yum install libvirt-daemon-kvm kvm
yum install libguestfs libguestfs-tools
yum install libvirt
ubuntu:
sudo apt install libvirt-bin qemu-kvm
5. 启动libvirtd服务
libvirtd -d
6. 启动virtlogd.socket
systemctl start virtlogd.socket
7. 启动minikube
minikube start --vm-driver=kvm
开启日志
minikube start --v=7 --vm-driver=kvm
uuid重复解决方案: rm ~/.minikube/cache/localkube
常用命令:
kubectl get pod 查询列表
kubectl describe pod PodName 查询详细
kubectl get deployment 查询部署
kubectl delete deployment etcd-minikube 删除
ssh docker@192.168.42.119 -i /root/.minikube/machines/minikube/id_rsa -p 22
virsh suspend x 暂停虚拟机
virsh setmem x 512000 修改内存
virsh resume x 启动暂停的虚拟机
镜像:
docker pull vitess/etcd:v2.0.13-lite
docker pull vitess/lite
ip地址不对解决:
修改下面文件的地址 /var/lib/libvirt/dnsmasq/virbr1.status
容器操作命令:
docker ps 查看容器列表
docker exec -it 容器ID /bin/bash 容器登录
导出容器镜像:
docker save -o xxx.tar xxx xxx是镜像名称(REPOSITORY)
导入容器镜像:
docker load --input xxx.tar
ls -l | awk -F ' ' '{print "docker load --input="$NF}' | sh
minikube官方地址:
https://github.com/kubernetes/minikube/blob/v0.16.0/README.md
https://github.com/kubernetes/minikube/blob/v0.16.0/DRIVERS.md#kvm-driver
kubernetes中文文档