Skip to content

Commit

Permalink
WIP: CSI Node daemonset
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Miguel Olmo Martínez <[email protected]>
  • Loading branch information
jmolmo committed Dec 16, 2021
1 parent 3de5275 commit 6ae52ce
Show file tree
Hide file tree
Showing 7 changed files with 397 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/rbac/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ resources:
- service_account.yaml
- role.yaml
- role_binding.yaml
- sccs.yaml
- leader_election_role.yaml
- leader_election_role_binding.yaml
# Comment the following 4 lines if you want to disable
Expand Down
13 changes: 13 additions & 0 deletions config/rbac/role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,16 @@ subjects:
- kind: ServiceAccount
name: controller-manager
namespace: system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: topolvm-node-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: topolvm-node
subjects:
- kind: ServiceAccount
name: topolvm-node
namespace: system
25 changes: 25 additions & 0 deletions config/rbac/sccs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: use-scc-privileged
rules:
- apiGroups:
- security.openshift.io
resources:
- securitycontextconstraints
resourceNames:
- privileged
verbs:
- use
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: topolvm-node-scc
subjects:
- kind: ServiceAccount
name: topolvm-node
roleRef:
kind: Role
name: use-scc-privileged
6 changes: 6 additions & 0 deletions config/rbac/service_account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@ kind: ServiceAccount
metadata:
name: controller-manager
namespace: system
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: topolvm-node
namespace: system
16 changes: 16 additions & 0 deletions controllers/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,22 @@ var (
CsiResizerImage = GetEnvOrDefault("CSI_RESIZER_IMAGE")

TopolvmCSIDriverName = "topolvm.cybozu.com"

// topoLVM Node
TopolvmNodeServiceAccount = "topolvm-node"
TopolvmNodeDaemonsetName = "topolvm-node"
CSIKubeletRootDir = "/var/lib/kubelet/"
lvmdConfigCM = "lvmd_config"
NodeContainerName = "topolvm-node"
TopolvmNodeContainerHealthzName = "healthz"
auxImage = "registry.access.redhat.com/ubi8/ubi-minimal"
lvmdConfigFile = "/etc/topolvm/lvmd.yaml"

// topoLVM Node resource requests/limits
TopolvmNodeMemRequest = "250Mi"
TopolvmNodeMemLimit = "250Mi"
TopolvmNodeCPURequest = "250m"
TopolvmNodeCPULimit = "250m"
)

func GetEnvOrDefault(env string) string {
Expand Down
1 change: 1 addition & 0 deletions controllers/lvmcluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ func (r *LVMClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request)
func (r *LVMClusterReconciler) reconcile(ctx context.Context, instance *lvmv1alpha1.LVMCluster) (ctrl.Result, error) {
resourceList := []resourceManager{
&csiDriver{},
&topolvmNode{},
}

//The resource was deleted
Expand Down
Loading

0 comments on commit 6ae52ce

Please sign in to comment.