-
Notifications
You must be signed in to change notification settings - Fork 378
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: cmp support new import method (#806)
- Loading branch information
Showing
45 changed files
with
2,794 additions
and
153 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
.erda/migrations/cluster-manager/20210708-add-manageconfig.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
-- add manage config field to store cluster credential info | ||
ALTER TABLE co_clusters ADD COLUMN `manage_config` text NOT NULL COMMENT "cluster crendtial config"; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
// Copyright (c) 2021 Terminus, Inc. | ||
// | ||
// This program is free software: you can use, redistribute, and/or modify | ||
// it under the terms of the GNU Affero General Public License, version 3 | ||
// or later ("AGPL"), as published by the Free Software Foundation. | ||
// | ||
// This program is distributed in the hope that it will be useful, but WITHOUT | ||
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
// FITNESS FOR A PARTICULAR PURPOSE. | ||
// | ||
// You should have received a copy of the GNU Affero General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
package apistructs | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
|
||
"github.com/erda-project/erda/pkg/parser/diceyml" | ||
) | ||
|
||
const ( | ||
ClusterPhaseNone ClusterPhase = "" | ||
ClusterPhaseInitJobs ClusterPhase = "InitJobs" | ||
ClusterPhaseCreating ClusterPhase = "Creating" | ||
ClusterPhaseUpdating ClusterPhase = "Updating" | ||
ClusterPhaseRunning ClusterPhase = "Running" | ||
ClusterPhaseFailed ClusterPhase = "Failed" | ||
ClusterPhasePending ClusterPhase = "Pending" | ||
) | ||
|
||
type ClusterPhase string | ||
type ComponentStatus string | ||
type ClusterSize string | ||
|
||
type DiceClusterList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
Items []DiceCluster `json:"items"` | ||
} | ||
|
||
type DiceCluster struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
Spec ClusterSpec `json:"spec"` | ||
Status ClusterStatus `json:"status"` | ||
} | ||
|
||
type ClusterSpec struct { | ||
ResetStatus bool `json:"resetStatus"` | ||
AddonConfigMap string `json:"addonConfigMap"` | ||
ClusterinfoConfigMap string `json:"clusterinfoConfigMap"` | ||
PlatformDomain string `json:"platformDomain"` | ||
CookieDomain string `json:"cookieDomain"` | ||
Size ClusterSize `json:"size"` | ||
DiceCluster string `json:"diceCluster"` | ||
// collector, openapi | ||
MainPlatform map[string]string `json:"mainPlatform"` | ||
// key: dice-service-name(e.g. ui), value: domain | ||
// customDomain: | ||
// ui: dice.terminus.io,*.terminus.io | ||
CustomDomain map[string]string `json:"customDomain"` | ||
// deployment affinity labels for specific dice-service | ||
// key: dice-service-name(e.g. gittar), value: label | ||
// e.g. | ||
// gittar: dice/gittar | ||
CustomAffinity map[string]string `json:"customAffinity"` | ||
|
||
InitJobs diceyml.Object `json:"initJobs"` | ||
|
||
Dice diceyml.Object `json:"dice"` | ||
AddonPlatform diceyml.Object `json:"addonPlatform"` | ||
Gittar diceyml.Object `json:"gittar"` | ||
Pandora diceyml.Object `json:"pandora"` | ||
DiceUI diceyml.Object `json:"diceUI"` | ||
UC diceyml.Object `json:"uc"` | ||
SpotAnalyzer diceyml.Object `json:"spotAnalyzer"` | ||
SpotCollector diceyml.Object `json:"spotCollector"` | ||
SpotDashboard diceyml.Object `json:"spotDashboard"` | ||
SpotFilebeat diceyml.Object `json:"spotFilebeat"` | ||
SpotStatus diceyml.Object `json:"spotStatus"` | ||
SpotTelegraf diceyml.Object `json:"spotTelegraf"` | ||
Tmc diceyml.Object `json:"tmc"` | ||
Hepa diceyml.Object `json:"hepa"` | ||
SpotMonitor diceyml.Object `json:"spotMonitor"` | ||
Fdp diceyml.Object `json:"fdp"` | ||
MeshController diceyml.Object `json:"meshController"` | ||
} | ||
type ClusterStatus struct { | ||
Phase ClusterPhase `json:"phase"` | ||
Conditions []ErdaCondition `json:"conditions"` | ||
Components map[string]ComponentStatus `json:"components"` | ||
} | ||
|
||
type ErdaCondition struct { | ||
Reason string `json:"reason"` | ||
TransitionTime string `json:"transitionTime"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright (c) 2021 Terminus, Inc. | ||
// | ||
// This program is free software: you can use, redistribute, and/or modify | ||
// it under the terms of the GNU Affero General Public License, version 3 | ||
// or later ("AGPL"), as published by the Free Software Foundation. | ||
// | ||
// This program is distributed in the hope that it will be useful, but WITHOUT | ||
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
// FITNESS FOR A PARTICULAR PURPOSE. | ||
// | ||
// You should have received a copy of the GNU Affero General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
package main | ||
|
||
import ( | ||
"github.com/erda-project/erda-infra/modcom" | ||
_ "github.com/erda-project/erda-infra/providers" | ||
_ "github.com/erda-project/erda/modules/cluster-init" | ||
) | ||
|
||
func main() { | ||
modcom.RunWithCfgDir("conf/cluster-init", "cluster-init") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cluster-init: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.