Skip to content

Commit

Permalink
Merge pull request #1 from projectsyn/initial-implementation
Browse files Browse the repository at this point in the history
Initial implementation
  • Loading branch information
simu authored Jul 5, 2021
2 parents da176d2 + 5220777 commit f54ef3c
Show file tree
Hide file tree
Showing 19 changed files with 1,558 additions and 14 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ JSONNETFMT_ARGS ?= --in-place --pad-arrays
JSONNET_IMAGE ?= docker.io/bitnami/jsonnet:latest
JSONNET_DOCKER ?= $(DOCKER_CMD) $(DOCKER_ARGS) --entrypoint=jsonnetfmt $(JSONNET_IMAGE)

YAML_FILES ?= $(shell find . -type f -not -path './vendor/*' \( -name '*.yaml' -or -name '*.yml' \))
YAML_FILES ?= $(shell find . -type f -not -regex './\(helmcharts\|manifests\|vendor\)/.*' \( -name '*.yaml' -or -name '*.yml' \))
YAMLLINT_ARGS ?= --no-warnings
YAMLLINT_CONFIG ?= .yamllint.yml
YAMLLINT_IMAGE ?= docker.io/cytopia/yamllint:latest
Expand All @@ -22,7 +22,8 @@ YAMLLINT_DOCKER ?= $(DOCKER_CMD) $(DOCKER_ARGS) $(YAMLLINT_IMAGE)
VALE_CMD ?= $(DOCKER_CMD) $(DOCKER_ARGS) --volume "$${PWD}"/docs/modules:/pages vshn/vale:2.1.1
VALE_ARGS ?= --minAlertLevel=error --config=/pages/ROOT/pages/.vale.ini /pages

ANTORA_PREVIEW_CMD ?= $(DOCKER_CMD) run --rm --publish 2020:2020 --volume "${PWD}":/antora vshn/antora-preview:2.3.3 --style=syn --antora=docs
ANTORA_PREVIEW_CMD ?= $(DOCKER_CMD) run --rm --publish 35729:35729 --publish 2020:2020 --volume "${PWD}":/preview/antora vshn/antora-preview:2.3.6 --style=syn --antora=docs


.PHONY: all
all: lint open
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Commodore Component: Rook Ceph

