This is an automated email from the ASF dual-hosted git repository.

kaihsun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/submarine.git


The following commit(s) were added to refs/heads/master by this push:
     new 1249590  SUBMARINE-904. Create minio by submarine operator for single 
user
1249590 is described below

commit 1249590d78327f0cb239829cad5735b9e71097c7
Author: Kenchu123 <[email protected]>
AuthorDate: Mon Jul 5 20:21:17 2021 +0800

    SUBMARINE-904. Create minio by submarine operator for single user
    
    ### What is this PR for?
    
    Create minio by submarine operator for single user
    
    ### What type of PR is it?
    [Feature]
    
    ### Todos
    
    ### What is the Jira issue?
    
    https://issues.apache.org/jira/browse/SUBMARINE-904
    ### How should this be tested?
    
    ### Screenshots (if appropriate)
    
    
https://user-images.githubusercontent.com/17617373/124442678-909aa000-ddaf-11eb-93a8-6a3551ab0889.mov
    
    ### Questions:
    * Do the license files need updating? No
    * Are there breaking changes for older versions? No
    * Does this need new documentation?
    
    No
    
    Author: Kenchu123 <[email protected]>
    
    Signed-off-by: Kai-Hsun Chen <[email protected]>
    
    Closes #647 from Kenchu123/SUBMARINE-904 and squashes the following commits:
    
    cbec065c [Kenchu123] SUBMARINE-904. Regenerate api due to changing types
    5b1c63ea [Kenchu123] SUBMARINE-904. Run gofmt
    e89c78e9 [Kenchu123] SUBMARINE-904. Create minio by submarine operator
---
 submarine-cloud-v2/artifacts/examples/crd.yaml     |   7 ++
 .../artifacts/examples/example-submarine.yaml      |   3 +
 .../pkg/apis/submarine/v1alpha1/register.go        |  34 +++---
 .../pkg/apis/submarine/v1alpha1/types.go           |   6 ++
 .../submarine/v1alpha1/zz_generated.deepcopy.go    |  26 +++++
 submarine-cloud-v2/pkg/controller/controller.go    |  10 ++
 ...submarine_tensorboard.go => submarine_minio.go} | 117 +++++++++++----------
 .../pkg/controller/submarine_tensorboard.go        |   4 +-
 8 files changed, 131 insertions(+), 76 deletions(-)

diff --git a/submarine-cloud-v2/artifacts/examples/crd.yaml 
b/submarine-cloud-v2/artifacts/examples/crd.yaml
index ff231fa..50393ac 100644
--- a/submarine-cloud-v2/artifacts/examples/crd.yaml
+++ b/submarine-cloud-v2/artifacts/examples/crd.yaml
@@ -72,6 +72,13 @@ spec:
                   type: boolean
                 storageSize:
                   type: string
+            minio:
+              type: object
+              properties:
+                enabled:
+                  type: boolean
+                storageSize:
+                  type: string
             storage:
               type: object
               properties:
diff --git a/submarine-cloud-v2/artifacts/examples/example-submarine.yaml 
b/submarine-cloud-v2/artifacts/examples/example-submarine.yaml
index 22dc4b1..309c37f 100644
--- a/submarine-cloud-v2/artifacts/examples/example-submarine.yaml
+++ b/submarine-cloud-v2/artifacts/examples/example-submarine.yaml
@@ -35,6 +35,9 @@ spec:
   mlflow:
     enabled: true
     storageSize: "10Gi"
+  minio:
+    enabled: true
+    storageSize: "10Gi"
   storage:
     # storageType: "nfs"
     # nfsPath: "/"
