我开始使用Rancher和Vagrant创建我的本地开发环境.我已经完成的步骤:
我下载并安装了适用于Linux的Vagrant软件包
sudo rpm -i vagrant_1.7.2_x86_64.rpm
Run Code Online (Sandbox Code Playgroud)Vagrant版本:
vagran --version
Vagrant 1.7.2
Run Code Online (Sandbox Code Playgroud)
我从GitHub克隆了Rancher回购:
git clone git@github.com:rancherio/rancher.git
Run Code Online (Sandbox Code Playgroud)
哪个有Vagrant文件.执行后:
sudo vagrant up
Run Code Online (Sandbox Code Playgroud)
这是我得到错误的步骤,我得到了这个:
==> rancher: Box 'coreos-alpha' could not be found. Attempting to find and install...
rancher: Box Provider: virtualbox
rancher: Box Version: >= 308.0.1
==> rancher: Loading metadata for box 'http://alpha.release.core-os.net/amd64-usr/current/coreos_production_vagrant.json'
rancher: URL: http://alpha.release.core-os.net/amd64-usr/current/coreos_production_vagrant.json
==> rancher: Adding box 'coreos-alpha' (v709.0.0) for provider: virtualbox
rancher: Downloading: http://alpha.release.core-os.net/amd64-usr/709.0.0/coreos_production_vagrant.box
rancher: Calculating and comparing box checksum...
==> rancher: Successfully added box 'coreos-alpha' (v709.0.0) for 'virtualbox'! …Run Code Online (Sandbox Code Playgroud) 当docker swarm检测到没有足够的资源来安排所有服务时,如何自动配置新机器?
我使用rancher和docker swarm调度程序的设置,如果资源不足,服务创建失败:
exit status 1: Creating stresstest2_workerb1_1 Creating stresstest2_workerb2_1 no resources available to schedule container
Run Code Online (Sandbox Code Playgroud)
我可以轮询这个状态并在需要时调用docker机器,但是rancher不会尝试重新安排丢失的服务.我想知道是否有更集成的解决方案,也许是docker swarm中的一个钩子,可以用来动态调用docker-machine来创建或删除机器.
我目前正在使用Docker 1.11 + Docker Swarm或Docker 1.12在Swarm模式下决定Rancher,所以任何解决方案都可以.
我正在尝试使用 rancher REST api 创建容器并将其添加到 rancher 中的现有服务。
我希望以下请求会创建一个容器并将其添加到 atlas-mosquitto 堆栈和 mosquitto 服务(见标签)。
curl -u "${RANCHER_ACCESS_KEY}:${RANCHER_SECRET_KEY}" \
-X POST \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"count":1, "imageUuid":"docker:dummy/atlas/mosquitto:0.0.8", "name":"atlas-mosquitto_mosquitto_dummy_name", "startOnCreate":true, "labels": {"io.rancher.service.deployment.unit": "acdaf002-e1d0-4625-ba9c-3e1dbc584a14", "io.rancher.project.name": "atlas-mosquitto", "io.rancher.container.pull_image": "always", "io.rancher.scheduler.affinity:container_label_soft_ne": "io.rancher.stack_service.name=atlas-mosquitto/mosquitto", "io.rancher.service.launch.config": "io.rancher.service.primary.launch.config", "io.rancher.project_service.name": "atlas-mosquitto/mosquitto", "io.rancher.stack.name": "atlas-mosquitto", "io.rancher.stack_service.name": "atlas-mosquitto/mosquitto"}, "publishAllPorts":false, "privileged":false, "stdinOpen":false, "tty":false, "readOnly":false' \
'https://rancher-ha.dummy.info/v1/projects/1a29/containers'
Run Code Online (Sandbox Code Playgroud)
下面是身体的漂亮印刷品,以便于阅读:
{
"count": 1,
"imageUuid": "docker:dummy\/atlas\/mosquitto:0.0.8",
"name": "atlas-mosquitto_mosquitto_dummy_name",
"startOnCreate": true,
"labels": {
"io.rancher.service.deployment.unit": "acdaf002-e1d0-4625-ba9c-3e1dbc584a14",
"io.rancher.project.name": "atlas-mosquitto",
"io.rancher.container.pull_image": "always",
"io.rancher.scheduler.affinity:container_label_soft_ne": "io.rancher.stack_service.name=atlas-mosquitto\/mosquitto",
"io.rancher.service.launch.config": "io.rancher.service.primary.launch.config",
"io.rancher.project_service.name": "atlas-mosquitto\/mosquitto", …Run Code Online (Sandbox Code Playgroud) 我在具有多个 NIC 接口/IP 地址的 RancherOS 主机上试验 Rancher Server:
现在我想创建一个 Kubernetes 入口,它在eth1地址上公开端口,但似乎 Rancher 的 Kubernetes 入口控制器只能在 Rancher 代理 IP 上发布,因为端口只能通过eth0 IP 地址访问。
是否有任何kubernetes入口注释(如http.port,如下解释:http://rancher.com/docs/rancher/latest/en/kubernetes/ingress/#scale-and-other-port),它可以用来告诉Ingress Controller Ingress应该使用哪个IP/接口??
在 Rancher 中使用 Amazon EKS 创建的集群。
MongoDB 副本集是作为 Rancher 中的目录应用程序创建的。
集群中的服务可以通过这个连接字符串成功连接数据库。
mongodb://mongodb-replicaset.mongodb-replicaset.svc.cluster.local:27017/tradeit_system?replicaSet=rs
我想查看和编辑数据库中的数据。在本地数据库中,您可以通过命令轻松完成mongo --port 27017。
同样有一种方法可以连接到 kubernetes 上的那个。是从终端还是使用像 Robo 3t 这样的应用程序?
编辑
当我这样做时,副本集不显示。
kubectl get deployments --all-namespace
kubectl get pods --all-namespaces
显示它在 3 个 pod 中运行:mongodb-replicaset-0、mongodb-replicaset-1、mongodb-replicaset-2。
我尝试,我尝试,但 Rancher 2.1 无法部署“ mongo-replicaset ”目录应用程序,并配置了本地持久卷。
如何使用本地存储卷正确部署 mongo-replicaset?由于我是 Rancher 2 的新手,因此任何调试技术都值得赞赏。
我遵循下面的 4 个 ABCD 步骤,但第一个 pod 部署永远不会结束。它有什么问题?日志和结果屏幕在最后。详细配置可以在这里找到。
注意:没有本地持久卷的部署成功。
注意:使用本地持久卷和“mongo”映像部署成功(没有副本集版本)。
注意:同时使用 mongo-replicaset 和本地持久卷的部署失败。
步骤 A - 集群
创建一个牧场主实例,然后:
步骤 B - 存储类
使用以下参数创建存储类:
步骤 C - 持久卷
添加 3 个持久卷,如下所示:
步骤 D - Mongo-replicaset 部署
从目录中,选择 Mongo-replicaset 并像这样配置它:
结果 …
mongodb kubernetes rancher persistent-volumes kubernetes-pod
我们使用 Jenkins 来构建 Docker 镜像,直到上周,当我每次尝试在 Jenkins 中构建镜像时,它都会失败,并显示“来自守护进程的错误响应:处理 tar 文件时出错(退出状态 1):写入 /app/node_modules/ acorn/dist/acorn_loose.es.js:设备上没有剩余空间”(它失败的文件可能取决于项目)。如果我尝试在服务器中使用 Docker 但在 Jenkins 上失败,则将构建映像。
我曾尝试删除旧容器和图像等,但无济于事。磁盘空间和 inode 似乎没问题,所以我不确定现在该尝试什么。任何帮助表示赞赏。
“码头信息”的结果:
Containers: 55
Running: 48
Paused: 0
Stopped: 7
Images: 59
Server Version: 17.03.2-ce
Storage Driver: overlay
Backing Filesystem: extfs
Supports d_type: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 4ab9917febca54791c5f071a9d1f404867857fcc
runc version: 54296cf40ad8143b62dbcaa1d90e520a2136ddfe
init version: 949e6fa
Security Options:
seccomp
Profile: …Run Code Online (Sandbox Code Playgroud) 我目前使用 Docker 19.03 和 Kubernetes 1.13.5 以及 Rancher 2.2.4。从 19.03 开始,Docker 已经通过传递--gpus选项正式支持原生 NVIDIA GPU 。示例(来自NVIDIA/nvidia-docker github):
docker run --gpus all nvidia/cuda nvidia-smi
Run Code Online (Sandbox Code Playgroud)
但是在 Kubernetes 中,没有选项可以传递 Docker CLI 选项。所以如果我需要运行一个GPU实例,我必须安装nvidia-docker2,使用起来不方便。
无论如何,是否可以在不安装的情况下传递 Docker CLI 选项或传递 NVIDIA 运行时 nvidia-docker2
我将 rancher 从 v2.2.8 升级到 v2.3 后遇到了这个问题。集群使用rke v0.3.0部署。我遇到的第一个问题是Readiness probe failed: HTTP probe failed with statuscode: 503下面的日志,有一个问题https://github.com/rancher/rancher/issues/23430
kube-system Warning Unhealthy canal-s6nwj Readiness probe failed: HTTP probe failed with statuscode: 503 31 minutes ago
kube-system Warning Unhealthy canal-s8q9c Readiness probe failed: HTTP probe failed with statuscode: 503 35 minutes ago
kube-system Warning Unhealthy canal-z4h9h Readiness probe failed: HTTP probe failed with statuscode: 503 35 minutes ago
kube-system Warning Unhealthy canal-55f6l Readiness probe failed: HTTP probe failed with statuscode: 503 …Run Code Online (Sandbox Code Playgroud) 每当我使用 RKE 设置 Rancher Kubernetes 集群时,该集群就会完美设置。但是,我收到以下警告消息:
WARN[0011] [reconcile] host [host.example.com] is a control plane node without reachable Kubernetes API endpoint in the cluster
WARN[0011] [reconcile] no control plane node with reachable Kubernetes API endpoint in the cluster found
Run Code Online (Sandbox Code Playgroud)
(在上面的消息中,host.example.com是我实际主机名的占位符,此消息是针对 cluster.yml 中指定的每个控制平面主机给出的)
如何修改 RKEcluster.yml文件或任何其他设置以避免此警告?
rancher ×10
kubernetes ×6
docker ×3
mongodb ×2
calico ×1
docker-swarm ×1
jenkins ×1
rancher-rke ×1
reconcile ×1
rest ×1
systemd ×1
vagrant ×1