nat模式下虚拟机设置静态ip连接不同wifiip不变
https://blog.csdn.net/shanshanqwertyuiop/article/details/105840077
安装流程
https://www.kubernetes.org.cn/7189.html
https://blog.csdn.net/sq4521/article/details/105873575/
部署java项目
harbor仓库前提,安装Docker Compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
官网
https://docs.docker.com/compose/install/#install-compose
下载harbor仓库离线版
giehub链接
https://github.com/goharbor/harbor/releases
下载链接
https://github.com/goharbor/harbor/releases/download/v2.1.0/harbor-offline-installer-v2.1.0.tgz
tar -zxf harbor-offline-installer-v2.1.0.tgz -C /usr/local/
cd harbor
cp harbor.yml.tmpl harbor.yml
2.1.0版本这里跟以前不一样,没有了harbor.cfg文件,我们需要手动复制harbor.yml.tmpl在做修改即可
修改hostname为自己的ip然后将https注释掉
hostname: 192.168.0.106
# http related config
http:
# port for http, default is 80. If https enabled, this port will redirect to https port
port: 80
# https related config
#https:
# https port for harbor, default is 443
# port: 443
# The path of cert and key files for nginx
# certificate: /your/certificate/path
# private_key: /your/private/key/path
配置文件
./prepare
编辑/etc/docker/daemon.json
增加字段
"insecure-registries": ["192.168.56.3"]
安装并启动
# ./install.sh
harbor控制
docker-compose up -d 启动
docker-compose stop 停止
docker-compose restart 重新启动
harbor启动但是网页登不进去
查看docker-compose ps
发现nignx容器状态为unhealthy
解决方法
docker-compose down
docker-compose up -d
docker login -u admin 192.168.0.106
创建镜像
docker build -t 192.168.0.106/library/java:latest .
对已有镜像可以打tag然后上传镜像仓库
docker tag imageid/name:tag 192.168.0.106/library/java:latest
上传镜像
docker push 192.168.0.106/library/java:latest
参考博客
https://cloud.tencent.com/developer/article/1512705
https://blog.csdn.net/acherson/article/details/101440637
获取登录dashboard的token
kubectl get secret --all-namespaces | grep default-token
kubectl describe secret default-token-b9g6q -n namespace
复制里面的token
K8S集群加入节点
kubeadm token create --print-join-command
复制生成的命令到要加入集群的机器上执行