Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallback to non-loopback IF addresses for Domain IPs #6918

Merged
merged 1 commit into from Dec 5, 2018

Conversation

vadmeste
Copy link
Member

@vadmeste vadmeste commented Dec 4, 2018

Description

When MINIO_PUBLIC_IPS is not specified and no endpoints are passed
as arguments, fallback to the address of non loop-back interfaces.

This is useful so users can avoid setting MINIO_PUBLIC_IPS in docker
or orchestration scripts, ince users naturally setup an internal
network that connects all instances.

Motivation and Context

Fixes #6862

Regression

No

How Has This Been Tested?

  1. Checkout this PR
  2. Create a custom Docker file to test this PR.
$ cat Dockerfile.custom

FROM minio/minio
COPY ./minio /usr/bin/minio
EXPOSE 9000
ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
VOLUME ["/data"]

HEALTHCHECK --interval=30s --timeout=5s \
    CMD /usr/bin/healthcheck.sh

CMD ["minio"]
  1. Create the custom image
$ cd $GOPATH/src/github.com/minio/minio
$ make install && docker build -f Dockerfile.custom -t custom-minio .
  1. Run the following docker-compose script, also ensure that MINIO_PUBLIC_IPS is not set there,

  2. docker-compose up

  3. Two nodes will be created, setup mc to connect to both nodes, create one bucket on the first node and checks if it can be found in the second node.

version: '3'
services:

  minio-server-muc:
    image: custom-minio:latest
    # image: minio/minio
    ports:
      - 80:80
    volumes:
      - minio-server_muc_demo4_data_vol:/data
      - minio-server_muc_demo4_logs_vol:/logs
    entrypoint: >
        /bin/sh -c "
        curl https://raw.githubusercontent.com/nitisht/minio-compose/master/wait-for.sh -o wait-for.sh;
        chmod +x wait-for.sh;
        ./wait-for.sh etcd-server-muc:2379 -- /usr/bin/docker-entrypoint.sh minio gateway --address :80 nas /data/"
    environment:
      - "MINIO_ACCESS_KEY=S2Q3CDB1FOPP24M9DGS2"
      - "MINIO_SECRET_KEY=EpIb-urpHW9rXNNdtHUS6X7SuElYXO-4b7k_H_ki"
      - "MINIO_HTTP_TRACE=/logs/http.log"
      - "MINIO_REGION=MUC"
      - "MINIO_ETCD_ENDPOINTS=http://etcd-server-muc:2379"
      # - "MINIO_PUBLIC_IPS=172.18.0.2"
      - "MINIO_DOMAIN=tracecloud.test"
    networks:
      minio_network:
        ipv4_address: 172.18.0.2

  minio-server-sc:
    image: custom-minio:latest
    # image: minio/minio
    ports:
      - 90:80
    volumes:
      - minio-server_sc_demo4_data_vol:/data
      - minio-server_sc_demo4_logs_vol:/logs
    entrypoint: >
        /bin/sh -c "
        curl https://raw.githubusercontent.com/nitisht/minio-compose/master/wait-for.sh -o wait-for.sh;
        chmod +x wait-for.sh;
        ./wait-for.sh etcd-server-muc:2379 -- /usr/bin/docker-entrypoint.sh minio gateway --address :80 nas /data/"
    environment:
      - "MINIO_ACCESS_KEY=S2Q3CDB1FOPP24M9DGS2"
      - "MINIO_SECRET_KEY=EpIb-urpHW9rXNNdtHUS6X7SuElYXO-4b7k_H_ki"
      - "MINIO_HTTP_TRACE=/logs/http.log"
      - "MINIO_REGION=SC"
      # - "MINIO_PUBLIC_IPS=172.18.0.3"
      - "MINIO_ETCD_ENDPOINTS=http://etcd-server-muc:2379"
      - "MINIO_DOMAIN=tracecloud.test"
    networks:
      minio_network:
        ipv4_address: 172.18.0.3

  etcd-server-muc:
    image: quay.io/coreos/etcd:v3.1.10
    ports:
      - 2379:2379
      - 2380:2380
    environment:
      - "ALLOW_NONE_AUTHENTICATION=yes"
      - "ETCD_ADVERTISE_CLIENT_URLS=http://etcd-server-muc:2379"
      - "ETCD_LISTEN_CLIENT_URLS=http://172.18.0.6:2379"
    networks:
      minio_network:
        ipv4_address: 172.18.0.6

