首页 > 其他分享 >minio-docker-swarm-compose-secrets.yaml

minio-docker-swarm-compose-secrets.yaml

时间:2023-01-17 09:14:25浏览次数:61  
标签:compose minio secrets yaml common key docker

minio-docker-swarm-compose-secrets.yaml

docker swarm 集群部署minio 文档

version: '3.7'
# Settings and configurations that are common for all containers
x-minio-common: &minio-common
  image: quay.io/minio/minio:RELEASE.2023-01-12T02-06-16Z
  command: server --console-address ":9001" http://minio{1...4}/data{1...2}
  expose:
    - "9000"
    - "9001"
  # environment:
    # MINIO_ROOT_USER: minioadmin
    # MINIO_ROOT_PASSWORD: minioadmin
  networks:
    - minio_distributed
  deploy:
    mode: replicated
      replicas: 6
    restart_policy:
      delay: 10s
      max_attempts: 10
      window: 60s
    placement:
      constraints:
        - node.role==manager
       # - node.labels.minio1==true
  secrets:
    - secret_key
    - access_key
  healthcheck:
    test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
    interval: 30s
    timeout: 20s
    retries: 3
services:
  minio1:
    <<: *minio-common
    hostname: minio1
    volumes:
      - ./data1-1:/data1
      - ./data1-2:/data2
  minio2:
    <<: *minio-common
    hostname: minio2
    volumes:
      - ./data2-1:/data1
      - ./data2-2:/data2
  minio3:
    <<: *minio-common
    hostname: minio3
    volumes:
      - ./data2-1:/data1
      - ./data2-2:/data2
  minio4:
    <<: *minio-common
    hostname: minio4
    volumes:
      - ./data4-1:/data1
      - ./data4-2:/data2
  nginx:
    image: nginx:1.19.2-alpine
    hostname: nginx
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
    ports:
      - "9000:9000"
      - "9001:9001"
    depends_on:
      - minio1
      - minio2
      - minio3
      - minio4
# volumes:
#  data1-1:
#  data1-2:
#  data2-1:
#  data2-2:
#  data3-1:
#  data3-2:
#  data4-1:
#  data4-2:
networks:
  minio_distributed:
    driver: overlay
secrets:
  secret_key:
    external: true
  access_key:
    external: true

修改说明

1.使用Docker secrets进行MinIO Access和Secret密钥自定义

echo "testAccess" | docker secret create access_key -
echo "testSecret_key" | docker secret create secret_key -

将生成的密钥填入docker-compose.yml
x-minio-common.secrets
参考:
http://docs.minio.org.cn/docs/master/minio-docker-quickstart-guide
2.docker-compose.yml设置的是在一台服务器上运行4个节点,

标签:compose,minio,secrets,yaml,common,key,docker
From: https://www.cnblogs.com/nicaine/p/17056901.html

相关文章

  • Go读取yaml文件到struct类
    1、yaml文件准备common:secretid:AKIDxxxxxsecretKey:3xgGxxxxegion:ap-guangzhouzone:ap-guangzhou-7InstanceChargeType:POSTPAID_BY_HOUR2......
  • Docker-compose(容器编排)
    Compose是Docker公司推出的一个工具软件,可以管理多个Docker容器组成一个应用。你需要定义一个YAML格式的配置文件docker-compose.yml,写好多个容器之间的调用关系。......
  • dockercompose搭建GITLAB上传代码
    1.创建挂载目录:mkdir-p/home/yuexin/gitlab/etc/home/yuexin/gitlab/log/home/yuexin/gitlab/data2.编写dockercomposeversion:'3.7'services:gitlab:im......
  • minio-docker-compose-secrets.yaml
    docker-compose-secrets.yamlversion:'3.7'services:minio1:image:minio/minio:RELEASE.2020-06-03T22-13-49Zhostname:minio1volumes:-m......
  • minio-docker-compose.yaml
    docker-compose.yamlversion:'3.7'#Settingsandconfigurationsthatarecommonforallcontainersx-minio-common:&minio-commonimage:quay.io/minio/minio......
  • Kubernetes(k8s) YAML文件详解
    原文网址:https://www.cnblogs.com/liugp/p/16361487.html目录一、yaml文件简介1)yaml的语法规则:2)在Kubernetes中,只需要知道两种结构类型即可:二、yaml常见语法1......
  • 适合编程初学者的开源项目:小游戏2048(安卓Compose版)
    目标为编程初学者打造入门学习项目,使用各种主流编程语言来实现。2048游戏规则一共16个单元格,初始时由2或者4构成。1、手指向一个方向滑动,所有格子会向那个方向运动。2......
  • docker-compose部署zabbix
    前期准备工作新建必要文件夹mkdir-pzabbix/{etc,fonts}准备字体文件存放在./zabbix/fonts/下就可以不过名字必须叫DejaVuSans.ttf可以根据自己的需求,在windows......
  • 借助docker-compose在docker中部署单机的elasticsearch和kibana
    ---version:'3'services:elasticsearch:image:docker.elastic.co/elasticsearch/elasticsearch:7.17.8container_name:elasticsearchenvironment:......
  • Kubernetes:通过轻量化工具 kubespy 实时观察YAML资源变更
    写在前面分享一个小工具​​kubespy​​给小伙伴博文内容涉及:工具的简单介绍下载安装以​​kubectl​​插件方式使用Demo理解不足小伙伴帮忙指正我所渴求的,無非是......