De Wiki inetshell
Saltar a: navegación, buscar

Stacks[editar]

Ejecutar un contenedor en cada nodo[editar]

https://rancher.com/docs/rancher/v1.0/en/rancher-compose/scheduling/

wordpress:
  labels:
    # Make wordpress a global service
    io.rancher.scheduler.global: 'true'
  image: wordpress
  links:
    - db: mysql
  stdin_open: true

Instalar Rancher sobre Ubuntu[editar]

https://www.howtoforge.com/tutorial/ubuntu-rancher-docker-container-manager/

Restaurar contraseña[editar]

https://rancher.com/docs/rancher/latest/en/faqs/troubleshooting/#help-i-turned-on-access-controldocsrancherv16enconfigurationaccess-control-and-can-no-longer-access-rancher-how-do-i-reset-rancher-to-disable-access-control

Obtener IP de contenedor desde metadata[editar]

echo $(curl -s http://rancher-metadata/latest/self/container/primary_ip)

API[editar]

Control de acceso[editar]

https://rancher.com/docs/rancher/v1.1/en/api/v1/access-control/

https://forums.rancher.com/t/how-to-create-a-user-in-rancher-api/2888/2

curl -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{"description":"admin", "kind":"admin", "name":"admin"}' 'http://192.168.1.1:8080/v1/accounts'

curl -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{"publicValue":"admin","secretValue":"6i5zoEyDnKmBXTcWNK34IlBJyTkAr1oO3W8EVdbS","accountId":"1a1"}' http://192.168.1.1:8080/v1/password?action=update

curl -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{"accessMode":"required","enabled":"true","name":"admin","username":"admin","password":"6i5zoEyDnKmBXTcWNK34IlBJyTkAr1oO3W8EVdbS"}' http://192.168.1.1:8080/v1/localauthconfig

Rancher CLI[editar]

Upgrade[editar]

cat <<EOF > docker-compose.yml
version: '2'
services:
  nginx:
    image: nginx:latest
EOF

rancher up -p -c -d --force-upgrade -s test

Haproxy[editar]

SSL Verify[editar]

https://github.com/rancher/rancher/issues/4977

global
ssl-server-verify none
backend target1
server $IP ssl
backend target2
server $IP ssl