zoukankan      html  css  js  c++  java
  • k8s Rabbitmq安装部署

    安装方式

     kubectl apply -f rabbitmq.yaml -n yunda-dev-cache
    

    rabbitmq.yaml

    ##创建PV
    # 注意更换存储方式
    ---
    apiVersion: v1
    kind: PersistentVolume
    metadata:
     name: rabbitmq-project-pv
     labels:
       pv: rabbitmq-project-pv
    spec:
     capacity:
       storage: 10Gi
     accessModes:
       - ReadWriteMany
     persistentVolumeReclaimPolicy: Retain
     nfs:
       path: /data/k8s
       server: 192.168.8.158
    
    ##创建pvc
    ---
    kind: PersistentVolumeClaim
    apiVersion: v1
    metadata:
     name: rabbitmq-project-pvc
    spec:
     accessModes:
       - ReadWriteMany
     resources:
       requests:
         storage: 10Gi
     selector:
       matchLabels:
         pv: rabbitmq-project-pv
    
    
    
    ## 部署rabbitmq
    ---
    apiVersion: apps/v1
    kind: Deployment
    metadata:
     name: rabbitmq-project
     labels:
       name: rabbitmq-project
    spec:
     replicas: 1
     selector:
        matchLabels:
            name: rabbitmq-project
     template:
       metadata:
         labels: 
          name: rabbitmq-project
       spec:
         containers:
         - name: rabbitmq-project
           image: rabbitmq:3.7.8-management
           volumeMounts:
           - mountPath: /var/lib/rabbitmq
             name: rabbitmq-project
           ports:
           - containerPort: 4369
           - containerPort: 5671
           - containerPort: 5672
           - containerPort: 15672
           - containerPort: 25672
           env:
           - name: RABBITMQ_DEFAULT_USER
             value: atlas
           - name: RABBITMQ_DEFAULT_PASS
             value: rabbitmq-atlas       
         volumes:
         - name: rabbitmq-project
           persistentVolumeClaim:
             claimName: rabbitmq-project-pvc
         
    
    ##创建Service
    ---
    apiVersion: v1
    kind: Service
    metadata:
     name: rabbitmq-project
     labels: 
      name: rabbitmq-project
    spec:
     type: NodePort
     ports:
     - port: 5672
       protocol: TCP
       targetPort: 5672
       name: rabbitmq-project-5672
       nodePort: 30010
     - port: 15672
       protocol: TCP
       targetPort: 15672
       name: rabbitmq-project-15672
       nodePort: 30009
     selector:
       name: rabbitmq-project
    

  • 相关阅读:
    OpenSSL 安装 (Linux系统)
    JVM 指令集
    Github清除历史提交,保留最新提交
    php7+apache2.4 安装(window)
    mysql 函数模拟序列
    SpringBoot配置成Liunx服务
    Liunx下NFS服务器的搭建与配置
    Laravel 出现"RuntimeException inEncrypter.php line 43: The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths."问题的解决办法
    win7安装laravel
    win7安装composer
  • 原文地址:https://www.cnblogs.com/lanheader/p/14153952.html
Copyright © 2011-2022 走看看