---
#创建命名空间test2
apiVersion: v1
kind: Namespace
metadata:
name: test2
---
#RBAC 权限账号等
apiVersion: v1
kind: ServiceAccount
metadata:
name: rabbitmq
namespace: test2
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: endpoint-reader
namespace: test2
rules:
- apiGroups: [""]
resources: ["endpoints"]
verbs: ["get"]
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: endpoint-reader
namespace: test2
subjects:
- kind: ServiceAccount
name: rabbitmq
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: endpoint-reader
---
#service创建
kind: Service
apiVersion: v1
metadata:
name: rabbitmq-headless
namespace: test2
spec:
clusterIP: None
publishNotReadyAddresses: true
ports:
- name: amqp
port: 5672
- name: http
port: 15672
selector:
app: rabbitmq
---
kind: Service
apiVersion: v1
metadata:
namespace: test2
name: rabbitmq-service
spec:
ports:
- name: http
protocol: TCP
port: 15672
targetPort: 15672
- name: amqp
protocol: TCP
port: 5672
targetPort: 5672
selector:
app: rabbitmq
type: NodePort
---
您暂时无权查看此隐藏内容!
K8S布署有状态rabbitmq集群
未经允许不得转载:竹影清风阁 » K8S布署有状态rabbitmq集群
学习学习
学习学习