diff --git a/submarine-cloud-v2/pkg/apis/submarine/v1alpha1/register.go 
b/submarine-cloud-v2/pkg/apis/submarine/v1alpha1/register.go
index d30ff88..9326443 100644
--- a/submarine-cloud-v2/pkg/apis/submarine/v1alpha1/register.go
+++ b/submarine-cloud-v2/pkg/apis/submarine/v1alpha1/register.go
@@ -1,19 +1,19 @@
- /*
-  * Licensed to the Apache Software Foundation (ASF) under one or more
-  * contributor license agreements.  See the NOTICE file distributed with
-  * this work for additional information regarding copyright ownership.
-  * The ASF licenses this file to You under the Apache License, Version 2.0
-  * (the "License"); you may not use this file except in compliance with
-  * the License.  You may obtain a copy of the License at
-  *
-  *    http://www.apache.org/licenses/LICENSE-2.0
-  *
-  * Unless required by applicable law or agreed to in writing, software
-  * distributed under the License is distributed on an "AS IS" BASIS,
-  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  * See the License for the specific language governing permissions and
-  * limitations under the License.
-  */
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
 package v1alpha1
 
@@ -24,7 +24,7 @@ import (
 )
 
 const (
-       GroupName = "submarine.k8s.io"
+       GroupName    = "submarine.k8s.io"
        GroupVersion = "v1alpha1"
 )
 
diff --git a/submarine-cloud-v2/pkg/apis/submarine/v1alpha1/types.go 
b/submarine-cloud-v2/pkg/apis/submarine/v1alpha1/types.go
index 40b7da5..f44314b 100644
--- a/submarine-cloud-v2/pkg/apis/submarine/v1alpha1/types.go
+++ b/submarine-cloud-v2/pkg/apis/submarine/v1alpha1/types.go
@@ -54,6 +54,11 @@ type SubmarineMlflow struct {
        StorageSize string `json:"storageSize"`
 }
 
