From eb2ab36dc35d919da0a5bed258389135293a39ea Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 24 Sep 2025 20:01:10 -0300 Subject: [PATCH] Jugandoc on ceph --- .../storage/{ => cephfs}/filesystem.yaml | 0 .../storage/{ => cephfs}/storageclass.yaml | 4 +- .../storage/{ => rbd}/blockstorage.yaml | 0 .../04-ceph/storage/rgw/bucket-claim.yaml | 7 +++ .../storage/rgw/bucket-external-access.yaml | 21 ++++++++ manifest/04-ceph/storage/rgw/bucket.yaml | 9 ++++ manifest/04-ceph/storage/rgw/ingress.yaml | 52 +++++++++++++++++++ manifest/04-ceph/storage/rgw/objectstore.yaml | 19 +++++++ .../06-external-ingress/sites/gametabs.yml | 22 ++++---- manifest/99-tubearchivist/storage.yml | 26 ++++++++++ 10 files changed, 147 insertions(+), 13 deletions(-) rename manifest/04-ceph/storage/{ => cephfs}/filesystem.yaml (100%) rename manifest/04-ceph/storage/{ => cephfs}/storageclass.yaml (97%) rename manifest/04-ceph/storage/{ => rbd}/blockstorage.yaml (100%) create mode 100644 manifest/04-ceph/storage/rgw/bucket-claim.yaml create mode 100644 manifest/04-ceph/storage/rgw/bucket-external-access.yaml create mode 100644 manifest/04-ceph/storage/rgw/bucket.yaml create mode 100644 manifest/04-ceph/storage/rgw/ingress.yaml create mode 100644 manifest/04-ceph/storage/rgw/objectstore.yaml create mode 100644 manifest/99-tubearchivist/storage.yml diff --git a/manifest/04-ceph/storage/filesystem.yaml b/manifest/04-ceph/storage/cephfs/filesystem.yaml similarity index 100% rename from manifest/04-ceph/storage/filesystem.yaml rename to manifest/04-ceph/storage/cephfs/filesystem.yaml diff --git a/manifest/04-ceph/storage/storageclass.yaml b/manifest/04-ceph/storage/cephfs/storageclass.yaml similarity index 97% rename from manifest/04-ceph/storage/storageclass.yaml rename to manifest/04-ceph/storage/cephfs/storageclass.yaml index c347e88..84aa6d9 100644 --- a/manifest/04-ceph/storage/storageclass.yaml +++ b/manifest/04-ceph/storage/cephfs/storageclass.yaml @@ -40,5 +40,5 @@ parameters: reclaimPolicy: Delete allowVolumeExpansion: true mountOptions: - # uncomment the following line for debugging - #- debug \ No newline at end of file +# uncomment the following line for debugging +#- debug \ No newline at end of file diff --git a/manifest/04-ceph/storage/blockstorage.yaml b/manifest/04-ceph/storage/rbd/blockstorage.yaml similarity index 100% rename from manifest/04-ceph/storage/blockstorage.yaml rename to manifest/04-ceph/storage/rbd/blockstorage.yaml diff --git a/manifest/04-ceph/storage/rgw/bucket-claim.yaml b/manifest/04-ceph/storage/rgw/bucket-claim.yaml new file mode 100644 index 0000000..ada01c2 --- /dev/null +++ b/manifest/04-ceph/storage/rgw/bucket-claim.yaml @@ -0,0 +1,7 @@ +apiVersion: objectbucket.io/v1alpha1 +kind: ObjectBucketClaim +metadata: + name: ceph-bucket +spec: + generateBucketName: ceph-bkt + storageClassName: rook-ceph-bucket \ No newline at end of file diff --git a/manifest/04-ceph/storage/rgw/bucket-external-access.yaml b/manifest/04-ceph/storage/rgw/bucket-external-access.yaml new file mode 100644 index 0000000..b37cf56 --- /dev/null +++ b/manifest/04-ceph/storage/rgw/bucket-external-access.yaml @@ -0,0 +1,21 @@ +apiVersion: v1 +kind: Service +metadata: + name: rook-ceph-rgw-my-store-external + namespace: rook-ceph + labels: + app: rook-ceph-rgw + rook_cluster: rook-ceph + rook_object_store: my-store +spec: + ports: + - name: rgw + port: 80 + protocol: TCP + targetPort: 80 + selector: + app: rook-ceph-rgw + rook_cluster: rook-ceph + rook_object_store: my-store + sessionAffinity: None + type: NodePort diff --git a/manifest/04-ceph/storage/rgw/bucket.yaml b/manifest/04-ceph/storage/rgw/bucket.yaml new file mode 100644 index 0000000..08be123 --- /dev/null +++ b/manifest/04-ceph/storage/rgw/bucket.yaml @@ -0,0 +1,9 @@ +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: rook-ceph-bucket +provisioner: rook-ceph.ceph.rook.io/bucket +reclaimPolicy: Delete +parameters: + objectStoreName: my-store + objectStoreNamespace: rook-ceph diff --git a/manifest/04-ceph/storage/rgw/ingress.yaml b/manifest/04-ceph/storage/rgw/ingress.yaml new file mode 100644 index 0000000..6785252 --- /dev/null +++ b/manifest/04-ceph/storage/rgw/ingress.yaml @@ -0,0 +1,52 @@ +apiVersion: traefik.io/v1alpha1 +kind: Middleware +metadata: + name: cors + namespace: rook-ceph +spec: + headers: + accessControlAllowMethods: + - "GET" + - "POST" + - "OPTIONS" + - "PUT" + accessControlAllowHeaders: + - "*" + accessControlAllowOriginList: + - "*" +--- +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: talos-s3-certificate + namespace: rook-ceph +spec: + secretName: talos-s3-skrd-fun-tls + dnsNames: + - "talos-s3.skrd.fun" + issuerRef: + name: letsencrypt-prod + kind: ClusterIssuer +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: bucket-access + namespace: rook-ceph + annotations: + traefik.ingress.kubernetes.io/router.middlewares: default-redirect-https@kubernetescrd, rook-ceph-cors@kubernetescrd +spec: + ingressClassName: traefik + rules: + - host: talos-s3.skrd.fun + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: rook-ceph-rgw-my-store + port: + number: 80 + tls: + - secretName: talos-s3-skrd-fun-tls \ No newline at end of file diff --git a/manifest/04-ceph/storage/rgw/objectstore.yaml b/manifest/04-ceph/storage/rgw/objectstore.yaml new file mode 100644 index 0000000..f455ab3 --- /dev/null +++ b/manifest/04-ceph/storage/rgw/objectstore.yaml @@ -0,0 +1,19 @@ +apiVersion: ceph.rook.io/v1 +kind: CephObjectStore +metadata: + name: my-store + namespace: rook-ceph +spec: + metadataPool: + failureDomain: host + replicated: + size: 3 + dataPool: + failureDomain: host + erasureCoded: + dataChunks: 2 + codingChunks: 1 + preservePoolsOnDelete: true + gateway: + port: 80 + instances: 1 diff --git a/manifest/06-external-ingress/sites/gametabs.yml b/manifest/06-external-ingress/sites/gametabs.yml index fe6ea36..7753a12 100644 --- a/manifest/06-external-ingress/sites/gametabs.yml +++ b/manifest/06-external-ingress/sites/gametabs.yml @@ -32,15 +32,15 @@ metadata: spec: ingressClassName: traefik rules: - - host: gametabs.skrd.fun - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: gametabs - port: - number: 80 + - host: gametabs.skrd.fun + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: gametabs + port: + number: 80 tls: - - secretName: gametabs-skrd-fun-tls \ No newline at end of file + - secretName: gametabs-skrd-fun-tls \ No newline at end of file diff --git a/manifest/99-tubearchivist/storage.yml b/manifest/99-tubearchivist/storage.yml new file mode 100644 index 0000000..19256ac --- /dev/null +++ b/manifest/99-tubearchivist/storage.yml @@ -0,0 +1,26 @@ +apiVersion: v1 +kind: Pod +metadata: + name: ubuntu + labels: + app: ubuntu +spec: + containers: + - image: ubuntu + command: + - "sleep" + - "604800" + imagePullPolicy: IfNotPresent + name: ubuntu + volumeMounts: + - mountPath: /my-nfs-data + name: test-volume + restartPolicy: Always + volumes: + - name: test-volume + nfs: + server: 192.168.1.102 + path: /1582b800/docker/tubearchivist + readOnly: true + mountOptions: + - nfsvers=4.1