Last active
February 24, 2019 01:03
-
-
Save steebchen/b2dd5de3403b9d2634455f2541628fb5 to your computer and use it in GitHub Desktop.
Set up ceph with kubernetes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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