项目作者: OneideLuizSchneider

项目描述 :
高级语言:
项目地址: git://github.com/OneideLuizSchneider/rancher-cluster.git
创建时间: 2019-06-30T21:21:59Z
项目社区:https://github.com/OneideLuizSchneider/rancher-cluster

开源协议:

下载


Rancher step by step - v2.5.1

First step: \
Make sure you have Docker installed.

Second step: \
We need to run the Rancher Server with some commands, ex.:

  1. sudo docker run -d \
  2. --restart=unless-stopped \
  3. --name rancher \
  4. -p 80:80 \
  5. -p 443:443 \
  6. -v /opt/rancher:/var/lib/rancher \
  7. --privileged \
  8. rancher/rancher:v2.5.1 --no-cacerts

The --no-cacerts will make sure https://rancher_url/v3/settings/cacerts is empty. \
Remember, this is optional. \
This solve the problem: x509: certificate signed by unknown authority

The --privileged solve kubernetes privileged requirements on the latest versions of rancher.

To use with DNS, and auto-gernerate certificate, just need to add a parameter, like this:

  1. sudo docker run -d \
  2. --restart=unless-stopped \
  3. --name rancher \
  4. -p 80:80 \
  5. -p 443:443 \
  6. -v /opt/rancher:/var/lib/rancher \
  7. --privileged \
  8. rancher/rancher:v2.5.1 \
  9. --acme-domain mydomain.com

Third step: \
We need to use rancher-cli official image for run the commands(You can make for yourself an image).

  1. 1. rancher login HOST TOKEN
  2. 2. rancher ps # for see the k8s deployments
  3. 3. rancher kubectl set image deployments/nginx nginx=nginx:latest # for update a deployment

Whith this we can use Rancher CLI commands, for example in Continuous Integration. \
\
\
Enjoy it :D