This is a [Commodore][commodore] Component for Rook Ceph.
This is a [Commodore][commodore] Component to manage the [Rook.io](https://rook.io) rook-ceph operator, Ceph cluster and CSI drivers.

This repository is part of Project Syn.
For documentation on Project Syn and this component, see https://syn.tools.
Expand Down
175 changes: 174 additions & 1 deletion class/defaults.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,177 @@
parameters:
rook_ceph:
=_metadata: {}
namespace: syn-rook-ceph
namespace: syn-rook-ceph-operator

ceph_cluster:
name: cluster
namespace: syn-rook-ceph-${rook_ceph:ceph_cluster:name}
node_count: 3
block_storage_class: localblock
# Configure volume size here, if block storage PVs are provisioned
# dynamically
block_volume_size: 1
# set to true if backing storage is SSD
tune_fast_device_class: false
# Rendered into rook-config-override CM
config_override:
osd:
# We explicitly set bluefs_buffered_io to false to get good write
# bandwidth on Exoscale -> TODO: needs to be checked per
# infrastructure, maybe move the config to cloud/exoscale/params.yml
bluefs_buffered_io: false

# Whether to setup RBD CSI driver and pools
rbd_enabled: true
# Whether to setup CephFS CSI driver and pools
cephfs_enabled: false

storage_pools:
rbd:
storagepool:
config:
failureDomain: host
replicated:
size: 3
requireSafeReplicaSize: true
storage_class_config:
parameters:
csi.storage.k8s.io/fstype: ext4
allowVolumeExpansion: true
cephfs:
fspool:
data_pools:
pool0:
failureDomain: host
replicated:
size: 3
requireSafeReplicaSize: true
parameters:
compression_mode: none
config:
metadataPool:
replicated:
size: 3
requireSafeReplicaSize: true
parameters:
compression_mode: none
# dataPools rendered from data_pools in Jsonnet
preserveFilesystemOnDelete: true
metadataServer:
activeCount: 1
activeStandby: true
# metadata server placement done in Jsonnet but can be
# extended here
mirroring:
enabled: false
storage_class_config:
allowVolumeExpansion: true


node_selector:
node-role.kubernetes.io/storage: ''

tolerations:
- key: storagenode
operator: Exists

images:
rook:
registry: docker.io
image: rook/ceph
tag: v1.6.6
ceph:
registry: docker.io
image: ceph/ceph
tag: v16.2.4
cephcsi:
registry: quay.io
image: cephcsi/cephcsi
tag: v3.3.1

charts:
rook-ceph: v1.6.6

operator_helm_values:
image:
repository: ${rook_ceph:images:rook:registry}/${rook_ceph:images:rook:image}
tag: ${rook_ceph:images:rook:tag}
nodeSelector: ${rook_ceph:node_selector}
resources:
limits:
cpu: 1000m
memory: 1Gi
requests:
cpu: 750m
memory: 512Mi
tolerations: ${rook_ceph:tolerations}
csi:
enableCSIHostNetwork: false
cephcsi:
image: ${rook_ceph:images:cephcsi:registry}/${rook_ceph:images:cephcsi:image}:${rook_ceph:images:cephcsi:tag}

toolbox:
enabled: true
image: ${rook_ceph:images:rook}

cephClusterSpec:
cephVersion:
image: ${rook_ceph:images:ceph:registry}/${rook_ceph:images:ceph:image}:${rook_ceph:images:ceph:tag}
allowUnsupported: false
dataDirHostPath: /var/lib/rook
monitoring:
enabled: true
rulesNamespace: ${rook_ceph:ceph_cluster:namespace}
mon:
count: 3
allowMultiplePerNode: false
network:
provider: host
placement:
all:
# nodeAffinity is injected in Jsonnet,
# taking placement labels from ${rook_ceph:node_selector}
tolerations: ${rook_ceph:tolerations}
resources:
mgr:
limits:
cpu: "1"
memory: 2Gi
requests:
cpu: "1"
memory: 2Gi
mon:
limits:
cpu: "1"
memory: 2Gi
requests:
cpu: "1"
memory: 2Gi
osd:
limits:
cpu: "6"
memory: 5Gi
requests:
cpu: "4"
memory: 5Gi
storage:
useAllNodes: false
useAllDevices: false
storageClassDeviceSets:
- name: ${rook_ceph:ceph_cluster:name}
count: ${rook_ceph:ceph_cluster:node_count}
volumeClaimTemplates:
- spec:
storageClassName: ${rook_ceph:ceph_cluster:block_storage_class}
volumeMode: Block
accessModes:
- ReadWriteOnce
resources:
requests:
storage: ${rook_ceph:ceph_cluster:block_volume_size}
encrypted: true
tuneFastDeviceClass: ${rook_ceph:ceph_cluster:tune_fast_device_class}

disruptionManagement:
managePodBudgets: true
osdMaintenanceTimeout: 30
34 changes: 33 additions & 1 deletion class/rook-ceph.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,44 @@
parameters:
kapitan:
dependencies:
- type: helm
source: https://charts.rook.io/release
chart_name: rook-ceph
version: ${rook_ceph:charts:rook-ceph}
output_path: dependencies/rook-ceph/helmcharts/rook-ceph/${rook_ceph:charts:rook-ceph}
- type: https
source: https://github.com/rook/rook/raw/${rook_ceph:images:rook:tag}/cluster/examples/kubernetes/ceph/csi/rbd/storageclass.yaml
output_path: dependencies/rook-ceph/manifests/${rook_ceph:images:rook:tag}/rbd-storageclass.yaml
- type: https
source: https://github.com/rook/rook/raw/${rook_ceph:images:rook:tag}/cluster/examples/kubernetes/ceph/csi/rbd/snapshotclass.yaml
output_path: dependencies/rook-ceph/manifests/${rook_ceph:images:rook:tag}/rbd-snapshotclass.yaml
- type: https
source: https://github.com/rook/rook/raw/${rook_ceph:images:rook:tag}/cluster/examples/kubernetes/ceph/csi/cephfs/storageclass.yaml
output_path: dependencies/rook-ceph/manifests/${rook_ceph:images:rook:tag}/cephfs-storageclass.yaml
- type: https
source: https://github.com/rook/rook/raw/${rook_ceph:images:rook:tag}/cluster/examples/kubernetes/ceph/csi/cephfs/snapshotclass.yaml
output_path: dependencies/rook-ceph/manifests/${rook_ceph:images:rook:tag}/cephfs-snapshotclass.yaml
compile:
- input_paths:
- rook-ceph/component/app.jsonnet
input_type: jsonnet
output_path: apps/
- input_paths:
- rook-ceph/helmcharts/rook-ceph/${rook_ceph:charts:rook-ceph}
input_type: helm
output_type: yaml
output_path: rook-ceph/01_rook_ceph_helmchart
helm_values: ${rook_ceph:operator_helm_values}
helm_params:
release_name: syn-rook-ceph
namespace: ${rook_ceph:namespace}
- input_paths:
- rook-ceph/component/main.jsonnet
input_type: jsonnet
output_path: rook-ceph/

commodore:
postprocess:
filters:
- type: jsonnet
path: rook-ceph/01_rook_ceph_helmchart/rook-ceph/templates/
filter: postprocess/patch_operator_deployment.jsonnet
Loading

0 comments on commit f54ef3c

Please sign in to comment.