文件下载:
我的百度云.png
- openvpn服务端部署:
kubectl apply -f openvpn.yaml -n hips-dev
- 下载配置和客户端手册:
http://192.168.16.144:1180/ - k8s节点客户端部署(
每个k8s节点都需要安装客户端
)
- 安装
yum -y install epel-release
yum -y install openvpn
mkdir -p /etc/openvpn/client/
cd /etc/openvpn/client/
- 修改配置
路径
从步骤二下载客户端配置文件handvpn1.zip
client
dev tun
proto tcp
remote 192.168.16.144 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca "/etc/openvpn/client/ca.crt"
cert "/etc/openvpn/client/handvpn1.crt"
key "/etc/openvpn/client/handvpn1.key"
remote-cert-tls server
tls-auth "/etc/openvpn/client/ta.key" 1
comp-lzo
verb 5
- 启动
cat handvpn1.ovpn
nohup openvpn handvpn1.ovpn >>handvpn1.log &
-
查看启动
ps -ef|grep openvpn
image.png
- 暴露服务端口,新建svc名字和注册中心相同:
kubectl expose deployment -n hips-dev hippius-admin --name=hzero-admin
kubectl expose deployment -n hips-dev hippius-app-manage --name=hippius-app-manage
kubectl expose deployment -n hips-dev hippius-device --name=hippius-device
kubectl expose deployment -n hips-dev hippius-file --name=hzero-file
kubectl expose deployment -n hips-dev hippius-gateway --name=hzero-gateway
kubectl expose deployment -n hips-dev hippius-iam --name=hzero-iam
kubectl expose deployment -n hips-dev hippius-im --name=hzero-im
kubectl expose deployment -n hips-dev hippius-message --name=hzero-message
kubectl expose deployment -n hips-dev hippius-platform --name=hippius-platform
kubectl expose deployment -n hips-dev hippius-pushcenter --name=hippius-pushcenter
kubectl expose deployment -n hips-dev hippius-register --name=hzero-register
kubectl expose deployment -n hips-dev hippius-statistics --name=hippius-statistics
kubectl expose deployment -n hips-dev hippius-submenu --name=hippius-submenu
kubectl expose deployment -n hips-dev hippius-swagger --name=hzero-swagger
kubectl expose deployment -n hips-dev hips-oauth --name=hzero-oauth
kubectl expose deployment -n hips-dev hzero-platform --name=hzero-platform
- 修改本地host:
w+r drivers
10.244.109.70 hippius-app-manage
10.244.118.197 hippius-device
10.244.70.241 hippius-platform
10.244.85.194 hippius-pushcenter
10.244.85.132 hippius-statistics
10.244.104.24 hippius-submenu
10.244.117.84 hzero-admin
10.244.100.114 hzero-file
10.244.71.250 hzero-gateway
10.244.90.90 hzero-iam
10.244.114.131 hzero-im
10.244.67.0 hzero-message
10.244.115.113 hzero-oauth
10.244.103.1 hzero-platform
10.244.100.187 hzero-register
10.244.106.135 hzero-swagger
- 启动服务:
- 添加环境变量,
eureka.instance.ip-address需要按实际修改
spring.application.name=hippius-app-manage-10129;
hzero.service.current.name=hipsam-10129;
hzero.service.current.path=/hipsam-10129/**;
hzero.service.current.service-name=hippius-app-manage-10129;
SPRING_DATASOURCE_URL=jdbc:mysql://192.168.16.144:30306/hippius_app_manage?useUnicode=true&characterEncoding=utf-8&useSSL=false;
EUREKA_DEFAULT_ZONE=http://11.11.11.16:30372/eureka;
SPRING_DATASOURCE_USERNAME =root;
SPRING_DATASOURCE_PASSWORD=xxx;
SPRING_REDIS_HOST=192.168.16.144;
SPRING_REDIS_PORT=30379;
SPRING_REDIS_PASSWORD=;
EUREKA_DEFAULT_ZONE=http://192.168.16.144:30193/eureka;
EUREKA_INSTANCE_PREFER_IP_ADDRESS=true;
eureka.instance.ip-address=10.8.0.6
- 遇到转义
SPRING_DATASOURCE_URL=jdbc:mysql://192.168.16.144:30306/hippius_app_manage?useUnicode\\\=true&characterEncoding\\\=utf-8&useSSL\\\=false
网友评论