cluster

Infrastructure files for Nordgedanken and Midnightthoughts.
git clone git://archive.git.mtrnord.blog/MTRNord/cluster.git
Log | Files | Refs | README

commit 48767fb5e4cffd275a6135a6a589f13301182037
parent 1a659f6194a74e662c511a1ba70c93cf84c7f8e2
Author: MTRNord <mtrnord1@gmail.com>
Date:   Wed, 28 Jun 2023 23:25:29 +0200

Block storage

Diffstat:
Mapps/base/rook/filesystem.yaml | 141+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------
1 file changed, 106 insertions(+), 35 deletions(-)

diff --git a/apps/base/rook/filesystem.yaml b/apps/base/rook/filesystem.yaml @@ -90,15 +90,15 @@ spec: # enable the Multus network provider #provider: multus #selectors: - # The selector keys are required to be `public` and `cluster`. - # Based on the configuration, the operator will do the following: - # 1. if only the `public` selector key is specified both public_network and cluster_network Ceph settings will listen on that interface - # 2. if both `public` and `cluster` selector keys are specified the first one will point to 'public_network' flag and the second one to 'cluster_network' - # - # In order to work, each selector value must match a NetworkAttachmentDefinition object in Multus - # - #public: public-conf --> NetworkAttachmentDefinition object name in Multus - #cluster: cluster-conf --> NetworkAttachmentDefinition object name in Multus + # The selector keys are required to be `public` and `cluster`. + # Based on the configuration, the operator will do the following: + # 1. if only the `public` selector key is specified both public_network and cluster_network Ceph settings will listen on that interface + # 2. if both `public` and `cluster` selector keys are specified the first one will point to 'public_network' flag and the second one to 'cluster_network' + # + # In order to work, each selector value must match a NetworkAttachmentDefinition object in Multus + # + #public: public-conf --> NetworkAttachmentDefinition object name in Multus + #cluster: cluster-conf --> NetworkAttachmentDefinition object name in Multus # Provide internet protocol version. IPv6, IPv4 or empty string are valid options. Empty string would mean IPv4 #ipFamily: "IPv6" # Ceph daemons to listen on both IPv4 and Ipv6 networks @@ -159,7 +159,6 @@ spec: value: "arm64" effect: "NoSchedule" - # nodeAffinity: # requiredDuringSchedulingIgnoredDuringExecution: # nodeSelectorTerms: @@ -208,7 +207,7 @@ spec: # monitoring: # crashcollector: resources: - #The requests and limits set here, allow the mgr pod to use half of one CPU core and 1 gigabyte of memory + #The requests and limits set here, allow the mgr pod to use half of one CPU core and 1 gigabyte of memory mgr: limits: cpu: "1000m" @@ -216,7 +215,7 @@ spec: requests: cpu: "0m" memory: "512Mi" - # The above example requests/limits can also be added to the other components + # The above example requests/limits can also be added to the other components mon: limits: cpu: "2000m" @@ -231,7 +230,7 @@ spec: requests: cpu: "0m" memory: "2Gi" - # For OSD it also is a possible to specify requests/limits based on device class + # For OSD it also is a possible to specify requests/limits based on device class osd-hdd: limits: cpu: "500m" @@ -298,12 +297,12 @@ spec: useAllDevices: false #deviceFilter: #config: {} - # crushRoot: "custom-root" # specify a non-default root label for the CRUSH map - # metadataDevice: "md0" # specify a non-rotational storage so ceph-volume will use it as block db device of bluestore. - # databaseSizeMB: "1024" # uncomment if the disks are smaller than 100 GB - # journalSizeMB: "1024" # uncomment if the disks are 20 GB or smaller - # osdsPerDevice: "1" # this value can be overridden at the node or device level - # encryptedDevice: "true" # the default value for this option is "false" + # crushRoot: "custom-root" # specify a non-default root label for the CRUSH map + # metadataDevice: "md0" # specify a non-rotational storage so ceph-volume will use it as block db device of bluestore. + # databaseSizeMB: "1024" # uncomment if the disks are smaller than 100 GB + # journalSizeMB: "1024" # uncomment if the disks are 20 GB or smaller + # osdsPerDevice: "1" # this value can be overridden at the node or device level + # encryptedDevice: "true" # the default value for this option is "false" # Individual nodes and their config can be specified as well, but 'useAllNodes' above must be set to false. Then, only the named # nodes below will be used as storage resources. Each node's 'name' field should match their 'kubernetes.io/hostname' label. nodes: @@ -494,7 +493,7 @@ spec: # labels: # key: value resources: - # The requests and limits set here, allow the filesystem MDS Pod(s) to use half of one CPU core and 1 gigabyte of memory + # The requests and limits set here, allow the filesystem MDS Pod(s) to use half of one CPU core and 1 gigabyte of memory limits: cpu: "500m" memory: "1024Mi" @@ -543,10 +542,83 @@ parameters: # mounter: kernel reclaimPolicy: Retain allowVolumeExpansion: true -mountOptions: [] +mountOptions: + [] # uncomment the following line for debugging #- debug --- +apiVersion: ceph.rook.io/v1 +kind: CephBlockPool +metadata: + name: postgres-fs + namespace: rook-ceph +spec: + failureDomain: host + replicated: + size: 3 +--- +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: postgres-fs-block +# Change "rook-ceph" provisioner prefix to match the operator namespace if needed +provisioner: rook-ceph.rbd.csi.ceph.com +parameters: + # clusterID is the namespace where the rook cluster is running + clusterID: rook-ceph + # Ceph pool into which the RBD image shall be created + pool: postgres-fs + + # (optional) mapOptions is a comma-separated list of map options. + # For krbd options refer + # https://docs.ceph.com/docs/master/man/8/rbd/#kernel-rbd-krbd-options + # For nbd options refer + # https://docs.ceph.com/docs/master/man/8/rbd-nbd/#options + # mapOptions: lock_on_read,queue_depth=1024 + + # (optional) unmapOptions is a comma-separated list of unmap options. + # For krbd options refer + # https://docs.ceph.com/docs/master/man/8/rbd/#kernel-rbd-krbd-options + # For nbd options refer + # https://docs.ceph.com/docs/master/man/8/rbd-nbd/#options + # unmapOptions: force + + # RBD image format. Defaults to "2". + imageFormat: "2" + + # RBD image features + # Available for imageFormat: "2". Older releases of CSI RBD + # support only the `layering` feature. The Linux kernel (KRBD) supports the + # full complement of features as of 5.4 + # `layering` alone corresponds to Ceph's bitfield value of "2" ; + # `layering` + `fast-diff` + `object-map` + `deep-flatten` + `exclusive-lock` together + # correspond to Ceph's OR'd bitfield value of "63". Here we use + # a symbolic, comma-separated format: + # For 5.4 or later kernels: + #imageFeatures: layering,fast-diff,object-map,deep-flatten,exclusive-lock + # For 5.3 or earlier kernels: + imageFeatures: layering + + # The secrets contain Ceph admin credentials. + csi.storage.k8s.io/provisioner-secret-name: rook-csi-rbd-provisioner + csi.storage.k8s.io/provisioner-secret-namespace: rook-ceph + csi.storage.k8s.io/controller-expand-secret-name: rook-csi-rbd-provisioner + csi.storage.k8s.io/controller-expand-secret-namespace: rook-ceph + csi.storage.k8s.io/node-stage-secret-name: rook-csi-rbd-node + csi.storage.k8s.io/node-stage-secret-namespace: rook-ceph + + # Specify the filesystem type of the volume. If not specified, csi-provisioner + # will set default as `ext4`. Note that `xfs` is not recommended due to potential deadlock + # in hyperconverged settings where the volume is mounted on the same node as the osds. + csi.storage.k8s.io/fstype: ext4 + +# Delete the rbd volume when a PVC is deleted +reclaimPolicy: Delete + +# Optional, if you want to add dynamic resize for PVC. +# For now only ext3, ext4, xfs resize support provided, like in Kubernetes itself. +allowVolumeExpansion: true +--- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: @@ -557,18 +629,17 @@ metadata: cert-manager.io/cluster-issuer: letsencrypt-dns spec: tls: - - hosts: - - rook.ceph.midnightthoughts.space - secretName: rook.ceph.midnightthoughts.space-tls + - hosts: + - rook.ceph.midnightthoughts.space + secretName: rook.ceph.midnightthoughts.space-tls rules: - - host: rook.ceph.midnightthoughts.space - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: rook-ceph-mgr-dashboard - port: - name: http-dashboard - + - host: rook.ceph.midnightthoughts.space + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: rook-ceph-mgr-dashboard + port: + name: http-dashboard