volumes:
  minio-server_muc_demo4_data_vol:
  minio-server_muc_demo4_logs_vol:
  minio-server_sc_demo4_data_vol:
  minio-server_sc_demo4_logs_vol:

networks:
 minio_network:
   driver: bridge
   ipam:
    config:
      - subnet: 172.18.0.0/24

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added unit tests to cover my changes.
  • I have added/updated functional tests in mint. (If yes, add mint PR # here: )
  • All new and existing tests passed.

When MINIO_PUBLIC_IPS is not specified and no endpoints are passed
as arguments, fallback to the address of non loop-back interfaces.

This is useful so users can avoid setting MINIO_PUBLIC_IPS in docker
or orchestration scripts, ince users naturally setup an internal
network that connects all instances.
@codecov
Copy link

codecov bot commented Dec 4, 2018

Codecov Report

Merging #6918 into master will increase coverage by 0.02%.
The diff coverage is 75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6918      +/-   ##
==========================================
+ Coverage   52.22%   52.24%   +0.02%     
==========================================
  Files         270      270              
  Lines       42627    42636       +9     
==========================================
+ Hits        22260    22275      +15     
+ Misses      18399    18395       -4     
+ Partials     1968     1966       -2
Impacted Files Coverage Δ
cmd/endpoint.go 86.82% <73.68%> (+1.41%) ⬆️
cmd/common-main.go 14.57% <80%> (+1.81%) ⬆️
cmd/xl-sets.go 55.85% <0%> (-1.08%) ⬇️
cmd/fs-v1.go 63.63% <0%> (+0.11%) ⬆️
cmd/fs-v1-helpers.go 69.11% <0%> (+0.91%) ⬆️
pkg/certs/certs.go 58.76% <0%> (+4.12%) ⬆️
cmd/posix-list-dir_windows.go 64.7% <0%> (+4.41%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 20e61fb...8fc3d31. Read the comment docs.

@minio-ops
Copy link

Mint Automation

Test Result
mint-tls.sh ✔️
mint-compression-xl.sh ✔️
mint-xl.sh ✔️
mint-gateway-nas.sh ✔️
mint-large-bucket.sh ✔️
mint-compression-fs.sh ✔️
mint-worm.sh ✔️
mint-fs.sh ✔️
mint-dist-xl.sh ✔️

@harshavardhana
Copy link
Member

harshavardhana commented Dec 4, 2018

$ cat Dockerfile.custom FROM minio/minio COPY ./minio /usr/bin/minio EXPOSE 9000 ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"] VOLUME ["/data"] HEALTHCHECK --interval=30s --timeout=5s \ CMD /usr/bin/healthcheck.sh CMD ["minio"]

This can be done simply by

TAG=minio/minio:custom make docker

Should simplify overall reproducing steps.

@deekoder deekoder merged commit 6114536 into minio:master Dec 5, 2018
richardkiene pushed a commit to richardkiene/minio that referenced this pull request Jan 2, 2019
When MINIO_PUBLIC_IPS is not specified and no endpoints are passed
as arguments, fallback to the address of non loop-back interfaces.

This is useful so users can avoid setting MINIO_PUBLIC_IPS in docker
or orchestration scripts, ince users naturally setup an internal
network that connects all instances.
richardkiene pushed a commit to richardkiene/minio that referenced this pull request Jan 2, 2019
When MINIO_PUBLIC_IPS is not specified and no endpoints are passed
as arguments, fallback to the address of non loop-back interfaces.

This is useful so users can avoid setting MINIO_PUBLIC_IPS in docker
or orchestration scripts, ince users naturally setup an internal
network that connects all instances.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MINIO_PUBLIC_IPS doesn't accept SRV records
5 participants