ソースを参照

Merge branch 'staging' into capi-staging

Stefan McShane 3 年 前
コミット
e7b2d844ab

+ 47 - 3
api/server/handlers/infra/forms.go

@@ -527,7 +527,7 @@ tabs:
     show_if: additional_nodegroup_enabled
     contents:
     - type: string-input
-      label: Label for this node group.
+      label: Label for this node group. Multiple labels should be comma separated.
       variable: additional_nodegroup_label
       placeholder: "ex: porter.run/workload-kind=job"
       settings:
@@ -633,10 +633,20 @@ tabs:
 - name: advanced
   label: Advanced
   sections:
+  - name: workload_machine_label
+    contents:
+    - type: heading
+      label: Application Node Group Settings
+    - type: string-input
+      label: Add custom node labels to the application node group. If you are adding multiple labels, they should be comma separated.
+      variable: custom_node_labels_application
+      placeholder: "ex: mylabel=custom-label,mylabel2=another-one"
+      settings:
+        default: ""
   - name: system_machine_type
     contents:
     - type: heading
-      label: System Machine Type Settings
+      label: System Node Group Settings
     - type: select
       label: ⚙️ AWS System Machine Type
       variable: system_machine_type
@@ -667,6 +677,12 @@ tabs:
           value: c6i.2xlarge
         - label: c6i.4xlarge
           value: c6i.4xlarge
+    - type: string-input
+      label: Add custom node labels to the system node group. If you are adding multiple labels, they should be comma separated.
+      variable: custom_node_labels_system
+      placeholder: "ex: mylabel=custom-label,mylabel2=another-one"
+      settings:
+        default: ""
   - name: spot_instance_should_enable
     contents:
     - type: heading
@@ -758,6 +774,12 @@ tabs:
           value: t3.large
         - label: t3.xlarge
           value: t3.xlarge
+    - type: string-input
+      label: Add custom node labels to the monitoring node group. If you are adding multiple labels, they should be comma separated.
+      variable: custom_node_labels_monitoring
+      placeholder: "ex: mylabel=custom-label,mylabel2=another-one"
+      settings:
+        default: ""
   - name: kms_secret_encryption
     contents:
     - type: heading
@@ -767,6 +789,28 @@ tabs:
       label: Encrypt all Kubernetes secrets with AWS Key Management Service (KMS)
       settings:
         default: false
+  - name: enable_logging
+    contents:
+    - type: heading
+      label: Enable AWS Logging 
+    - type: checkbox
+      variable: vpc_flow_logs_enabled
+      label: Enable VPC Flow Logs
+      settings:
+        default: false
+    - type: checkbox
+      variable: eks_control_plane_logs_enabled
+      label: Enable EKS Control Plane Logs
+      settings:
+        default: false
+  - name: add_custom_tags
+    contents:
+    - type: heading
+      label: Add Custom Tags on AWS Resources Provisioned by Porter
+    - type: key-value-array
+      variable: custom_tags
+      settings:
+        default: {} 
 `
 
 const gcrForm = `name: GCR
@@ -1208,4 +1252,4 @@ tabs:
       required: true
       placeholder: my-cluster
       variable: cluster_name
-`
+`

+ 14 - 0
api/types/cluster.go

@@ -38,6 +38,9 @@ type Cluster struct {
 
 	// Whether preview environments is enabled on this cluster
 	PreviewEnvsEnabled bool `json:"preview_envs_enabled"`
+
+	// Cluster provisioning status if managed by Porter
+	Status ClusterStatus `json:"status"`
 }
 
 type ClusterCandidate struct {
@@ -168,6 +171,17 @@ type ClusterGetResponse struct {
 	IngressError error `json:"ingress_error"`
 }
 
+// ClusterStatus to track provisioning state
+type ClusterStatus string
+
+const (
+	Ready    ClusterStatus = "READY"
+	Updating ClusterStatus = "UPDATING"
+
+	// For initial provisioning or for when the cluster is updating but not ready
+	UpdatingUnavailable ClusterStatus = "UPDATING_UNAVAILABLE"
+)
+
 type ClusterService string
 
 const (

+ 1 - 42
dashboard/src/main/home/dashboard/ClusterList.tsx

@@ -32,48 +32,6 @@ const ClusterList: React.FC<Props> = ({}) => {
         console.error(err);
         setIsLoading(false);
       });
-   /*
-    const dummyData = [
-      {
-        id: 3,
-        project_id: 2,
-        name: "dummy-cluster-one",
-        server: "https://73727E5A0EF0FD07D24D7C1FDCE041E6.gr7.us-east-1.eks.amazonaws.com",
-        service: "eks",
-        agent_integration_enabled: false,
-        infra_id: 0,
-        aws_integration_id: 5,
-        preview_envs_enabled: true,
-        status: "READY",
-      },
-      {
-        id: 4,
-        project_id: 2,
-        name: "dummy-cluster-two",
-        server: "https://73727E5A0EF0FD07D24D7C1FDCE041E6.gr7.us-east-1.eks.amazonaws.com",
-        service: "eks",
-        agent_integration_enabled: false,
-        infra_id: 0,
-        aws_integration_id: 5,
-        preview_envs_enabled: true,
-        status: "UPDATING",
-      },
-      {
-        id: 5,
-        project_id: 2,
-        name: "dummy-cluster-three",
-        server: "https://73727E5A0EF0FD07D24D7C1FDCE041E6.gr7.us-east-1.eks.amazonaws.com",
-        service: "eks",
-        agent_integration_enabled: false,
-        infra_id: 0,
-        aws_integration_id: 5,
-        preview_envs_enabled: true,
-        status: "UPDATING_UNAVAILABLE",
-      },
-    ];
-    setClusters(dummyData);
-    setIsLoading(false);
-    */
   }, [currentProject]);
 
   const renderIcon = () => {
@@ -147,6 +105,7 @@ const ClusterList: React.FC<Props> = ({}) => {
             {clusters.map((cluster: any) => {
               return (
                 <ClusterRow
+                  key={cluster.id}
                   onClick={() => {
                     setCurrentCluster(cluster);
                     pushFiltered({ location, history }, "/applications", ["project_id"], {

+ 1 - 1
go.work

@@ -1,4 +1,4 @@
-go 1.19
+go 1.20
 
 use (
 	.

+ 2 - 1
internal/models/cluster.go

@@ -66,7 +66,7 @@ type Cluster struct {
 	AWSClusterID string
 
 	// Status defines the current status of the cluster. Accepted values: [READY, UPDATING]
-	Status string `json:"status"`
+	Status types.ClusterStatus `json:"status"`
 
 	// ProvisionedBy is used for identifing the provisioner used for the cluster. Accepted values: [CAPI, ]
 	ProvisionedBy string `json:"provisioned_by"`
@@ -127,6 +127,7 @@ func (c *Cluster) ToClusterType() *types.Cluster {
 		AWSIntegrationID:        c.AWSIntegrationID,
 		AWSClusterID:            c.AWSClusterID,
 		PreviewEnvsEnabled:      c.PreviewEnvsEnabled,
+		Status:                  c.Status,
 	}
 }