{"id":13450407,"url":"https://github.com/komljen/rancher-salt","last_synced_at":"2025-10-25T11:31:21.814Z","repository":{"id":71400263,"uuid":"65731750","full_name":"komljen/rancher-salt","owner":"komljen","description":"Salt states for Rancher container platform deployment","archived":false,"fork":false,"pushed_at":"2017-03-23T12:34:21.000Z","size":40,"stargazers_count":42,"open_issues_count":1,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-31T07:03:57.183Z","etag":null,"topics":["docker","rancher","rancher-deployment","rancher-salt","salt-states","saltstack"],"latest_commit_sha":null,"homepage":null,"language":"SaltStack","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/komljen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-08-15T12:47:16.000Z","updated_at":"2021-06-27T15:09:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"f3ced8c9-60b7-4175-83fa-d3ea646fd435","html_url":"https://github.com/komljen/rancher-salt","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/komljen%2Francher-salt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komljen%2Francher-salt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komljen%2Francher-salt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komljen%2Francher-salt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/komljen","download_url":"https://codeload.github.com/komljen/rancher-salt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238128552,"owners_count":19421053,"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":["docker","rancher","rancher-deployment","rancher-salt","salt-states","saltstack"],"created_at":"2024-07-31T07:00:34.350Z","updated_at":"2025-10-25T11:31:16.409Z","avatar_url":"https://github.com/komljen.png","language":"SaltStack","funding_links":[],"categories":["Rancher 1.0"],"sub_categories":["Community projects 1.0"],"readme":"# Rancher container platform deployment\n\nSalt states for Rancher container platform deployment.\n\nSupport for:\n\n * Rancher server - single node with external MySQL database\n * Rancher agents - automatically provisioned on server start\n * Rancher multi-environment support - automatically create new environments and add agents to them (Kubernetes, Swarm and Mesos)\n * Docker registry - it is not automatically added to Rancher environment\n * Kubernetes will be automatically provisioned on one node\n * Support for different providers:\n   * Vagrant\n   * AWS\n\nVersions:\n\n * Ubuntu 14.04\n * Salt v2016.3.5\n * Rancher v1.4.1\n * Docker 1.12.6\n * Vagrant 1.9.3\n\nRancher default environment:\n![Rancher default environment](https://www.dropbox.com/s/4vta5amp2igjgo8/rancher_env2.png?raw=true)\n\nRancher kubernetes environment:\n![Rancher kubernetes environment](https://www.dropbox.com/s/n3esrs086z35d6n/rancher_env3.png?raw=true)\n\n# Configuration options\n\nYou can automatically provision Rancher agents to a particular environment specifying ```agentEnvironment``` grain. Without it, agents will be added to a Default environment. Depending on provider those can be added to ```properties.sls``` file in Vagrant or if running on AWS inside ```/etc/salt/cloud.maps.d/rancher.conf```.\n\n# Vagrant\n\nIf you want to test this deployment on your local machine inside VMs, the easiest way is to use Vagrant with VirtualBox provider:\n\n```\ngit clone https://github.com/komljen/rancher-salt\ncd rancher-salt/providers/vagrant \u0026\u0026 vagrant up\n```\nThis will bring up 3 VMs, one master, and 3 minion nodes.\nTest the connectivity between master and minions:\n\n```\nvagrant ssh master\nsudo salt '*' test.ping\n```\nIf everything is OK you can proceed with the deployment step. First, you need to run high state to add roles to minions based on ```properties.sls``` file:\n\n```\nsudo salt '*' state.highstate\n```\nThen to start a Rancher deployment run orchestrate state:\n\n```\nsudo salt-run state.orchestrate deploy.rancher\n```\nIt will take a few minutes to complete. Then you can check Rancher status at ```http://localhost:8080```.\n\n# AWS EC2\n\nSalt cloud is used for AWS provisioning. The easiest way is to run provisioning from prepared docker container which has salt and awscli tools installed with prepared config files. You can  run this salt-cloud container in background and connect to it when needed:\n\n```\ndocker run -d -e AWS_ACCESS_KEY_ID=KEY \\\n              -e AWS_SECRET_ACCESS_KEY=SECRET \\\n              -e AWS_DEFAULT_REGION=us-west-2 \\\n              -e AWS_DEFAULT_AZ=us-west-2a \\\n              -e AWS_AMI_ID=ami-d732f0b7 \\\n              --name salt-cloud \\\n              komljen/salt-cloud\n```\nThen check for logs and attach to a running container:\n\n```\ndocker logs -f salt-cloud\ndocker exec -i -t salt-cloud bash\n```\n\nIf everything is fine you can start provisioning (master will start first and then all minion nodes will start in parallel):\n\n```\nsalt-cloud -m /etc/salt/cloud.maps.d/rancher.conf -P -y\n```\n\nNow you can connect to the master node using new pem key /etc/salt/salt_cloud_key.pem. Check your master public IP address with:\n\n```\nsalt-cloud -Q\nssh -i /etc/salt/salt_cloud_key.pem ubuntu@\u003cmaster_public_ip\u003e\n```\n\nCheck environment and if all minions are connected deploy rancher:\n\n```\nsudo salt '*' test.ping\nsudo salt-run state.orchestrate deploy.rancher\n```\n\nTo access rancher web UI at ```http://AWS_MASTER_PUBLIC_DNS:8080``` you need to open 8080 port first.\n\nIf you want to destroy all instances (EBS volumes will be deleted also) run following command:\n\n```\nsalt-cloud -m /etc/salt/cloud.maps.d/rancher.conf -d -y\n```\n\n**NOTE:** Do not delete container until you first copy .pem key from it! Otherwise, you will not be able to log into instances.\n\n```\ndocker cp salt-cloud:/etc/salt/salt_cloud_key.pem .\ndocker rm -f salt-cloud\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkomljen%2Francher-salt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkomljen%2Francher-salt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkomljen%2Francher-salt/lists"}