简体   繁体   English

如何在 kubernetes 集群上安装 Ceph

[英]How install Ceph on a kubernetes cluster

we want to use Ceph but we want to use Docker and Kubernetes to deploy new instances of Ceph quickly.我们想使用Ceph ,但我们想使用 Docker 和 Kubernetes 来快速部署新的Ceph实例。

I tried to use the default ceph docker hub: ceph/daemon-base .我尝试使用默认的 ceph docker 集线器: ceph /daemon-base But I didn't work.但我没有工作。

I tried to use the ceph-container .我尝试使用ceph-container Seems like it doesn't work.好像行不通。

This is my last deployment file:这是我的最后一个部署文件:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: ceph3-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: ceph3
  template:
    metadata:
      labels:
        app: ceph3
    spec:
      containers:
        - name: ceph
          image: ceph/daemon-base:v3.0.5-stable-3.0-luminous-centos-7
          resources:
            limits:
              memory: 512Mi
              cpu: "500m"
            requests:
              memory: 256Mi
              cpu: "250m"
          volumeMounts:
            - mountPath: /etc/ceph
              name: etc-ceph
            - mountPath: /var/lib/ceph
              name: lib-ceph
      volumes:
        - name: etc-ceph
          hostPath:
            path: /etc/ceph
        - name: lib-ceph
          hostPath:
            path: /var/lib/ceph

Does someone already install a ceph instance on Kubernetes?有人已经在 Kubernetes 上安装了 ceph 实例吗?

I tried to follow the tutorial here我试着按照这里的教程

But pods not working:但豆荚不工作:

pod/ceph-mds-7b49574f48-vhvtl         0/1     Pending            0          81s
pod/ceph-mon-75c49c4fd5-2cq2r         0/1     CrashLoopBackOff   3          81s
pod/ceph-mon-75c49c4fd5-6nprj         0/1     Pending            0          81s
pod/ceph-mon-75c49c4fd5-7vrp8         0/1     Pending            0          81s
pod/ceph-mon-check-5df985478b-d87rs   1/1     Running            0          81s

The common practice for deploying stateful systems on Kubernetes is to use an Operator to manage and codify the lifecycle management of the application.在 Kubernetes 上部署有状态系统的常见做法是使用Operator来管理和编码应用程序的生命周期管理。 Rook is an operator that provides Ceph lifecycle management on Kubernetes clusters. Rook是在 Kubernetes 集群上提供 Ceph 生命周期管理的 Operator。

Documentation for using Rook to deploy Ceph clusters can be found at https://rook.io/docs/rook/v1.1/ceph-storage.html使用 Rook 部署 Ceph 集群的文档可以在https://rook.io/docs/rook/v1.1/ceph-storage.html找到

For a basic introduction, you can use the Rook Storage Quickstart guide有关基本介绍,您可以使用Rook Storage 快速入门指南

The core Ceph team is highly involved in working on Rook and with the Rook community, and Rook is widely deployed within the Kubernetes community for distributed storage applications, and the Ceph Days event now has added Rook] explicitly to become Ceph + Rook Days Ceph 核心团队高度参与 Rook 和 Rook 社区的工作,Rook 在 Kubernetes 社区中广泛部署用于分布式存储应用程序,Ceph Days 活动现在已明确添加 Rook] 成为Ceph + Rook Days

Error from server (Forbidden): pods is forbidden: User "system:serviceaccount:ceph:default" cannot list resource "pods" in API group "" in the namespace "ceph".来自服务器的错误(禁止):pod 被禁止:用户“system:serviceaccount:ceph:default”无法在命名空间“ceph”中的 API 组“”中列出资源“pod”。

This error means Your default user doesn't have an access to resources in default namespace, look into documentation how to deal with rbac and how to grant user accesses.此错误意味着您的默认用户无权访问默认命名空间中的资源,请查看文档如何处理 rbac 以及如何授予用户访问权限。 There is the same error on github . github上也有同样的错误。

Install Ceph安装 Ceph

To install ceph I would recommend You to use helm要安装 ceph,我建议您使用helm

Install helm安装 helm

There are few ways to install helm, You can find them there .安装 helm 的方法很少,你可以在那里找到它们。

Personally i am using helm github releases to download latest version.我个人使用helm github 版本下载最新版本。 When answering this question latest release was 2.15.0.回答这个问题时,最新版本是 2.15.0。 That's how You can install it.这就是您可以安装它的方式。

1.Download helm ( If you want to install current version of helm, check above helm github releases link, there might be a new version of it. Everything you need to do then is change v2.15.0 in wget and tar command to new, for example v2.16.0 ) 1.下载helm(如果要安装当前版本的helm,请查看上面的helm github发布链接,可能会有新版本。然后您需要做的就是将wget和tar命令中的v2.15.0更改为new,例如 v2.16.0 )

wget https://get.helm.sh/helm-v2.15.0-linux-amd64.tar.gz

2.Unpack it 2.拆开包装

tar -zxvf helm-v2.15.0-linux-amd64.tar.gz

3.Find the helm binary in the unpacked directory, and move it to its desired destination 3.在解压后的目录中找到 helm 二进制文件,并将其移动到所需的目的地

mv linux-amd64/helm /usr/local/bin/helm

4.Install tiller 4.安装分蘖

The easiest way to install tiller into the cluster is simply to run helm init .将 tiller 安装到集群中最简单的方法就是运行helm init This will validate that helm's local environment is set up correctly (and set it up if necessary).这将验证 helm 的本地环境是否设置正确(并在必要时进行设置)。 Then it will connect to whatever cluster kubectl connects to by default (kubectl config view).然后它将连接到默认情况下 kubectl 连接的任何集群(kubectl 配置视图)。 Once it connects, it will install tiller into the kube-system namespace.连接后,它将把 tiller 安装到 kube-system 命名空间中。

And then follow official documentation to install Ceph .然后按照官方文档安装Ceph

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Rancher集群上安装kubernetes集群? - How to install kubernetes cluster on Rancher cluster? csi-cephfs:如何从 kubernetes 获取 ceph 存储集群可用容量 - csi-cephfs: how can I get ceph storage cluster available capacity from kubernetes 如何使用 Terraform 在 Kubernetes 集群中安装 AGIC - How to install AGIC in Kubernetes cluster using Terraform 如何在 AKS 群集中安装 Kubernetes PKI 证书 - How to install Kubernetes PKI certificates in AKS cluster 如何在本地kubernetes集群上安装Spinnaker - How to install spinnaker on local kubernetes cluster 如何为elasticsearch kubernetes集群安装插件 - How to install a plugin for the elasticsearch kubernetes cluster 在 kubernetes 集群中安装 rook-ceph 后显示 OSD 0 - Showing OSD 0 after installing rook-ceph in kubernetes cluster 无法在Kubernetes集群中安装Istio - Cannot install Istio in Kubernetes cluster 如何在我的 jelastic kubernetes 集群上安装letsencrypt? - How do I install letsencrypt on my jelastic kubernetes cluster? 如何为在 Azure 上的 Kubernetes 集群中运行的 Grafana 安装自定义插件 - How to install custom plugin for Grafana running in Kubernetes cluster on Azure
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM