Skip to content

Commit

Permalink
fix(installer): add cephfs chart (#2204)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lis committed Dec 8, 2022
1 parent 867710d commit 0e873ea
Show file tree
Hide file tree
Showing 30 changed files with 1,713 additions and 1 deletion.
54 changes: 54 additions & 0 deletions cmd/tke-installer/app/installer/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,60 @@ func (t *TKE) preprocessPlatformApps(ctx context.Context) error {
}
values["namespace"] = platformApp.HelmInstallOptions.Namespace
}
if strings.EqualFold(platformApp.HelmInstallOptions.ReleaseName, constants.CephFSChartReleaseName) {
platformApp.ConditionFunc = func() (bool, error) {
provisionerOk, err := apiclient.CheckDeployment(ctx, t.globalClient, platformApp.HelmInstallOptions.Namespace, "ceph-csi-cephfs-provisioner")
if err != nil {
return false, nil
}
nodepluginOk, err := apiclient.CheckDaemonset(ctx, t.globalClient, platformApp.HelmInstallOptions.Namespace, "ceph-csi-cephfs-nodeplugin")
if err != nil {
return false, nil
}
return provisionerOk && nodepluginOk, nil
}
platformApp.LocalChartPath = constants.ChartDirName + "ceph-csi-cephfs/"

if err := t.mergePlatformAppValues(platformApp); err != nil {
return err
}
values := platformApp.HelmInstallOptions.Values
if values["csiConfig"] == nil {
return fmt.Errorf("ceph-csi-cephfs platformAPP csiConfig nil")
}
// TODO: little confused in preprocess step
if values["secret"] == nil || len(values["secret"].(map[string]interface{})["adminID"].(string)) == 0 || len(values["secret"].(map[string]interface{})["adminKey"].(string)) == 0 {
return fmt.Errorf("ceph-csi-cephfs platformAPP secret adminID | adminKey nil")
}
// TODO: little confused in preprocess step
if values["storageClass"] == nil || len(values["storageClass"].(map[string]interface{})["clusterID"].(string)) == 0 || len(values["storageClass"].(map[string]interface{})["fsName"].(string)) == 0 {
return fmt.Errorf("ceph-csi-cephfs platformAPP storageClass clusterID| fsName nil")
}

values["images"] = map[string]interface{}{
"enable": true,
"nodeplugin": map[string]interface{}{
"registrar": images.Get().CsiNodeDriverRegistrar.FullName(),
"plugin": images.Get().CephCsi.FullName(),
},
"provisioner": map[string]interface{}{
"provisioner": images.Get().CsiProvisioner.FullName(),
"attacher": images.Get().CsiAttacher.FullName(),
"resizer": images.Get().CsiResizer.FullName(),
"snapshotter": images.Get().CsiSnapshotter.FullName(),
},
}
if values["storageClass"] == nil {
values["storageClass"] = map[string]interface{}{
"replicaCount": t.Config.Replicas,
"name": constants.CephFSStorageClassName,
}
} else {
values["storageClass"].(map[string]interface{})["replicaCount"] = t.Config.Replicas
values["storageClass"].(map[string]interface{})["name"] = constants.CephFSStorageClassName
}
values["namespace"] = platformApp.HelmInstallOptions.Namespace
}
if strings.EqualFold(platformApp.HelmInstallOptions.ReleaseName, constants.NFSChartReleaseName) {
platformApp.ConditionFunc = func() (bool, error) {
provisionerOk, err := apiclient.CheckDeployment(ctx, t.globalClient, platformApp.HelmInstallOptions.Namespace, "nfs-subdir-external-provisioner")
Expand Down
2 changes: 2 additions & 0 deletions cmd/tke-installer/app/installer/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ const (
const (
CephRBDStorageClassName = "csi-rbd-sc"
CephRBDChartReleaseName = "ceph-csi-rbd"
CephFSStorageClassName = "csi-cephfs-sc"
CephFSChartReleaseName = "ceph-csi-cephfs"
NFSStorageClassName = "nfs-sc"
NFSChartReleaseName = "nfs-subdir-external-provisioner"
)
2 changes: 1 addition & 1 deletion cmd/tke-installer/app/installer/images/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ var baseComponents = BaseComponents{
CsiAttacher: containerregistry.Image{Name: "csi-attacher", Tag: "v3.4.0"},
CsiResizer: containerregistry.Image{Name: "csi-resizer", Tag: "v1.4.0"},
CsiSnapshotter: containerregistry.Image{Name: "csi-snapshotter", Tag: "v4.2.0"},
CephCsi: containerregistry.Image{Name: "cephcsi", Tag: "v3.6.0"},
CephCsi: containerregistry.Image{Name: "cephcsi", Tag: "v3.6.1-csp2.8.3.1216"},
}

var components = Components{baseComponents, exComponents}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
apiVersion: v1
appVersion: canary
description: "Container Storage Interface (CSI) driver,
provisioner, snapshotter and attacher for Ceph cephfs"
name: ceph-csi-cephfs
version: 3-canary
keywords:
- ceph
- cephfs
- ceph-csi
home: https://github.com/ceph/ceph-csi
sources:
- https://github.com/ceph/ceph-csi/tree/devel/charts/ceph-csi-cephfs
icon: https://raw.githubusercontent.com/ceph/ceph-csi/devel/assets/ceph-logo.png
Loading

0 comments on commit 0e873ea

Please sign in to comment.