Skip to content

add simplyblock-storage.yaml file #135

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
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
117 changes: 117 additions & 0 deletions deploy/kubernetes/simplyblock-storagenode.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: storage-node-sa

---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: storage-node-role
rules:
- apiGroups: [""]
resources: ["pods", "namespaces", "pods/exec"]
verbs: ["list", "get", "create", "delete"]
- apiGroups: ["apps"]
resources: ["deployments"]
verbs: ["create", "delete"]

---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: pods-list-sn
subjects:
- kind: ServiceAccount
name: storage-node-sa
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
name: storage-node-role
apiGroup: rbac.authorization.k8s.io

---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: simplyblock-storages
annotations:
helm.sh/hook: post-install
spec:
selector:
matchLabels:
app: simplyblock-storages
template:
metadata:
labels:
app: simplyblock-storages
spec:
serviceAccountName: storage-node-sa
nodeSelector:
Copy link
Collaborator

@geoffrey1330 geoffrey1330 Apr 16, 2025

Choose a reason for hiding this comment

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

How do you handle for cases of secondary storage node and also node to perform primary node restart? as this two have a separate node label

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The purpose of this folder (deploy/kubernetes) is to provide examples. So of all the 3 storage node type its best to have example for simplyblock-storage-plane and remaining can be re-created from this file by just modifying the app Labels and nodeSelector

Copy link
Collaborator

Choose a reason for hiding this comment

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

Won't it be best we just created them also in the example?

type: simplyblock-storage-plane
volumes:
- name: dev-vol
hostPath:
path: /dev
- name: etc-simplyblock
hostPath:
path: /var/simplyblock
- name: host-root
hostPath:
path: /
hostNetwork: true

initContainers:
- name: init-snode
image: "public.ecr.aws/simply-block/simplyblock:R25.3-PRE-Hotfix"
imagePullPolicy: "Always"
securityContext:
privileged: true
volumeMounts:
- name: host-root
mountPath: /host
command:
- "/bin/sh"
- "-c"
- |
chroot /host /bin/sh -c '
modprobe nbd
yum install -y pciutils'
containers:
- name: s-node-api-container
image: "public.ecr.aws/simply-block/simplyblock:R25.3-PRE-Hotfix"
imagePullPolicy: "Always"
command: ["python", "simplyblock_web/node_webapp.py", "storage_node_k8s"]
env:
- name: HOSTNAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: CPUMASK
value: "0xf"
securityContext:
privileged: true
volumeMounts:
- name: dev-vol
mountPath: /dev
- name: etc-simplyblock
mountPath: /etc/simplyblock
livenessProbe:
httpGet:
path: /snode/get_firewall
port: 5000
scheme: HTTP
initialDelaySeconds: 30
periodSeconds: 60
timeoutSeconds: 5
failureThreshold: 3
readinessProbe:
httpGet:
path: /snode/get_firewall
port: 5000
scheme: HTTP
initialDelaySeconds: 30
periodSeconds: 60
timeoutSeconds: 5
failureThreshold: 3
Loading