{"id":16366782,"url":"https://github.com/jeff1evesque/rancher-demonstration","last_synced_at":"2026-05-07T18:33:06.410Z","repository":{"id":80613526,"uuid":"163706597","full_name":"jeff1evesque/rancher-demonstration","owner":"jeff1evesque","description":"Rancher 2.x demonstration","archived":false,"fork":false,"pushed_at":"2019-01-14T16:35:26.000Z","size":59,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-31T01:41:56.807Z","etag":null,"topics":["docker","kubernetes","rancher-agent","rancher-cli","rancher-server"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/jeff1evesque.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":"2019-01-01T01:22:43.000Z","updated_at":"2023-02-28T06:46:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"db01afad-119c-466f-82ad-2bedcdf74336","html_url":"https://github.com/jeff1evesque/rancher-demonstration","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/jeff1evesque%2Francher-demonstration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeff1evesque%2Francher-demonstration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeff1evesque%2Francher-demonstration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeff1evesque%2Francher-demonstration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeff1evesque","download_url":"https://codeload.github.com/jeff1evesque/rancher-demonstration/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239828494,"owners_count":19703883,"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","kubernetes","rancher-agent","rancher-cli","rancher-server"],"created_at":"2024-10-11T02:47:32.595Z","updated_at":"2026-02-17T09:30:18.781Z","avatar_url":"https://github.com/jeff1evesque.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rancher-demonstration\n\nThis repository is a simple demonstration of virtualized environments\n([vagrant](https://www.vagrantup.com/) + [virtualbox](https://www.virtualbox.org/)),\ntailored to exhibit the [kubernetes](https://kubernetes.io/)-based\n[rancher-server](https://github.com/rancher/rancher), and [rancher-agent](https://github.com/rancher/agent) ecosystem.\nSpecifically, a [`Vagrantfile`](https://github.com/jeff1evesque/rancher-demonstration/blob/master/Vagrantfile) will automate the processes contained within\nthe provided [install scripts](https://github.com/jeff1evesque/rancher-demonstration/tree/master/utility).\n\nIn this setup, the [rancher-server](https://github.com/jeff1evesque/rancher-demonstration/blob/master/utility/install-rancher-server)\nis launched using [Centos7x](https://github.com/jeff1evesque/rancher-demonstration/blob/1959f5817ca53d89c8d3349d3bb23406c3bf3ea6/Vagrantfile#L40-L46),\nwhile the [rancher-agent](https://github.com/jeff1evesque/rancher-demonstration/blob/master/utility/install-rancher-agent)\nis launched in [Bionic64](https://github.com/jeff1evesque/rancher-demonstration/blob/1959f5817ca53d89c8d3349d3bb23406c3bf3ea6/Vagrantfile#L47-L53).\nIf the rancher-server needs to be debian-based, or corresponding rancher-agents\nneed to be rhel-based, then additional utility scripts, not included in this\nrepository, will need to be created.\n\nRegardless of implementation, when vagrant completes provisioning, a rancher-server,\nis available via https://localhost:7895, and can be used to manage various\n[kubernetes](https://kubernetes.io/)-based clusters:\n\n![Rancher Login](https://user-images.githubusercontent.com/2907085/51079846-69126300-169d-11e9-9c06-6da88c38a0df.PNG)\n\n---\n\nUpon immediate login, the rancher-server may still be provisioning:\n\n![Rancher Provisioning](https://user-images.githubusercontent.com/2907085/51079851-a5de5a00-169d-11e9-8ee0-087483ffbff0.PNG)\n\n**Note:** the provided [install scripts](https://github.com/jeff1evesque/rancher-demonstration/tree/master/utility),\nused to provision the corresponding vagrant virtual machine(s), can also be\nused on production-like environments. However, for [high-availability](https://rancher.com/docs/rancher/v2.x/en/installation/ha/),\nthe [install-rancher-server](https://github.com/jeff1evesque/rancher-demonstration/blob/master/utility/install-rancher-server)\nwill need to be adjusted.\n\n---\n\nAfter a few minutes, the cluster will complete provisioning, and be active:\n\n![Rancher Active](https://user-images.githubusercontent.com/2907085/51079860-cd352700-169d-11e9-859a-5dc6ce9f6d39.PNG)\n\n---\n\nThen, the newly created cluster can be reviewed:\n\n![Rancher Cluster](https://user-images.githubusercontent.com/2907085/51079869-e8a03200-169d-11e9-96c6-457ec62fb695.PNG)\n\n## Additional hosts\n\nAdditional hosts can be added to a desired cluster, by first clicking *Edit*\nunder the top-right hamburger icon:\n\n![rancher-add-host](https://user-images.githubusercontent.com/2907085/51116143-446ed600-17d8-11e9-8642-97d82fc4d36e.PNG)\n\nAt the bottom of the associated page, the corresponding docker command can be\npasted into the desired cluster host:\n\n![rancher-new-host-command](https://user-images.githubusercontent.com/2907085/51116220-8566ea80-17d8-11e9-9c8d-f0d223cb697f.PNG)\n\n## Deployment\n\nThe `kubectl` command can be executed on the rancher-server via the web-browser,\nor directly within the container:\n\n```bash\n[root@rancher-server vagrant]# docker ps -a\nCONTAINER ID        IMAGE                    COMMAND             CREATED             STATUS              PORTS                                                               NAMES\n92dde0d45453        rancher/rancher:v2.1.5   \"entrypoint.sh\"     38 hours ago        Up 38 hours         0.0.0.0:8890-\u003e80/tcp, 0.0                      .0.0:8895-\u003e443/tcp   rancher\n[root@rancher-server vagrant]# docker exec -it rancher /bin/bash\nroot@92dde0d45453:/var/lib/rancher# kubectl run \\\n  --image=nginx \\\n  --port=80 \\\n  --env='DOMAIN=cluster' \\\n  replicas=3\n```\n\n**Note:** if `--env=` is passed, environment variables can be read from STDIN\nusing the standard env syntax.\n\nAdditionally, a yaml configuration file can be utilized:\n\n```bash\n[root@rancher-server vagrant]# docker ps -a\nCONTAINER ID        IMAGE                    COMMAND             CREATED             STATUS              PORTS                                                               NAMES\n92dde0d45453        rancher/rancher:v2.1.5   \"entrypoint.sh\"     38 hours ago        Up 38 hours         0.0.0.0:8890-\u003e80/tcp, 0.0                      .0.0:8895-\u003e443/tcp   rancher\n[root@rancher-server vagrant]# docker exec -it rancher /bin/bash\nroot@92dde0d45453:/var/lib/rancher# kubectl create -f ./manifest.yaml\nroot@92dde0d45453:/var/lib/rancher# kubectl get deployments\nNAME               DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE\nnginx-deployment   3         3         3            3           18s\n```\n\nThe following is an example `manifest.yaml`:\n\n```yaml\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: nginx-deployment\n  labels:\n    app: nginx\nspec:\n  replicas: 3\n  selector:\n    matchLabels:\n      app: nginx\n  template:\n    metadata:\n      labels:\n        app: nginx\n    spec:\n      containers:\n        - name: nginx\n          image: nginx:1.7.9\n          ports:\n          - containerPort: 80\n        env:\n        - name: DOMAIN\n          value: cluster\n```\n\n**Note:** for development purposes, the `kind: Pod` can be implemented if\n`replicas` are not needed. However, in production systems, the `kind: Deployment`\nis typically desired.\n\n**Note:** [Kompose](http://kompose.io/user-guide/) can convert an existing\n`docker-compose.yml` to a series of kubernetes yaml files.\n\nAlternatively, instead of defining multiple environment variables for each yaml\nfile, a custom [`configMapRef`](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#configure-all-key-value-pairs-in-a-configmap-as-container-environment-variables)\ncan be created:\n\n```yaml\nroot@92dde0d45453:/var/lib/rancher# cat config/special_config.yml\napiVersion: v1\nkind: ConfigMap\nmetadata:\n  name: special-config\n  namespace: default\ndata:\n  DOMAIN: cluster\nroot@92dde0d45453:/var/lib/rancher# kubectl create configmap special_config --from-file=config/special_config.yml\n```\n\n**Note:** the [ConfigMap](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/)\nAPI resource stores configuration data as key-value pairs. The data can be\nconsumed in pods or provide the configurations for system components such as\ncontrollers. ConfigMap is similar to [Secrets](https://kubernetes.io/docs/concepts/configuration/secret/),\nbut provides a means of working with strings that don’t contain sensitive\ninformation.\n\nThis allows the above `manifest.yaml` to refactor as follows:\n\n```yaml\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: nginx-deployment\n  labels:\n    app: nginx\nspec:\n  replicas: 3\n  selector:\n    matchLabels:\n      app: nginx\n  template:\n    metadata:\n      labels:\n        app: nginx\n    spec:\n      containers:\n      - name: nginx\n        image: nginx:1.7.9\n        ports:\n          - containerPort: 80\n        envFrom:\n          - configMapRef:\n            name: special-config\n            key: DOMAIN\n```\n\n**Note:** if the `envFrom` \u003e `key` is omitted, the entire `special-config`,\nwill be available within the given container.\n\n## Configuration\n\nFork this project in your GitHub account.  Then, clone your repository, with\none of the following approaches:\n\n- [simple clone](https://jeff1evesque.github.io/machine-learning.docs/latest/html/configuration/setup-clone#simple-clone):\n clone the remote master branch.\n- [commit hash](https://jeff1evesque.github.io/machine-learning.docs/latest/html/configuration/setup-clone#commit-hash):\n clone the remote master branch, then checkout a specific commit hash.\n- [release tag](https://jeff1evesque.github.io/machine-learning.docs/latest/html/configuration/setup-clone#release-tag):\n clone the remote branch, associated with the desired release tag.\n\n## Installation\n\nIn order to proceed with the installation for this project, three dependencies\nneed to be installed:\n\n- [Vagrant](https://www.vagrantup.com/)\n- [Virtualbox x.y.z](http://download.virtualbox.org/virtualbox/5.1.2/) (or higher)\n- [Extension Pack x.y.z](http://download.virtualbox.org/virtualbox/5.1.2/) (required)\n\nOnce the necessary dependencies have been installed, execute the following\ncommand to build the rancher-server:\n\n```bash\ncd /path/to/rancher-demonstration/\nvagrant up\n```\n\n**Note:** an alternative syntax to `vagrant up`, is to run `vagrant up rancher-server`.\nHowever, the associated `rancher-agent` needs to be created as well.\n\nDepending on the network speed, the build can take between 2-4 minutes. So,\ngrab a cup of coffee, and perhaps enjoy a danish while the virtual machine\nbuilds.\n\n**Note:** a more complete refresher on virtualization, can be found within the\nvagrant [wiki page](https://github.com/jeff1evesque/machine-learning/wiki/Vagrant).\n\nThough, the implemented [install scripts](https://github.com/jeff1evesque/rancher-demonstration/tree/master/utility)\ncan be used to provision vagrant, it can be run on non-vagrant systems. For example,\nthe [install scripts](https://github.com/jeff1evesque/rancher-demonstration/tree/master/utility)\ncan easily be run on corresponding virtual machines:\n\n```bash\n## virtual machine for rancher-server\n./install-rancher-server \\\n  \"$server_version\" \\\n  \"$server_internal_port\" \\\n  \"$server_internal_https_port\" \\\n\u003e\u003e \"${project_root}/logs/install-rancher-server.txt\" 2\u003e\u00261\n\n## virtual machine for rancher-agent\n./install-rancher-agent \\\n  \"$agent_version\" \\\n  \"$server_ip\" \\\n  \"$server_internal_port\" \\\n  \"$server_internal_https_port\" \\\n\u003e\u003e \"${project_root}/logs/install-rancher-agent.txt\" 2\u003e\u00261\n```\n\n**Note:** when running the above [install scripts](https://github.com/jeff1evesque/rancher-demonstration/tree/master/utility),\nit is assumed that [docker](https://github.com/jeff1evesque/rancher-demonstration/blob/master/utility/install-docker),\nand [rancher-cli](https://github.com/jeff1evesque/rancher-demonstration/blob/master/utility/install-rancher-cli)\ndependencies have been accounted.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeff1evesque%2Francher-demonstration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeff1evesque%2Francher-demonstration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeff1evesque%2Francher-demonstration/lists"}