Hi,
I’am trying to start a “rancher/rancher-agent” service from cloud-config.aml provided to “ros install”. But the Agent always get’s a Bridge-Network not the Host-Network assigned and fails.
How to reproduce:
-
Create Cluster in Rancher
-
Boot RancherOS
-
Install RancherOS with following cloud-config.yml
#cloud-config
ssh_authorized_keys:
- ssh-rsa ##SSH-PUBLIC-KEY##hostname: ##CLUSTER-NODE-HOSTNAME##
rancher:
services:
rancher-agent1:
image: rancher/rancher-agent:v2.0.8
privileged: true
restart: unless-stopped
volumes:
- /var/run:/var/run
- /etc/kubernetes:/etc/kubernetes
net: host
networks:
hostnet: {}
environment:
- CATTLE_SERVER=##URL-OF-RANCHER##
- CATTLE_TOKEN=##TOKEN-FROM-RANCHER##
- CATTLE_CA_CHECKSUM=##CHECKSUM-FROM-RANCHER##
- ETCD=true
- CONTROL=true
- WORKER=true
networks:
hostnet:
external: true
name: host -
run “docker inspect rancher-agent1” / Provisioning in Rancher fails
Expected Result:
rancher-agent1 get’s Host-Network assigned and provisioning finished.
Logging in to RancherOS and running the following manually via ssh is working:
“sudo docker run -d --privileged --restart=unless-stopped --net=host -v /etc/kubernetes:/etc/kubernetes -v /var/run:/var/run rancher/rancher-agent:v2.0.8 --server ##URL-OF-RANCHER## --token ##TOKEN-FROM-RANCHER## --ca-checksum ##CHECKSUM-FROM-RANCHER## --etcd --controlplane --worker”
Appendix:
I’ve a running testing Environment using libvirt on my system so and ideas on how to start rancher/rancher-agent with cloud-config are welcome - I can try them quickly.