1.添加Chart仓库
[root@master ~]# helm repo add bitnami https://charts.bitnami.com/bitnami
[root@master ~]# helm repo update
[root@master ~]# helm search repo rabbitmq
2.下载安装包
[root@master ~]# helm pull bitnami/rabbitmq
[root@master ~]# tar -zxvf rabbitmq-11.11.1.tgz
[root@master ~]# cd rabbitmq/
3.自定义配置
1.全局配置:存储
global:
...
storageClass: "nfs-stroage"
2.版本【可选】
更改镜像就是更改版本
镜像地址:点击跳转
image:
registry: docker.io
repository: bitnami/rabbitmq
#tag: 3.11.10-debian-11-r5
tag: 3.8.11-debian-10-r20
修改提示信息
appVersion: 3.8.11
3.自定义管理员用户名密码
auth:
username: admin
password: "CloudEasy2020"
4.运行
[root@master rabbitmq]# helm install rabbitmq . -n rabbitmq
暴露服务
创建ingressroutetcp资源
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRouteTCP
metadata:
name: rabbitmq-tcp
namespace: rabbitmq
spec:
entryPoints:
- rabbitmq-tcp
routes:
- match: HostSNI(`*`)
services:
- name: rabbitmq-headless
port: 5672
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRouteTCP
metadata:
name: rabbitmq-web
namespace: rabbitmq
spec:
entryPoints:
- rabbitmq-web
routes:
- match: HostSNI(`*`)
services:
- name: rabbitmq
port: 15672
在traefik中添加路由
$ kubectl edit deployments.apps -n kube-system traefik
spec:
template:
spec:
containers:
- args:
- --entrypoints.rabbitmq-tcp.address=:5672 # 此处指定暴露至外网的端口
- --entrypoints.rabbitmq-web.address=:15672 # 此处指定暴露至外网的端口
[可选]域名访问web ui
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: rabbitmq
namespace: rabbitmq
spec:
entryPoints:
- web
routes:
- match: Host(`rabbitmq.test.com`) && PathPrefix(`/`)
kind: Rule
services:
- name: rabbitmq
port: 15672