【Rancher相关问题】Rancher 2.5.8 及以下版本,提示Alert: Component controller-manager,scheduler is unhealthy.

问题描述

如图,Rancher2.5.8版本提示 controller-manager,scheduler 不健康,管理的k8s集群版本1.21.1

解决方法

在Master节点执行如下命令:

sed -i 's|- --port=0|#- --port=0|' /etc/kubernetes/manifests/kube-scheduler.yaml
sed -i 's|- --port=0|#- --port=0|' /etc/kubernetes/manifests/kube-controller-manager.yaml

systemctl restart kubelet

重启kubelet之后问题解决。

试解释原因

高版本Kubernetes将控制面的非安全的端口标注废弃,

这并不是最佳实践,因为后续k8s会移除此接口,需要等待Rancher官方调整UI的接口调用了。

解决方法参考自GitHub官方ISSUE列表#29427

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
以下是一个示例的 `Dockerfile` 和 `.rancher-pipeline.yml` 文件,用于将 Python 应用程序打包成 API 并在 Rancher 上部署: Dockerfile: ``` FROM python:3.8-slim-buster # Set the working directory WORKDIR /app # Install dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy the application code COPY app.py . # Expose the port EXPOSE 5000 # Start the application CMD [ "python", "app.py" ] ``` .rancher-pipeline.yml: ``` version: 2 # Define the pipeline pipelines: default: # Define the build step build: # Use the Dockerfile to build the image image: dockerfile:1.1.1 dockerfilePath: Dockerfile # Push the image to the Docker registry push: true registry: <your-registry> repository: <your-repository> tag: latest # Define the deploy step deploy: # Use the Rancher provider to deploy the image provider: rancher2 # Specify the Rancher API URL and access key apiURL: https://<your-rancher-url>/v3 accessKey: <your-access-key> secretKey: <your-secret-key> # Specify the Rancher project and namespace projectID: <your-project-id> namespace: <your-namespace> # Specify the Docker image to deploy image: <your-registry>/<your-repository>:latest # Specify the number of replicas to run replicas: 1 # Specify the service name and port serviceName: <your-service-name> servicePort: 5000 ``` 要使用这些文件,请按照以下步骤进行操作: 1. 创建一个名为 `Dockerfile` 的文件,并将上述 Dockerfile 代码复制到其中。 2. 创建一个名为 `requirements.txt` 的文件,并将 Python 应用程序的依赖项列在其中。 3. 创建一个名为 `app.py` 的文件,并将 Python 应用程序的代码复制到其中。 4. 创建一个名为 `.rancher-pipeline.yml` 的文件,并将上述 .rancher-pipeline.yml 代码复制到其中。 5. 将 `<your-registry>`、`<your-repository>`、`<your-rancher-url>`、`<your-access-key>`、`<your-secret-key>`、`<your-project-id>`、`<your-namespace>` 和 `<your-service-name>` 替换为实际值。 6. 将这些文件添加到 Git 存储库中,并在 Rancher 上设置 CI/CD 管道以使用这些文件构建和部署应用程序。 注意:这些文件只是示例,并且可能需要根据您的实际需求进行修改。请参考 Rancher 和 Docker 文档以了解有关如何使用这些工具的更多信息。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

东北小狐狸-Hellxz

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值