{"id":20138490,"url":"https://github.com/thiagobarradas/rancher-docker","last_synced_at":"2025-03-02T23:15:05.521Z","repository":{"id":94891949,"uuid":"157865450","full_name":"ThiagoBarradas/rancher-docker","owner":"ThiagoBarradas","description":"Container Management / Orchestration with Rancher - Demo","archived":false,"fork":false,"pushed_at":"2019-04-26T06:04:03.000Z","size":7,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-13T10:08:48.556Z","etag":null,"topics":["container","containers","demo","devops","docker","infrastructure","management","orchestration","rancher"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ThiagoBarradas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-16T12:36:04.000Z","updated_at":"2021-08-31T18:55:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"be286995-4a73-4e3e-b1e7-a6fb4c0ef759","html_url":"https://github.com/ThiagoBarradas/rancher-docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThiagoBarradas%2Francher-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThiagoBarradas%2Francher-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThiagoBarradas%2Francher-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThiagoBarradas%2Francher-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThiagoBarradas","download_url":"https://codeload.github.com/ThiagoBarradas/rancher-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241582552,"owners_count":19985845,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["container","containers","demo","devops","docker","infrastructure","management","orchestration","rancher"],"created_at":"2024-11-13T21:38:26.185Z","updated_at":"2025-03-02T23:15:05.494Z","avatar_url":"https://github.com/ThiagoBarradas.png","language":null,"readme":"## Getting Started\n\n### Running Cluster\n\n1. Register [hosts](hosts) in your local machine;\n1. Run `docker-compose up -d`;\n1. If you want run all tests offline, run `docker exec -it docker-host-01 sh /start-offline-host.sh` and `docker exec -it docker-host-02 sh /start-offline-host.sh`;\n1. Wait a few moments and open in your browser `http://rancher-server`;\n\n### Setup Access Control and Hosts  \n\n1. Setup Access Control as Local and choose a username and password. `Admin \u003e Access Control \u003e Local`;\n1. Go to `Admin \u003e Settings` and change *Host Registration URL* to `http://172.18.0.3:8080` (IP and Port in defined docker-compose.yml);\n1. Go to `Infrastructure \u003e Hosts \u003e Add Hosts` and choose `Custom`. Copy code in step 5 (without sudo);\n1. Connect in `docker-host-01` using `docker exec -it docker-host-01 sh` and run copied command;\n1. Do the previous two step for add `docker-host-02`;\n1. Wait for all containers to ready;\n\n### Creating API Services\n\n1. Go to `Stack \u003e All` and `Add Stack` with name `api`;\n1. Create `apione` service using `thiagobarradas/demo-api-get-env:latest` image; Add environment variables `apione=it's me` `apitwo=it's not me`;\n1. Create `apitwo` service using `thiagobarradas/demo-api-get-env:latest` image; Add environment variables `apione=it's not me` `apitwo=it's me`;\n\n### Creating Load Balancer\n\n1. Go to `Stack \u003e All` and `Add Stack` with name `load-balancer`;\n1. Create `loadbalancer` service using dropdown menu in `Add Service`, choose `Add Load Balancer`; \n1. Choose `always run one instance of this container on every host` scale option;\n1. Add five `Service Rules`:\n    1. `HTTP apione.com:80` to `api/apione:80` with empty path;\n    1. `HTTP apitwo.com:80` to `api/apitwo:80` with empty path;\n    1. `HTTP *:80` to `api/apione:80` with path: `/environment/apione`;\n    1. `HTTP *:80` to `api/apitwo:80` with path: `/environment/apitwo`;\n    1. `HTTP *:80` to `api/apione:80` with empty path;\n\n### Some Tests\n\n1. Access `Stack \u003e All`; Choose a service (apione or apitwo), click to view details; and scale up clicking at `+` in `Scale`;\n1. You can all containers and yours stats (cpu, mem, etc);\n1. In each container, you can click in `...` to `View Logs` or `Execute Shell`; If you hold `ctrl` the new tab will be opened in a new window; Better to see next step. Open all containers logs and keep all tabs visible;\n1. In your browser (or using postman) send some requests to:\n    1. `http://apione.com/environment/apione`\n    1. `http://apione.com/environment/apitwo`\n    1. `http://apitwo.com/environment/apione`\n    1. `http://apitwo.com/environment/apitwo`\n    1. `http://localhost/environment/apione`\n    1. `http://localhost/environment/apitwo`\n    \n## Did you like it? Please, make a donate :)\n\nif you liked this project, please make a contribution and help to keep this and other initiatives, send me some Satochis.\n\nBTC Wallet: `1G535x1rYdMo9CNdTGK3eG6XJddBHdaqfX`\n\n![1G535x1rYdMo9CNdTGK3eG6XJddBHdaqfX](https://i.imgur.com/mN7ueoE.png)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiagobarradas%2Francher-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthiagobarradas%2Francher-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiagobarradas%2Francher-docker/lists"}