kevin85421 commented on a change in pull request #566:
URL: https://github.com/apache/submarine/pull/566#discussion_r620828762
##########
File path: submarine-cloud-v2/controller.go
##########
@@ -475,6 +483,230 @@ func (c *Controller)
newSubmarineServerRBAC(serviceaccount_namespace string) err
return nil
}
+// newSubmarineDatabase is a function to create submarine-database.
+// Reference:
https://github.com/apache/submarine/blob/master/helm-charts/submarine/templates/submarine-database.yaml
+func (c *Controller) newSubmarineDatabase(namespace string, spec
*v1alpha1.SubmarineSpec) error {
+ klog.Info("[newSubmarineDatabase]")
+ databaseName := "submarine-database"
+
+ databaseImage := spec.Database.Image
+ if databaseImage == "" {
+ databaseImage = "apache/submarine:database-" + spec.Version
+ }
+
+ // Step1: Create PersistentVolume
+ // PersistentVolumes are not namespaced resources, so we add the
namespace
+ // as a suffix to distinguish them
+ pvName := databaseName + "-pv--" + namespace
+ pv, pv_err := c.persistentvolumeLister.Get(pvName)
+ // If the resource doesn't exist, we'll create it
+ if errors.IsNotFound(pv_err) {
+ var persistentVolumeSource corev1.PersistentVolumeSource
+ switch spec.Storage.StorageType {
+ case "nfs":
Review comment:
Does uppercase or lowercase matter in values.yaml?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]