| # Deploy Rook/Ceph Operator |
| |
| local kube = import "../../../kube/kube.libsonnet"; |
| |
| { |
| Environment: { |
| local env = self, |
| local cfg = env.cfg, |
| cfg:: { |
| image: "rook/ceph:master", |
| namespace: "rook-ceph-system", |
| }, |
| |
| metadata:: { |
| namespace: cfg.namespace, |
| labels: { |
| "operator": "rook", |
| "storage-backend": "ceph", |
| }, |
| }, |
| |
| namespace: kube.Namespace(cfg.namespace), |
| |
| crds: { |
| cephclusters: kube.CustomResourceDefinition("ceph.rook.io", "v1", "CephCluster") { |
| spec+: { |
| additionalPrinterColumns: [ |
| { name: "DataDirHostPath", type: "string", description: "Directory used on the K8s nodes", JSONPath: ".spec.dataDirHostPath" }, |
| { name: "MonCount", type: "string", description: "Number of MONs", JSONPath: ".spec.mon.count" }, |
| { name: "Age", type: "date", JSONPath: ".metadata.creationTimestamp" }, |
| { name: "State", type: "string", description: "Current State", JSONPath: ".status.state" }, |
| ], |
| validation: { |
| # Converted from official operator YAML |
| "openAPIV3Schema": { |
| "properties": { |
| "spec": { |
| "properties": { |
| "cephVersion": { |
| "properties": { |
| "allowUnsupported": { |
| "type": "boolean" |
| }, |
| "image": { |
| "type": "string" |
| }, |
| "name": { |
| "pattern": "^(luminous|mimic|nautilus)$", |
| "type": "string" |
| } |
| } |
| }, |
| "dashboard": { |
| "properties": { |
| "enabled": { |
| "type": "boolean" |
| }, |
| "urlPrefix": { |
| "type": "string" |
| }, |
| "port": { |
| "type": "integer" |
| } |
| } |
| }, |
| "dataDirHostPath": { |
| "pattern": "^/(\\S+)", |
| "type": "string" |
| }, |
| "mon": { |
| "properties": { |
| "allowMultiplePerNode": { |
| "type": "boolean" |
| }, |
| "count": { |
| "maximum": 9, |
| "minimum": 1, |
| "type": "integer" |
| }, |
| "preferredCount": { |
| "maximum": 9, |
| "minimum": 0, |
| "type": "integer" |
| } |
| }, |
| "required": [ |
| "count" |
| ] |
| }, |
| "network": { |
| "properties": { |
| "hostNetwork": { |
| "type": "boolean" |
| } |
| } |
| }, |
| "storage": { |
| "properties": { |
| "nodes": { |
| "items": {}, |
| "type": "array" |
| }, |
| "useAllDevices": {}, |
| "useAllNodes": { |
| "type": "boolean" |
| } |
| } |
| } |
| }, |
| "required": [ |
| "mon" |
| ] |
| } |
| } |
| } |
| } |
| }, |
| }, |
| cephfilesystems: kube.CustomResourceDefinition("ceph.rook.io", "v1", "CephFilesystem") { |
| spec+: { |
| additionalPrinterColumns: [ |
| { name: "MdsCount", type: "string", description: "Number of MDs", JSONPath: ".spec.metadataServer.activeCount" }, |
| { name: "Age", type: "date", JSONPath: ".metadata.creationTimestamp" }, |
| ], |
| }, |
| }, |
| cephnfses: kube.CustomResourceDefinition("ceph.rook.io", "v1", "CephNFS") { |
| spec+: { |
| names+: { |
| shortNames: ["nfs"], |
| }, |
| }, |
| }, |
| cephobjectstores: kube.CustomResourceDefinition("ceph.rook.io", "v1", "CephObjectStore"), |
| cephobjectstoreusers: kube.CustomResourceDefinition("ceph.rook.io", "v1", "CephObjectStoreUser"), |
| cephblockpools: kube.CustomResourceDefinition("ceph.rook.io", "v1", "CephBlockPool"), |
| volumes: kube.CustomResourceDefinition("rook.io", "v1alpha2", "Volume") { |
| spec+: { |
| names+: { |
| shortNames: ["rv"], |
| }, |
| }, |
| }, |
| }, |
| |
| }, |
| } |