In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article will explain in detail how to compile Rancher in source code in Kubernetes. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
Rancher is a PaaS management platform based on kubernetes, and its maturity is OK.
Source package preparation mkdir-p $GOPATH/src/github.com/ranchercd $GOPATH/src/github.com/ranchergit clone https://github.com/rancher/rancher.gitcd rancher
Note 1: after trying git clone xx-depth=1 and then compiling, the corresponding dependency package can not be pulled correctly.
Compile and package the image cd $GOPATH/src/github.com/rancher/rancher./scripts/build// into docker image//-execute according to the definition of dockfile, including downloading baseimage, etc. / scripts/package
Note 2: the compilation and packaging processes have been interrupted several times and repeated, but they are all successful. Blame the busy network and server for causing timeout.
Note 3: (after version 2.3.3, the problem seems to have been solved, this step can be omitted) the only thing that needs to be adjusted in the packaging process is to create. / dist, the name of the newly generated image needs to be written to it in the final stage of packaging, but somehow the script itself lacks the creation of this directory.
Note 4: (the problem seems to have been solved after version 2.3.3, this step can be omitted) adjust the contents of one line of the compilation script to the compilation script. / scripts/package from
Echo Built ${IMAGE} # ${AGENT_IMAGE}
Change to (remove annotation symbols)
Echo Built ${IMAGE} ${AGENT_IMAGE}
Note 5: (after version 2.3.3, the problem seems to have been solved, this step can be omitted) when compiling repeatedly, it will prompt that / tmp/system-charts already exists and needs to be manually deleted before compilation.
Compile output
The compiled files are stored in the $GOPATH/src/github.com/rancher/rancher/bin directory for viewing.
. / rancher-h./agent
After the compilation, the new rancher-agent is added to the image repository (but no rancher.. is seen)
[root@iZm5efctez2mq4wk8wbhsyZ rancher] # docker imagesREPOSITORY TAG IMAGE ID CREATED SIZErancher/rancher-agent dev 42545cac55a7 About a minute ago 283MB uses replacement for image-based deployment
For example, rancher starts by mirroring.
Docker run-d-- restart=unless-stopped-p 80:80-p 443 rancher/rancher
Assume that the docker instance name is awesome_dijkstra
# in the compiled directory, replace the rancher executable file docker cp bin/rancher awesome_dijkstra:/usr/bin# to restart the container effective docker restart awesome_dijkstra
Note 6: previously, the v2.2.3-rc9 source code package was successfully compiled. When this method is used in conjunction with 2.3.3 image deployment, rancher/rancher startup will fail due to different etcd version requirements. After changing the source code package to the master branch, solve.
Remarks compilation and running environment centos 7.62C4Ggo version go1.13.4 linux/amd64 on "how to compile Rancher in Kubernetes" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, please share it out for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 238
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.