Skip to content

Commit

Permalink
deploy rook-ceph
Browse files Browse the repository at this point in the history
  • Loading branch information
jgilfoil committed Feb 25, 2024
1 parent baf204e commit 8aa6041
Show file tree
Hide file tree
Showing 9 changed files with 331 additions and 0 deletions.
42 changes: 42 additions & 0 deletions kubernetes/apps/rook-ceph/app/helmrelease.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/helm.toolkit.fluxcd.io/helmrelease_v2beta2.json
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: rook-ceph-operator
spec:
interval: 30m
timeout: 15m
chart:
spec:
chart: rook-ceph
version: v1.13.3
sourceRef:
kind: HelmRepository
name: rook-ceph
namespace: flux-system
install:
remediation:
retries: 3
upgrade:
cleanupOnFail: true
remediation:
retries: 3
uninstall:
keepHistory: false
dependsOn:
- name: snapshot-controller
namespace: storage
values:
csi:
cephFSKernelMountOptions: ms_mode=prefer-crc
enableLiveness: true
serviceMonitor:
enabled: true
monitoring:
enabled: true
resources:
requests:
memory: 128Mi # unchangable
cpu: 100m # unchangable
limits: {}
7 changes: 7 additions & 0 deletions kubernetes/apps/rook-ceph/app/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./rook-ceph-dashboard-password.secret.sops.yaml
- ./helmrelease.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# yamllint disable
apiVersion: v1
kind: Secret
metadata:
name: rook-ceph-dashboard-password
stringData:
password: ENC[AES256_GCM,data:QXg+80UQp4OEg5lXyk6/cA==,iv:9N8bvoRJ8ANhaG8HQId9+sLcoL3r97FEToo/FZ6evIo=,tag:8xGrcYmfpOwMqstFdC+/Eg==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age12rzrdtn8xhd89y23qw4kymxftuylqn5cm522jcn327atent4a40swjcgmj
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBIWjliYXU5emg1TnI5SEcv
bjMxTlVVeURpeWV1Qys4V0w1RnNyMzFEL1JVClhiRXpVUjdjQTgzdkNqZ0V1MXkw
K3hQWm9Bb0dKWGtQTXFrNm5wSytIV1EKLS0tIC9IbXpoVFk4NWhrdXNiRFkvYm90
REJGSU5ONXJHWWNXbGE0Q21KdFpsbmcKAibEc4C50OtZiQkGEHEF+YJ9uzHmreFJ
VDsXzxStCsgBUSfG7QxRg2RSlHxsBhu/n27iB+Mcz0P7on5zlCBPXA==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-02-25T02:55:34Z"
mac: ENC[AES256_GCM,data:j+bE8tT8Kv7yJBE2zwxr8KU8V4gIf6M2Gh3ZfgAReikDGkJZfvXxueVW51h18GnbMUZ+UUiLXj1cPQHsFIkIUwyK7eMZ5Yd8Gtzg+9GALwoA2MK8n98vBmRb6RjO93UyJuMpTH1AgsEp/5Sqk7UVKxMf2SXcaJihjmaLopGkkmg=,iv:qQg2E49tuE2N0o3PC6J0I6xCoq7onfPDl46yclm7MvU=,tag:Uotdx2lqMxQ4rR2S4fS15w==,type:str]
pgp: []
encrypted_regex: ^(data|stringData)$
version: 3.8.1
137 changes: 137 additions & 0 deletions kubernetes/apps/rook-ceph/cluster/helmrelease.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
---
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/helm.toolkit.fluxcd.io/helmrelease_v2beta2.json
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: rook-ceph-cluster
spec:
interval: 30m
timeout: 15m
chart:
spec:
chart: rook-ceph-cluster
version: v1.13.3
sourceRef:
kind: HelmRepository
name: rook-ceph
namespace: flux-system
install:
remediation:
retries: 3
upgrade:
cleanupOnFail: true
remediation:
retries: 3
uninstall:
keepHistory: false
dependsOn:
- name: rook-ceph-operator
namespace: rook-ceph
- name: snapshot-controller
namespace: storage
values:
monitoring:
enabled: true
createPrometheusRules: true
ingress:
dashboard:
ingressClassName: internal
host:
name: &host rook.${SECRET_DOMAIN}
path: /
tls:
- hosts:
- *host
toolbox:
enabled: true
configOverride: |
[global]
bdev_enable_discard = true
bdev_async_discard = true
osd_class_update_on_start = false
cephClusterSpec:
network:
provider: host
connections:
requireMsgr2: true
crashCollector:
disable: false
dashboard:
enabled: true
urlPrefix: /
ssl: false
storage:
useAllNodes: false
useAllDevices: false
config:
osdsPerDevice: "1"
nodes:
- name: odroid-01
devices:
- name: /dev/sda
- name: odroid-02
devices:
- name: /dev/sda
- name: odroid-03
devices:
- name: /dev/sda
placement:
mgr: &placement
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/control-plane
operator: Exists
mon: *placement
resources:
mgr:
requests:
cpu: 500m
memory: 512Mi
limits:
cpu: 2000m
memory: 2Gi
mon:
requests:
cpu: 1000m
memory: 1Gi
limits:
cpu: 4000m
memory: 4Gi
osd:
requests:
cpu: 1000m
memory: 4Gi
limits:
cpu: 4000m
memory: 8Gi
cephBlockPools:
- name: ceph-blockpool
spec:
failureDomain: host
replicated:
size: 3
storageClass:
enabled: true
name: ceph-block
isDefault: true
reclaimPolicy: Delete
allowVolumeExpansion: true
parameters:
imageFormat: "2"
imageFeatures: layering
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
csi.storage.k8s.io/fstype: ext4
cephBlockPoolsVolumeSnapshotClass:
enabled: true
name: csi-ceph-blockpool
isDefault: false
deletionPolicy: Delete
cephFileSystems: []
cephFileSystemVolumeSnapshotClass: []
7 changes: 7 additions & 0 deletions kubernetes/apps/rook-ceph/cluster/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./helmrelease.yaml
# - ./rgw-external.yaml
53 changes: 53 additions & 0 deletions kubernetes/apps/rook-ceph/cluster/rgw-external.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/ceph.rook.io/cephobjectstoreuser_v1.json
apiVersion: ceph.rook.io/v1
kind: CephObjectStoreUser
metadata:
name: cluster-admin
spec:
# Ref: https://rook.io/docs/rook/v1.13/Storage-Configuration/Object-Storage-RGW/object-storage/
store: ceph-objectstore
displayName: Cluster Admin
---
apiVersion: v1
kind: Service
metadata:
name: rook-ceph-rgw-ceph-objectstore-external
namespace: rook-ceph
labels:
app: rook-ceph-rgw
rook_cluster: rook-ceph
rook_object_store: ceph-objectstore
spec:
type: NodePort
selector:
app: rook-ceph-rgw
rook_cluster: rook-ceph
rook_object_store: ceph-objectstore
ports:
- name: rgw
port: 80
protocol: TCP
targetPort: 80
sessionAffinity: None
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: rook-ceph-rgw
spec:
ingressClassName: internal
rules:
- host: &host rook-ceph-rgw.${SECRET_DOMAIN}
http:
paths:
- backend:
service:
name: rook-ceph-rgw-ceph-objectstore-external
port:
number: 80
path: /
pathType: Prefix
tls:
- hosts:
- *host
42 changes: 42 additions & 0 deletions kubernetes/apps/rook-ceph/ks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: &app rook-ceph
namespace: flux-system
spec:
targetNamespace: rook-ceph
commonMetadata:
labels:
app.kubernetes.io/name: *app
path: ./kubernetes/apps/rook-ceph/app
prune: false # never should be deleted
sourceRef:
kind: GitRepository
name: home-kubernetes
wait: false
interval: 30m
retryInterval: 5m30s
timeout: 5m
---
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: &app rook-ceph-cluster
namespace: flux-system
spec:
targetNamespace: rook-ceph
commonMetadata:
labels:
app.kubernetes.io/name: *app
path: ./kubernetes/apps/rook-ceph/cluster
prune: false # never should be deleted
sourceRef:
kind: GitRepository
name: home-kubernetes
wait: false
interval: 30m
retryInterval: 5m30s
timeout: 15m
9 changes: 9 additions & 0 deletions kubernetes/apps/rook-ceph/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
# Pre Flux-Kustomizations
- ./namespace.yaml
# Flux-Kustomizations
- ./ks.yaml
7 changes: 7 additions & 0 deletions kubernetes/apps/rook-ceph/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: rook-ceph
labels:
kustomize.toolkit.fluxcd.io/prune: disabled

0 comments on commit 8aa6041

Please sign in to comment.