+type SubmarineMinio struct {
+       Enabled     *bool  `json:"enabled"`
+       StorageSize string `json:"storageSize"`
+}
+
 type SubmarineStorage struct {
        StorageType string `json:"storageType"`
        HostPath    string `json:"hostPath"`
@@ -68,6 +73,7 @@ type SubmarineSpec struct {
        Database    *SubmarineDatabase    `json:"database"`
        Tensorboard *SubmarineTensorboard `json:"tensorboard"`
        Mlflow      *SubmarineMlflow      `json:"mlflow"`
+       Minio       *SubmarineMinio       `json:"minio"`
        Storage     *SubmarineStorage     `json:"storage"`
 }
 
diff --git 
a/submarine-cloud-v2/pkg/apis/submarine/v1alpha1/zz_generated.deepcopy.go 
b/submarine-cloud-v2/pkg/apis/submarine/v1alpha1/zz_generated.deepcopy.go
index 513db09..597f6c8 100644
--- a/submarine-cloud-v2/pkg/apis/submarine/v1alpha1/zz_generated.deepcopy.go
+++ b/submarine-cloud-v2/pkg/apis/submarine/v1alpha1/zz_generated.deepcopy.go
@@ -108,6 +108,27 @@ func (in *SubmarineList) DeepCopyObject() runtime.Object {
 }
 
 // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, 
writing into out. in must be non-nil.
+func (in *SubmarineMinio) DeepCopyInto(out *SubmarineMinio) {
+       *out = *in
+       if in.Enabled != nil {
+               in, out := &in.Enabled, &out.Enabled
+               *out = new(bool)
+               **out = **in
+       }
+       return
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, 
creating a new SubmarineMinio.
+func (in *SubmarineMinio) DeepCopy() *SubmarineMinio {
+       if in == nil {
+               return nil
+       }
+       out := new(SubmarineMinio)
+       in.DeepCopyInto(out)
+       return out
+}
+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, 
writing into out. in must be non-nil.
 func (in *SubmarineMlflow) DeepCopyInto(out *SubmarineMlflow) {
        *out = *in
        if in.Enabled != nil {
@@ -172,6 +193,11 @@ func (in *SubmarineSpec) DeepCopyInto(out *SubmarineSpec) {
                *out = new(SubmarineMlflow)
                (*in).DeepCopyInto(*out)
        }
+       if in.Minio != nil {
+               in, out := &in.Minio, &out.Minio
+               *out = new(SubmarineMinio)
+               (*in).DeepCopyInto(*out)
+       }
        if in.Storage != nil {
                in, out := &in.Storage, &out.Storage
                *out = new(SubmarineStorage)
diff --git a/submarine-cloud-v2/pkg/controller/controller.go 
b/submarine-cloud-v2/pkg/controller/controller.go
index bc9eaab..1b7122d 100644
--- a/submarine-cloud-v2/pkg/controller/controller.go
+++ b/submarine-cloud-v2/pkg/controller/controller.go
@@ -67,6 +67,7 @@ const (
        databaseName                = "submarine-database"
        tensorboardName             = "submarine-tensorboard"
        mlflowName                  = "submarine-mlflow"
+       minioName                   = "submarine-minio"
        ingressName                 = serverName + "-ingress"
        databasePvNamePrefix        = databaseName + "-pv"
        databasePvcName             = databaseName + "-pvc"
@@ -78,6 +79,10 @@ const (
        mlflowPvcName               = mlflowName + "-pvc"
        mlflowServiceName           = mlflowName + "-service"
        mlflowIngressRouteName      = mlflowName + "-ingressroute"
+       minioPvNamePrefix           = minioName + "-pv"
+       minioPvcName                = minioName + "-pvc"
+       minioServiceName            = minioName + "-service"
+       minioIngressRouteName       = minioName + "-ingressroute"
 )
 
 // PersistentVolumes are not namespaced resources, so we add the namespace as a
@@ -490,6 +495,11 @@ func (c *Controller) syncHandler(workqueueItem 
WorkQueueItem) error {
                        return err
                }
 
+               err = c.createSubmarineMinio(submarine)
+               if err != nil {
+                       return err
+               }
+
                err = c.updateSubmarineStatus(submarine, serverDeployment, 
databaseDeployment)
                if err != nil {
                        return err
diff --git a/submarine-cloud-v2/pkg/controller/submarine_tensorboard.go 
b/submarine-cloud-v2/pkg/controller/submarine_minio.go
similarity index 75%
copy from submarine-cloud-v2/pkg/controller/submarine_tensorboard.go
copy to submarine-cloud-v2/pkg/controller/submarine_minio.go
index f9bfaaf..031104c 100644
--- a/submarine-cloud-v2/pkg/controller/submarine_tensorboard.go
+++ b/submarine-cloud-v2/pkg/controller/submarine_minio.go
@@ -34,7 +34,7 @@ import (
        traefikv1alpha1 
"github.com/traefik/traefik/v2/pkg/provider/kubernetes/crd/traefik/v1alpha1"
 )
 
-func newSubmarineTensorboardPersistentVolume(submarine *v1alpha1.Submarine) 
*corev1.PersistentVolume {
+func newSubmarineMinioPersistentVolume(submarine *v1alpha1.Submarine) 
*corev1.PersistentVolume {
        var persistentVolumeSource corev1.PersistentVolumeSource
        switch submarine.Spec.Storage.StorageType {
        case "nfs":
@@ -55,7 +55,7 @@ func newSubmarineTensorboardPersistentVolume(submarine 
*v1alpha1.Submarine) *cor
        }
        return &corev1.PersistentVolume{
                ObjectMeta: metav1.ObjectMeta{
-                       Name: pvName(tensorboardPvNamePrefix, 
submarine.Namespace),
+                       Name: pvName(minioPvNamePrefix, submarine.Namespace),
                        OwnerReferences: []metav1.OwnerReference{
                                *metav1.NewControllerRef(submarine, 
v1alpha1.SchemeGroupVersion.WithKind("Submarine")),
                        },
@@ -65,18 +65,18 @@ func newSubmarineTensorboardPersistentVolume(submarine 
*v1alpha1.Submarine) *cor
                                corev1.ReadWriteMany,
                        },
                        Capacity: corev1.ResourceList{
-                               corev1.ResourceStorage: 
resource.MustParse(submarine.Spec.Tensorboard.StorageSize),
+                               corev1.ResourceStorage: 
resource.MustParse(submarine.Spec.Minio.StorageSize),
                        },
                        PersistentVolumeSource: persistentVolumeSource,
                },
        }
 }
 
-func newSubmarineTensorboardPersistentVolumeClaim(submarine 
*v1alpha1.Submarine) *corev1.PersistentVolumeClaim {
+func newSubmarineMinioPersistentVolumeClaim(submarine *v1alpha1.Submarine) 
*corev1.PersistentVolumeClaim {
        storageClassName := ""
        return &corev1.PersistentVolumeClaim{
                ObjectMeta: metav1.ObjectMeta{
-                       Name: tensorboardPvcName,
+                       Name: minioPvcName,
                        OwnerReferences: []metav1.OwnerReference{
                                *metav1.NewControllerRef(submarine, 
v1alpha1.SchemeGroupVersion.WithKind("Submarine")),
                        },
@@ -87,19 +87,19 @@ func newSubmarineTensorboardPersistentVolumeClaim(submarine 
*v1alpha1.Submarine)
                        },
                        Resources: corev1.ResourceRequirements{
                                Requests: corev1.ResourceList{
-                                       corev1.ResourceStorage: 
resource.MustParse(submarine.Spec.Tensorboard.StorageSize),
+                                       corev1.ResourceStorage: 
resource.MustParse(submarine.Spec.Minio.StorageSize),
                                },
                        },
-                       VolumeName:       pvName(tensorboardPvNamePrefix, 
submarine.Namespace),
+                       VolumeName:       pvName(minioPvNamePrefix, 
submarine.Namespace),
                        StorageClassName: &storageClassName,
                },
        }
 }
 
-func newSubmarineTensorboardDeployment(submarine *v1alpha1.Submarine) 
*appsv1.Deployment {
+func newSubmarineMinioDeployment(submarine *v1alpha1.Submarine) 
*appsv1.Deployment {
        return &appsv1.Deployment{
                ObjectMeta: metav1.ObjectMeta{
-                       Name: tensorboardName,
+                       Name: minioName,
                        OwnerReferences: []metav1.OwnerReference{
                                *metav1.NewControllerRef(submarine, 
v1alpha1.SchemeGroupVersion.WithKind("Submarine")),
                        },
@@ -107,45 +107,47 @@ func newSubmarineTensorboardDeployment(submarine 
*v1alpha1.Submarine) *appsv1.De
                Spec: appsv1.DeploymentSpec{
                        Selector: &metav1.LabelSelector{
                                MatchLabels: map[string]string{
-                                       "app": tensorboardName + "-pod",
+                                       "app": minioName + "-pod",
                                },
                        },
                        Template: corev1.PodTemplateSpec{
                                ObjectMeta: metav1.ObjectMeta{
                                        Labels: map[string]string{
-                                               "app": tensorboardName + "-pod",
+                                               "app": minioName + "-pod",
                                        },
                                },
                                Spec: corev1.PodSpec{
                                        Containers: []corev1.Container{
                                                {
-                                                       Name:  tensorboardName 
+ "-container",
-                                                       Image: 
"tensorflow/tensorflow:1.11.0",
-                                                       Command: []string{
-                                                               "tensorboard",
-                                                               
"--logdir=/logs",
-                                                               
"--path_prefix=/tensorboard",
-                                                       },
+                                                       Name:            
minioName + "-container",
+                                                       Image:           
"minio/minio:latest",
                                                        ImagePullPolicy: 
"IfNotPresent",
+                                                       Args: []string{
+                                                               "server",
+                                                               "/data",
+                                                       },
+                                                       Env: []corev1.EnvVar{
+                                                               {
+                                                                       Name:  
"MINIO_ACCESS_KEY",
+                                                                       Value: 
"submarine_minio",
+                                                               },
+                                                               {
+                                                                       Name:  
"MINIO_SECRET_KEY",
+                                                                       Value: 
"submarine_minio",
+                                                               },
+                                                       },
+                                                       // TODO env
                                                        Ports: 
[]corev1.ContainerPort{
                                                                {
-                                                                       
ContainerPort: 6006,
+                                                                       
ContainerPort: 9000,
                                                                },
                                                        },
                                                        VolumeMounts: 
[]corev1.VolumeMount{
                                                                {
-                                                                       
MountPath: "/logs",
+                                                                       
MountPath: "/data",
                                                                        Name:   
   "volume",
-                                                                       
SubPath:   tensorboardName,
-                                                               },
-                                                       },
-                                                       ReadinessProbe: 
&corev1.Probe{
-                                                               Handler: 
corev1.Handler {
-                                                                       
TCPSocket: &corev1.TCPSocketAction {
-                                                                               
Port: intstr.FromInt(6006),
-                                                                       },
+                                                                       
SubPath:   minioName,
                                                                },
-                                                               PeriodSeconds: 
10,
                                                        },
                                                },
                                        },
@@ -154,7 +156,7 @@ func newSubmarineTensorboardDeployment(submarine 
*v1alpha1.Submarine) *appsv1.De
                                                        Name: "volume",
                                                        VolumeSource: 
corev1.VolumeSource{
                                                                
PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{
-                                                                       
ClaimName: tensorboardPvcName,
+                                                                       
ClaimName: minioPvcName,
                                                                },
                                                        },
                                                },
@@ -165,33 +167,34 @@ func newSubmarineTensorboardDeployment(submarine 
*v1alpha1.Submarine) *appsv1.De
        }
 }
 
-func newSubmarineTensorboardService(submarine *v1alpha1.Submarine) 
*corev1.Service {
+func newSubmarineMinioService(submarine *v1alpha1.Submarine) *corev1.Service {
        return &corev1.Service{
                ObjectMeta: metav1.ObjectMeta{
-                       Name: tensorboardServiceName,
+                       Name: minioServiceName,
                        OwnerReferences: []metav1.OwnerReference{
                                *metav1.NewControllerRef(submarine, 
v1alpha1.SchemeGroupVersion.WithKind("Submarine")),
                        },
                },
                Spec: corev1.ServiceSpec{
+                       Type: corev1.ServiceTypeClusterIP,
                        Selector: map[string]string{
-                               "app": tensorboardName + "-pod",
+                               "app": minioName + "-pod",
                        },
                        Ports: []corev1.ServicePort{
                                {
                                        Protocol:   "TCP",
-                                       Port:       8080,
-                                       TargetPort: intstr.FromInt(6006),
+                                       Port:       9000,
+                                       TargetPort: intstr.FromInt(9000),
                                },
                        },
                },
        }
 }
 
-func newSubmarineTensorboardIngressRoute(submarine *v1alpha1.Submarine) 
*traefikv1alpha1.IngressRoute {
+func newSubmarineMinioIngressRoute(submarine *v1alpha1.Submarine) 
*traefikv1alpha1.IngressRoute {
        return &traefikv1alpha1.IngressRoute{
                ObjectMeta: metav1.ObjectMeta{
-                       Name: tensorboardName + "-ingressroute",
+                       Name: minioIngressRouteName,
                        OwnerReferences: []metav1.OwnerReference{
                                *metav1.NewControllerRef(submarine, 
v1alpha1.SchemeGroupVersion.WithKind("Submarine")),
                        },
@@ -203,13 +206,13 @@ func newSubmarineTensorboardIngressRoute(submarine 
*v1alpha1.Submarine) *traefik
                        Routes: []traefikv1alpha1.Route{
                                {
                                        Kind:  "Rule",
-                                       Match: "PathPrefix(`/tensorboard`)",
+                                       Match: "PathPrefix(`/minio`)",
                                        Services: []traefikv1alpha1.Service{
                                                {
                                                        LoadBalancerSpec: 
traefikv1alpha1.LoadBalancerSpec{
                                                                Kind: "Service",
-                                                               Name: 
tensorboardServiceName,
-                                                               Port: 8080,
+                                                               Name: 
minioServiceName,
+                                                               Port: 9000,
                                                        },
                                                },
                                        },
@@ -219,23 +222,23 @@ func newSubmarineTensorboardIngressRoute(submarine 
*v1alpha1.Submarine) *traefik
        }
 }
 
-// createSubmarineTensorboard is a function to create submarine-tensorboard.
-// Reference: 
https://github.com/apache/submarine/blob/master/helm-charts/submarine/templates/submarine-tensorboard.yaml
-func (c *Controller) createSubmarineTensorboard(submarine *v1alpha1.Submarine) 
error {
-       klog.Info("[createSubmarineTensorboard]")
+// createSubmarineMinio is a function to create submarine-minio.
+// Reference: 
https://github.com/apache/submarine/blob/master/helm-charts/submarine/templates/submarine-minio.yaml
+func (c *Controller) createSubmarineMinio(submarine *v1alpha1.Submarine) error 
{
+       klog.Info("[createSubmarineMinio]")
 
        // Step 1: Create PersistentVolume
        // PersistentVolumes are not namespaced resources, so we add the 
namespace
        // as a suffix to distinguish them
-       pv, err := c.persistentvolumeLister.Get(pvName(tensorboardPvNamePrefix, 
submarine.Namespace))
+       pv, err := c.persistentvolumeLister.Get(pvName(minioPvNamePrefix, 
submarine.Namespace))
 
        // If the resource doesn't exist, we'll create it
        if errors.IsNotFound(err) {
-               pv, err = 
c.kubeclientset.CoreV1().PersistentVolumes().Create(context.TODO(), 
newSubmarineTensorboardPersistentVolume(submarine), metav1.CreateOptions{})
+               pv, err = 
c.kubeclientset.CoreV1().PersistentVolumes().Create(context.TODO(), 
newSubmarineMinioPersistentVolume(submarine), metav1.CreateOptions{})
                if err != nil {
                        klog.Info(err)
                }
-               klog.Info("     Create PersistentVolume: ", pv.Name)
+               klog.Info(" Create PersistentVolume: ", pv.Name)
        }
 
        // If an error occurs during Get/Create, we'll requeue the item so we 
can
@@ -252,16 +255,16 @@ func (c *Controller) createSubmarineTensorboard(submarine 
*v1alpha1.Submarine) e
        }
 
        // Step 2: Create PersistentVolumeClaim
-       pvc, err := 
c.persistentvolumeclaimLister.PersistentVolumeClaims(submarine.Namespace).Get(tensorboardPvcName)
+       pvc, err := 
c.persistentvolumeclaimLister.PersistentVolumeClaims(submarine.Namespace).Get(minioPvcName)
        // If the resource doesn't exist, we'll create it
        if errors.IsNotFound(err) {
                pvc, err = 
c.kubeclientset.CoreV1().PersistentVolumeClaims(submarine.Namespace).Create(context.TODO(),
-                       newSubmarineTensorboardPersistentVolumeClaim(submarine),
+                       newSubmarineMinioPersistentVolumeClaim(submarine),
                        metav1.CreateOptions{})
                if err != nil {
                        klog.Info(err)
                }
-               klog.Info("     Create PersistentVolumeClaim: ", pvc.Name)
+               klog.Info(" Create PersistentVolumeClaim: ", pvc.Name)
        }
        // If an error occurs during Get/Create, we'll requeue the item so we 
can
        // attempt processing again later. This could have been caused by a
@@ -277,13 +280,13 @@ func (c *Controller) createSubmarineTensorboard(submarine 
*v1alpha1.Submarine) e
        }
 
        // Step 3: Create Deployment
-       deployment, err := 
c.deploymentLister.Deployments(submarine.Namespace).Get(tensorboardName)
+       deployment, err := 
c.deploymentLister.Deployments(submarine.Namespace).Get(minioName)
        if errors.IsNotFound(err) {
-               deployment, err = 
c.kubeclientset.AppsV1().Deployments(submarine.Namespace).Create(context.TODO(),
 newSubmarineTensorboardDeployment(submarine), metav1.CreateOptions{})
+               deployment, err = 
c.kubeclientset.AppsV1().Deployments(submarine.Namespace).Create(context.TODO(),
 newSubmarineMinioDeployment(submarine), metav1.CreateOptions{})
                if err != nil {
                        klog.Info(err)
                }
-               klog.Info("     Create Deployment: ", deployment.Name)
+               klog.Info(" Create Deployment: ", deployment.Name)
        }
        // If an error occurs during Get/Create, we'll requeue the item so we 
can
        // attempt processing again later. This could have been caused by a
@@ -299,10 +302,10 @@ func (c *Controller) createSubmarineTensorboard(submarine 
*v1alpha1.Submarine) e
        }
 
        // Step 4: Create Service
-       service, err := 
c.serviceLister.Services(submarine.Namespace).Get(tensorboardServiceName)
+       service, err := 
c.serviceLister.Services(submarine.Namespace).Get(minioServiceName)
        // If the resource doesn't exist, we'll create it
        if errors.IsNotFound(err) {
-               service, err = 
c.kubeclientset.CoreV1().Services(submarine.Namespace).Create(context.TODO(), 
newSubmarineTensorboardService(submarine), metav1.CreateOptions{})
+               service, err = 
c.kubeclientset.CoreV1().Services(submarine.Namespace).Create(context.TODO(), 
newSubmarineMinioService(submarine), metav1.CreateOptions{})
                if err != nil {
                        klog.Info(err)
                }
@@ -322,10 +325,10 @@ func (c *Controller) createSubmarineTensorboard(submarine 
*v1alpha1.Submarine) e
        }
 
        // Step 5: Create IngressRoute
-       ingressroute, err := 
c.ingressrouteLister.IngressRoutes(submarine.Namespace).Get(tensorboardIngressRouteName)
+       ingressroute, err := 
c.ingressrouteLister.IngressRoutes(submarine.Namespace).Get(minioIngressRouteName)
        // If the resource doesn't exist, we'll create it
        if errors.IsNotFound(err) {
-               ingressroute, err = 
c.traefikclientset.TraefikV1alpha1().IngressRoutes(submarine.Namespace).Create(context.TODO(),
 newSubmarineTensorboardIngressRoute(submarine), metav1.CreateOptions{})
+               ingressroute, err = 
c.traefikclientset.TraefikV1alpha1().IngressRoutes(submarine.Namespace).Create(context.TODO(),
 newSubmarineMinioIngressRoute(submarine), metav1.CreateOptions{})
                if err != nil {
                        klog.Info(err)
                }
diff --git a/submarine-cloud-v2/pkg/controller/submarine_tensorboard.go 
b/submarine-cloud-v2/pkg/controller/submarine_tensorboard.go
index f9bfaaf..9c487ad 100644
--- a/submarine-cloud-v2/pkg/controller/submarine_tensorboard.go
+++ b/submarine-cloud-v2/pkg/controller/submarine_tensorboard.go
@@ -140,8 +140,8 @@ func newSubmarineTensorboardDeployment(submarine 
*v1alpha1.Submarine) *appsv1.De
                                                                },
                                                        },
                                                        ReadinessProbe: 
&corev1.Probe{
-                                                               Handler: 
corev1.Handler {
-                                                                       
TCPSocket: &corev1.TCPSocketAction {
+                                                               Handler: 
corev1.Handler{
+                                                                       
TCPSocket: &corev1.TCPSocketAction{
                                                                                
Port: intstr.FromInt(6006),
                                                                        },
                                                                },

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to