k8s学习铺垫

Docker Stack

docker-compose 单机部署项目
docke stack 集群部署

  1. # docker-compose file 网上docke stack案例
  2. version: '3.4'
  3. services:
  4. mongo:
  5. image: mongo
  6. restart: always
  7. networks:
  8. - mongo_network
  9. deploy:
  10. restart_policy:
  11. condition: on-failure
  12. replicas: 2
  13. mongo-express:
  14. image: mongo-express
  15. restart: always
  16. networks:
  17. - mongo_network
  18. ports:
  19. - target: 8081
  20. published: 80
  21. protocol: tcp
  22. mode: ingress
  23. environment:
  24. ME_CONFIG_MONGODB_SERVER: mongo
  25. ME_CONFIG_MONGODB_PORT: 27017
  26. deploy:
  27. restart_policy:
  28. condition: on-failure
  29. replicas: 1
  30. networks:
  31. mongo_network:
  32. external: true

Docker Secret

安全,配置密码,证书

Docker Config

配置