Skip to content

Instantly share code, notes, and snippets.

@steebchen
Last active February 24, 2019 01:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steebchen/b2dd5de3403b9d2634455f2541628fb5 to your computer and use it in GitHub Desktop.
Save steebchen/b2dd5de3403b9d2634455f2541628fb5 to your computer and use it in GitHub Desktop.
Set up ceph with kubernetes
# Requirements: an existing and running k8s cluster
curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
helm init
# taken from http://docs.ceph.com/docs/master/start/kube-helm/
helm serve &
# wait for helm serve to be ready
sleep 5
helm repo add local http://localhost:8879/charts
git clone https://github.com/ceph/ceph-helm
cd ceph-helm/ceph
sudo apt install -y make
make
# Now configure your ~/ceph-overrides.yaml!
network:
public: xxx.xxx.0.0/16
cluster: xxx.xxx.0.0/16
osd_devices:
- name: dev-sda
device: /dev/sda
zap: "1"
storageclass:
name: ceph-rbd
pool: rbd
user_id: k8s
# make sure you put your ceph overrides in ~/ceph-overrides.yaml!
kubectl create namespace ceph
kubectl create -f ~/ceph-helm/ceph/rbac.yaml
# adapt your node names! (ceph-1 etc.)
kubectl label node ceph-1 ceph-mon=enabled ceph-mgr=enabled
kubectl label node ceph-2 ceph-mon=enabled ceph-mgr=enabled
kubectl label node ceph-3 ceph-mon=enabled ceph-mgr=enabled
# adapt your OSDs
# tags are automatically created from your ceph-overrides
kubectl label node ceph-1 ceph-osd=enabled ceph-osd-device-dev-sda=enabled
kubectl label node ceph-2 ceph-osd=enabled ceph-osd-device-dev-sda=enabled
kubectl label node ceph-3 ceph-osd=enabled ceph-osd-device-dev-sda=enabled
# finally
helm install --name=ceph local/ceph --namespace=ceph -f ~/ceph-overrides.yaml
# check if the pods are running (this can take multiple minutes tho)
kubectl -n ceph get pods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment