Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Flux OpenEBS-Mayastor storage integration #125

Open
wants to merge 42 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
3e5cf41
empty commit
enjenjenje Feb 12, 2025
9fd13d2
chore: Openebs test (#124)
enjenjenje Feb 13, 2025
3c40ffb
cleanup
enjenjenje Feb 13, 2025
d266fc5
cleanup
enjenjenje Feb 13, 2025
1acb763
added fcli storage post configuration
enjenjenje Feb 13, 2025
a0ed4f7
cleanup
enjenjenje Feb 13, 2025
3f4b10b
ephemeral do support prep
enjenjenje Feb 17, 2025
034f3b4
moved openebs to separate ns
enjenjenje Feb 18, 2025
d1f9660
removed namespace def
enjenjenje Feb 18, 2025
82b878a
create ns
enjenjenje Feb 18, 2025
8389be2
create ns
enjenjenje Feb 18, 2025
fe9193e
create ns
enjenjenje Feb 18, 2025
44c397c
create ns
enjenjenje Feb 18, 2025
36b326c
added storage pool def
enjenjenje Feb 18, 2025
f424240
test crzy ducktapes
enjenjenje Feb 18, 2025
067f18e
Revert "added storage pool def"
enjenjenje Feb 18, 2025
1940d74
Revert "Revert "added storage pool def""
enjenjenje Feb 18, 2025
692451e
Revert "test crzy ducktapes"
enjenjenje Feb 18, 2025
179cd59
:(
enjenjenje Feb 18, 2025
8566135
test
enjenjenje Feb 18, 2025
df9ffe3
f
enjenjenje Feb 18, 2025
52d0ab8
f
enjenjenje Feb 18, 2025
9d3dde0
f
enjenjenje Feb 18, 2025
22039e7
f
enjenjenje Feb 18, 2025
d69b4a9
f
enjenjenje Feb 18, 2025
5c6da1e
f
enjenjenje Feb 18, 2025
4ff329c
f
enjenjenje Feb 18, 2025
1328bd2
f
enjenjenje Feb 18, 2025
8382810
f
enjenjenje Feb 18, 2025
da92842
f
enjenjenje Feb 18, 2025
205e053
test
enjenjenje Feb 19, 2025
7afc21d
test
enjenjenje Feb 19, 2025
a75c5d0
test
enjenjenje Feb 19, 2025
35d1cd4
mayastor support for DO
enjenjenje Feb 19, 2025
24185fd
fix
enjenjenje Feb 19, 2025
9212b7d
test patch
enjenjenje Feb 19, 2025
e49c30c
test patch
enjenjenje Feb 19, 2025
989801a
test patch
enjenjenje Feb 19, 2025
dbd2ed7
test patch
enjenjenje Feb 19, 2025
b0c7644
test patch
enjenjenje Feb 19, 2025
b50595a
deleted cilium patch traces
enjenjenje Feb 19, 2025
296eff9
deleted cilium patch traces
enjenjenje Feb 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions ephemeral/instance.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,15 @@ resource "digitalocean_droplet" "cp" {
local.prefix,
]
}

# mayastor volume
resource "digitalocean_volume" "mayastor" {
region = "fra1"
name = "rnd-${local.prefix}-spectrum-cp"
size = "100"
}

resource "digitalocean_volume_attachment" "mayastor" {
droplet_id = digitalocean_droplet.cp[0].id
volume_id = digitalocean_volume.mayastor.id
}
4 changes: 3 additions & 1 deletion ephemeral/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ module "talos" {
templatefile("${path.root}/patches/registry.yml", {
docker_username = data.vault_generic_secret.docker.data.username,
docker_password = data.vault_generic_secret.docker.data.password
})
},),
file("${path.root}/patches/mayastor.yml")
]
},
]
Expand All @@ -45,5 +46,6 @@ module "spectrum" {
DOMAIN = "${local.prefix}.fluence.dev"
PREFIX = local.prefix
LOADBALANCER_IP = digitalocean_droplet.cp[0].ipv4_address
DO_DISK = digitalocean_volume.mayastor.name
}
}
27 changes: 27 additions & 0 deletions ephemeral/patches/mayastor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
machine:
kubelet:
extraArgs:
node-labels: openebs.io/engine=mayastor
max-pods: 500
extraMounts:
- destination: /var/local # Destination is the absolute path where the mount will be placed in the container.
type: bind # Type specifies the mount kind.
source: /var/local # Source specifies the source path of the mount.
options:
- bind
- rshared
- rw
sysctls:
vm.nr_hugepages: "1024"
nodeLabels:
openebs.io/engine: "mayastor"
cluster:
apiServer:
admissionControl:
- name: PodSecurity
configuration:
apiVersion: pod-security.admission.config.k8s.io/v1beta1
kind: PodSecurityConfiguration
exemptions:
namespaces:
- openebs
1 change: 1 addition & 0 deletions flux/clusters/default/kustomization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ resources:
- ../../core/local-path-provisioner
- ../../core/metrics-server
- ../../core/kubelet-serving-cert-approver
- ../../core/openebs
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably a good idea to add a disk to ephemeral DO instance, install mayastore there and add that disk to mayastore.
Can be done in a separate PR I think.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

2 changes: 2 additions & 0 deletions flux/clusters/ephemeral/kustomization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ resources:
- ../../core/kubelet-serving-cert-approver
- ../../components/kubevirt
- ../../components/monitoring
- openebs-mayastor.yml
- hubble-ingress.yml
- grafana-ingress.yml
# - cilium-l2.yml
- lightmare.yml
- openebs-do-pool.yml
25 changes: 25 additions & 0 deletions flux/clusters/ephemeral/openebs-do-pool.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: openebs-do-pool
namespace: flux-system
spec:
dependsOn:
- name: openebs
interval: 1m
path: "./flux/components/openebs-do-pool"
prune: true
sourceRef:
kind: GitRepository
name: spectrum
namespace: flux-system
patches:
- patch: |-
- op: replace
path: /spec/disks
value: ["aio:///dev/disk/by-id/scsi-0DO_Volume_${DO_DISK}"]
target:
kind: DiskPool
name: ebs-pool
namespace: openebs
15 changes: 15 additions & 0 deletions flux/clusters/ephemeral/openebs-mayastor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: openebs
namespace: flux-system
spec:
interval: 1m
path: "./flux/core/openebs"
prune: true
sourceRef:
kind: GitRepository
name: spectrum
namespace: flux-system

4 changes: 4 additions & 0 deletions flux/components/openebs-do-pool/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./manifests.yaml
18 changes: 18 additions & 0 deletions flux/components/openebs-do-pool/manifests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: mayastor
parameters:
protocol: nvmf
repl: "1"
provisioner: io.openebs.csi-mayastor
---
apiVersion: "openebs.io/v1beta2"
kind: DiskPool
metadata:
name: ebs-pool
namespace: openebs
spec:
node: cp-0
disks: ["aio:///dev/disk/by-id/placeholder"]
4 changes: 4 additions & 0 deletions flux/components/openebs-pool/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./manifests.yaml
9 changes: 9 additions & 0 deletions flux/components/openebs-pool/manifests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: spectrum-pool
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nahsi @gurinderu need to decide with the Storage Pool name here.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, need to think about it.

Do we need storage pool for nvme, ssd and hdd disks separately?

If not I would just call it mayastore or something in case we will add some different storage tech after.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to these docs - we can create multiple pools that look to different disks.

We need to come up with standard names for every storage type (e.g. nvme-pool, ssd-pool, hdd-pool)

parameters:
protocol: nvmf
repl: "1"
provisioner: io.openebs.csi-mayastor
5 changes: 5 additions & 0 deletions flux/core/openebs/kustomization.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- repository.yml
- release.yml
35 changes: 35 additions & 0 deletions flux/core/openebs/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: openebs
namespace: kube-system
spec:
targetNamespace: openebs
install:
createNamespace: true
interval: 5m
chart:
spec:
chart: openebs
version: 4.1.3
sourceRef:
name: openebs
kind: HelmRepository
namespace: flux-system
values:
mayastor:
csi:
node:
initContainers:
enabled: false
etcd:
replicaCount: 1
engines:
replicated:
mayastor:
enabled: true
local:
lvm:
enabled: false
zfs:
enabled: false
9 changes: 9 additions & 0 deletions flux/core/openebs/repository.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
metadata:
name: openebs
namespace: flux-system
spec:
interval: 5m
timeout: 3m
url: https://openebs.github.io/openebs