kubesphere 部署 nacos 1.4.2

kubesphere 部署 nacos 1.4.2

0、准备工作

kubernetes:1.20.4

kubersphere:3.1.1

nacos:1.4.2

开放云服务器的安全组 30000 ~ 32767 TCP端口

1、下载nacos1.4.2

链接:https://pan.baidu.com/s/1hyffniJTN2lmX_iiHDW4Tw
提取码:4buw

2、修改相关配置文件(这里的数据哭url是我自己的mysql服务的dns)

(1)application.properties

### If use MySQL as datasource:
spring.datasource.platform=mysql

### Count of DB:
db.num=1

### Connect URL of DB:
db.url.0=jdbc:mysql://edu-mysql.edu:3306/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
db.user.0=root
db.password.0=数据库密码

(2)数据库创建nacos数据库,相关sql在nacos的conf文件夹下

(3)修改cluster-conf文件(这里的是我的nacos服务的dns,但是实际中我还是用的standalone模式,nacos集群访问不到,要使用单节点模式只需要在负载模板的环境变量上设置MODE STANDALONE 就行了)

#
# Copyright 1999-2018 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

#it is ip
#example
edu-nacos-v1-0.edu-nacos.edu.svc.cluster.local:8848
edu-nacos-v1-1.edu-nacos.edu.svc.cluster.local:8848
edu-nacos-v1-2.edu-nacos.edu.svc.cluster.local:8848

(4)在kubesphere中创建这两个配置文件(键就是文件的名字,值就是配置内容,复制所有相关配置内容)
在这里插入图片描述

3、创建一个nacos的有状态服务

在这里插入图片描述

(1)去dockerhub找到nacos1.4.2镜像

在这里插入图片描述

(2)相关配置模板

在这里插入图片描述

存活探针

在这里插入图片描述

挂载配置文件(点击子路径 填写配置文件名 这种形式不会替换整个文件夹,只会替换对应的这个文件):

在这里插入图片描述

在这里插入图片描述

4、创建完成,进入pod查看日志:

在这里插入图片描述

5、从服务那儿创建一个服务暴露端口即可访问

在这里插入图片描述
在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值