You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2020/03/05 13:34:28 UTC

[GitHub] [cloudstack] DaanHoogland commented on a change in pull request #3680: [WIP: DO NOT MERGE] CloudStack Kubernetes Service

DaanHoogland commented on a change in pull request #3680: [WIP: DO NOT MERGE] CloudStack Kubernetes Service
URL: https://github.com/apache/cloudstack/pull/3680#discussion_r388294926
 
 

 ##########
 File path: plugins/integrations/kubernetes-service/src/main/java/com/cloud/kubernetescluster/KubernetesCluster.java
 ##########
 @@ -0,0 +1,134 @@
+// 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 com.cloud.kubernetescluster;
+
+import java.util.Date;
+
+import org.apache.cloudstack.acl.ControlledEntity;
+import org.apache.cloudstack.api.Displayable;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
+
+import com.cloud.utils.fsm.StateMachine2;
+
+/**
+ * KubernetesCluster describes the properties of Kubernetes cluster
+ *
+ */
+public interface KubernetesCluster extends ControlledEntity, com.cloud.utils.fsm.StateObject<KubernetesCluster.State>, Identity, InternalIdentity, Displayable {
+
+    enum Event {
+        StartRequested,
+        StopRequested,
+        DestroyRequested,
+        RecoveryRequested,
+        ScaleUpRequested,
+        ScaleDownRequested,
+        UpgradeRequested,
+        OperationSucceeded,
+        OperationFailed,
+        CreateFailed,
+        FaultsDetected;
+    }
+
+    enum State {
+        Created("Initial State of Kubernetes cluster. At this state its just a logical/DB entry with no resources consumed"),
+        Starting("Resources needed for Kubernetes cluster are being provisioned"),
+        Running("Necessary resources are provisioned and Kubernetes cluster is in operational ready state to launch Kubernetes"),
+        Stopping("Resources for the Kubernetes cluster are being destroyed"),
+        Stopped("All resources for the Kubernetes cluster are destroyed, Kubernetes cluster may still have ephemeral resource like persistent volumes provisioned"),
+        Scaling("Transient state in which resources are either getting scaled up/down"),
+        Upgrading("Transient state in which cluster is getting upgraded"),
+        Alert("State to represent Kubernetes clusters which are not in expected desired state (operationally in active control place, stopped cluster VM's etc)."),
+        Recovering("State in which Kubernetes cluster is recovering from alert state"),
+        Destroyed("End state of Kubernetes cluster in which all resources are destroyed, cluster will not be usable further"),
+        Destroying("State in which resources for the Kubernetes cluster is getting cleaned up or yet to be cleaned up by garbage collector"),
+        Error("State of the failed to create Kubernetes clusters");
+
+        protected static final StateMachine2<State, KubernetesCluster.Event, KubernetesCluster> s_fsm = new StateMachine2<State, KubernetesCluster.Event, KubernetesCluster>();
+
+        public static StateMachine2<State, KubernetesCluster.Event, KubernetesCluster> getStateMachine() { return s_fsm; }
+
+        static {
 
 Review comment:
   good, did you re-create that pantuml diagram? (or in some other way update?)

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services