kubernetes部署rabbitmq
https://static01.imgkr.com/temp/3eca5f2d9a594d2c8858b428856d4a10.jpg
Deployment
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: rabbitmq
labels:
name: rabbitmq
spec:
template:
metadata:
name: rabbitmq
labels:
name: rabbitmq
spec:
containers:
- name: rabbitmq
image: rabbitmq:3.7-management
imagePullPolicy: IfNotPresent
env:
- name: RABBITMQ_DEFAULT_USER
value: "admin"
- name: RABBITMQ_DEFAULT_PASS
value: "123456"
ports:
- name: http
containerPort: 15672
- name: amqp
containerPort: 5672
Service
kind: Service
apiVersion: v1
metadata:
name: rabbitmq-service
spec:
type: NodePort
ports:
- name: http
protocol: TCP
port: 15672
targetPort: 15672
nodePort: 30007
- name: amqp
protocol: TCP
port: 5672
targetPort: 5672
nodePort: 30008
selector:
name: rabbitmq