云原生教程: 快速安装部署Kubernetes

本文主要介绍两种姿势快速部署Kubernetes,都是需要安装了VirtualBox😯

minikube

安装minikube

brew cask install minikube
# 或者下载二进制
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-darwin-amd64 \
  && sudo install minikube-darwin-amd64 /usr/local/bin/minikube

部署k8s

minikube start --memory 4096 --image-repository  registry.cn-hangzhou.aliyuncs.com/google_containers --docker-env HTTP_PROXY=http://192.168.99.1:7890 --docker-env HTTPS_PROXY=http://192.168.99.1:7890  --docker-env NO_PROXY=127.0.0.1/32,192.168.0.0/16,10.0.0.0/8,172.16.0.0/12,localhost

简单使用

# 访问Kubernetes Dashboard
minikube dashboard
# 切换
kubectl config use kubernetes-admin@kubernetes
kubectl config use minikube

具体可以参考 官方文档

kubeadm

安装vagrant

Download Vagrant

部署

git clone https://github.com/ysicing/TiGa.git
cd TiGa
# 启动虚拟机
vagrant up
vagrant ssh
sudo su
# 初始化Debian
ssh-keygen
ssh-copy-id -i .ssh/id_rsa.pub 127.0.0.1
cd /src/prepare
./install.sh
# 安装k8s
cd /src/install
./install.sh

访问Kubernetes Dashboard

浏览器访问https://172.20.0.101:30443, token登录

kubectl describe secret -n kube-system $(kubectl get secrets -n kube-system | grep dashboard-admin | cut -f1 -d ' ') | grep -E '^token'

Kubernetes Dashboard

Last modification:September 26th, 2019 at 12:22 am
搞技术/肝文章不易,恳请随意打赏 OwO

Leave a Comment