服务介绍
- t-sc 服务依赖于mysql
- t-kateway 服务依赖于t-sc
docker镜像推送
下载mysql 5.7镜像
制作sc kateway镜像
参考任意节点登录harbor并推送镜像到harbor仓库将镜像推送到harbor仓库
k8sMaster获取登录私服Harbor的秘钥
docker login 192.168.10.102
## admin Harbor12345
在/root/.docker/config.json里面有一个秘钥
cat /root/.docker/config.json | base64 -w 0
==>得到: ewoJImF1dGhzIjogewoJCSIxOTIuMTY4LjEwLjEwMiI6IHsKCQkJImF1dGgiOiAiWVdSdGFXNDZTR0Z5WW05eU1USXpORFU9IgoJCX0KCX0KfQ==
K8sMaster节点任意目录
vim secret.yaml
修改其中的dockerconfigjson为上面获取到的值
apiVersion: v1
kind: Secret
metadata:
name: login
type: kubernetes.io/dockerconfigjson
data:
.dockerconfigjson: ewoJImF1dGhzIjogewoJCSIxOTIuMTY4LjEwLjEwMiI6IHsKCQkJImF1dGgiOiAiWVdSdGFXNDZTR0Z5WW05eU1USXpORFU9IgoJCX0KCX0KfQ==
运行login应用
kubectl apply secret.yaml
创建yaml文件
创建项目文件夹
mkdir /root/mytest
mkdir -p /root/mytest/t-gateway
mkdir -p /root/mytest/t-mysql
mkdir -p /root/mytest/t-sc
t-mysql的deployment和service配置创建
cd /root/mytest/t-mysql
vim deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: t-mysql-deployment
spec:
replicas: 1
selector:
matchLabels:
app: t-mysql
env: testing
template:
metadata:
labels:
app: t-mysql
env: testing
spec:
containers:
- name: t-mysql
image