mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-06 16:25:21 -04:00
Use 'Constellation cluster' in UI
This commit is contained in:
parent
1189078c5a
commit
0e63ee0c4a
9 changed files with 28 additions and 28 deletions
|
@ -16,7 +16,7 @@ import (
|
||||||
"github.com/edgelesssys/constellation/internal/config"
|
"github.com/edgelesssys/constellation/internal/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
const warningStr = "Warning: not verifying the Constellation's %s measurements\n"
|
const warningStr = "Warning: not verifying the Constellation cluster's %s measurements\n"
|
||||||
|
|
||||||
type Validators struct {
|
type Validators struct {
|
||||||
provider cloudprovider.Provider
|
provider cloudprovider.Provider
|
||||||
|
|
|
@ -19,8 +19,8 @@ import (
|
||||||
func newCreateCmd() *cobra.Command {
|
func newCreateCmd() *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "create {aws|gcp|azure}",
|
Use: "create {aws|gcp|azure}",
|
||||||
Short: "Create instances on a cloud platform for your Constellation.",
|
Short: "Create instances on a cloud platform for your Constellation cluster.",
|
||||||
Long: "Create instances on a cloud platform for your Constellation.",
|
Long: "Create instances on a cloud platform for your Constellation cluster.",
|
||||||
Args: cobra.MatchAll(
|
Args: cobra.MatchAll(
|
||||||
cobra.ExactArgs(1),
|
cobra.ExactArgs(1),
|
||||||
isCloudProvider(0),
|
isCloudProvider(0),
|
||||||
|
@ -66,15 +66,15 @@ func create(cmd *cobra.Command, creator cloudCreator, fileHandler file.Handler,
|
||||||
|
|
||||||
if !flags.yes {
|
if !flags.yes {
|
||||||
// Ask user to confirm action.
|
// Ask user to confirm action.
|
||||||
cmd.Printf("The following Constellation will be created:\n")
|
cmd.Printf("The following Constellation cluster will be created:\n")
|
||||||
cmd.Printf("%d control-planes nodes of type %s will be created.\n", flags.controllerCount, flags.insType)
|
cmd.Printf("%d control-planes nodes of type %s will be created.\n", flags.controllerCount, flags.insType)
|
||||||
cmd.Printf("%d worker nodes of type %s will be created.\n", flags.workerCount, flags.insType)
|
cmd.Printf("%d worker nodes of type %s will be created.\n", flags.workerCount, flags.insType)
|
||||||
ok, err := askToConfirm(cmd, "Do you want to create this Constellation?")
|
ok, err := askToConfirm(cmd, "Do you want to create this cluster?")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if !ok {
|
if !ok {
|
||||||
cmd.Println("The creation of the Constellation was aborted.")
|
cmd.Println("The creation of the cluster was aborted.")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@ func create(cmd *cobra.Command, creator cloudCreator, fileHandler file.Handler,
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd.Println("Your Constellation was created successfully.")
|
cmd.Println("Your Constellation cluster was created successfully.")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ func parseCreateFlags(cmd *cobra.Command, provider cloudprovider.Provider) (crea
|
||||||
}
|
}
|
||||||
if len(name) > constellationNameLength {
|
if len(name) > constellationNameLength {
|
||||||
return createFlags{}, fmt.Errorf(
|
return createFlags{}, fmt.Errorf(
|
||||||
"name for Constellation too long, maximum length is %d, got %d: %s",
|
"name for Constellation cluster too long, maximum length is %d, got %d: %s",
|
||||||
constellationNameLength, len(name), name,
|
constellationNameLength, len(name), name,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,17 +34,17 @@ import (
|
||||||
func newInitCmd() *cobra.Command {
|
func newInitCmd() *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "init",
|
Use: "init",
|
||||||
Short: "Initialize the Constellation. Start your confidential Kubernetes cluster.",
|
Short: "Initialize the Constellation cluster. Start your confidential Kubernetes.",
|
||||||
Long: "Initialize the Constellation. Start your confidential Kubernetes cluster.",
|
Long: "Initialize the Constellation cluster. Start your confidential Kubernetes.",
|
||||||
ValidArgsFunction: initCompletion,
|
ValidArgsFunction: initCompletion,
|
||||||
Args: cobra.ExactArgs(0),
|
Args: cobra.ExactArgs(0),
|
||||||
RunE: runInitialize,
|
RunE: runInitialize,
|
||||||
}
|
}
|
||||||
cmd.Flags().String("privatekey", "", "path to your private key.")
|
cmd.Flags().String("privatekey", "", "Path to your private key.")
|
||||||
cmd.Flags().String("master-secret", "", "path to base64 encoded master secret.")
|
cmd.Flags().String("master-secret", "", "Path to base64 encoded master secret.")
|
||||||
cmd.Flags().Bool("wg-autoconfig", false, "enable automatic configuration of WireGuard interface")
|
cmd.Flags().Bool("wg-autoconfig", false, "Enable automatic configuration of WireGuard interface.")
|
||||||
must(cmd.Flags().MarkHidden("wg-autoconfig"))
|
must(cmd.Flags().MarkHidden("wg-autoconfig"))
|
||||||
cmd.Flags().Bool("autoscale", false, "enable Kubernetes cluster-autoscaler")
|
cmd.Flags().Bool("autoscale", false, "Enable Kubernetes cluster-autoscaler.")
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,8 +242,8 @@ func (r activationResult) writeOutput(wr io.Writer, fileHandler file.Handler) er
|
||||||
writeRow(tw, "Your WireGuard IP", r.clientVpnIP)
|
writeRow(tw, "Your WireGuard IP", r.clientVpnIP)
|
||||||
writeRow(tw, "Control plane's public IP", r.coordinatorPubIP)
|
writeRow(tw, "Control plane's public IP", r.coordinatorPubIP)
|
||||||
writeRow(tw, "Control plane's public key", r.coordinatorPubKey)
|
writeRow(tw, "Control plane's public key", r.coordinatorPubKey)
|
||||||
writeRow(tw, "Constellation's owner identifier", r.ownerID)
|
writeRow(tw, "Constellation cluster's owner identifier", r.ownerID)
|
||||||
writeRow(tw, "Constellation's unique identifier", r.clusterID)
|
writeRow(tw, "Constellation cluster's unique identifier", r.clusterID)
|
||||||
writeRow(tw, "WireGuard configuration file", constants.WGQuickConfigFilename)
|
writeRow(tw, "WireGuard configuration file", constants.WGQuickConfigFilename)
|
||||||
writeRow(tw, "Kubernetes configuration", constants.AdminConfFilename)
|
writeRow(tw, "Kubernetes configuration", constants.AdminConfFilename)
|
||||||
tw.Flush()
|
tw.Flush()
|
||||||
|
@ -253,7 +253,7 @@ func (r activationResult) writeOutput(wr io.Writer, fileHandler file.Handler) er
|
||||||
return fmt.Errorf("write kubeconfig: %w", err)
|
return fmt.Errorf("write kubeconfig: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Fprintln(wr, "You can now connect to your Constellation cluster by executing:")
|
fmt.Fprintln(wr, "You can now connect to your cluster by executing:")
|
||||||
fmt.Fprintf(wr, "\twg-quick up ./%s\n", constants.WGQuickConfigFilename)
|
fmt.Fprintf(wr, "\twg-quick up ./%s\n", constants.WGQuickConfigFilename)
|
||||||
fmt.Fprintf(wr, "\texport KUBECONFIG=\"$PWD/%s\"\n", constants.AdminConfFilename)
|
fmt.Fprintf(wr, "\texport KUBECONFIG=\"$PWD/%s\"\n", constants.AdminConfFilename)
|
||||||
return nil
|
return nil
|
||||||
|
@ -462,7 +462,7 @@ func getGCPInstances(stat state.ConstellationState, config *config.Config) (coor
|
||||||
func getAzureInstances(stat state.ConstellationState, config *config.Config) (coordinators, nodes ScalingGroup, err error) {
|
func getAzureInstances(stat state.ConstellationState, config *config.Config) (coordinators, nodes ScalingGroup, err error) {
|
||||||
coordinatorMap := stat.AzureCoordinators
|
coordinatorMap := stat.AzureCoordinators
|
||||||
if len(coordinatorMap) == 0 {
|
if len(coordinatorMap) == 0 {
|
||||||
return ScalingGroup{}, ScalingGroup{}, errors.New("no control-plane nodes available, can't create Constellation without any instance")
|
return ScalingGroup{}, ScalingGroup{}, errors.New("no control-plane nodes available, can't create Constellation cluster without any instance")
|
||||||
}
|
}
|
||||||
var coordinatorInstances Instances
|
var coordinatorInstances Instances
|
||||||
for _, node := range coordinatorMap {
|
for _, node := range coordinatorMap {
|
||||||
|
|
|
@ -25,8 +25,8 @@ var diskUUIDRegexp = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA
|
||||||
func newRecoverCmd() *cobra.Command {
|
func newRecoverCmd() *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "recover",
|
Use: "recover",
|
||||||
Short: "Recover a Constellation.",
|
Short: "Recover a Constellation cluster.",
|
||||||
Long: "Recover a Constellation by sending a recovery key to an instance in the boot stage." +
|
Long: "Recover a Constellation cluster by sending a recovery key to an instance in the boot stage." +
|
||||||
"\nThis is only required if instances restart without other instances available for bootstrapping.",
|
"\nThis is only required if instances restart without other instances available for bootstrapping.",
|
||||||
Args: cobra.ExactArgs(0),
|
Args: cobra.ExactArgs(0),
|
||||||
RunE: runRecover,
|
RunE: runRecover,
|
||||||
|
|
|
@ -18,8 +18,8 @@ import (
|
||||||
func newTerminateCmd() *cobra.Command {
|
func newTerminateCmd() *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "terminate",
|
Use: "terminate",
|
||||||
Short: "Terminate an existing Constellation.",
|
Short: "Terminate an existing Constellation cluster.",
|
||||||
Long: "Terminate an existing Constellation. The Constellation can't be started again, and all persistent storage will be lost.",
|
Long: "Terminate an existing Constellation cluster. The cluster can't be started again, and all persistent storage will be lost.",
|
||||||
Args: cobra.NoArgs,
|
Args: cobra.NoArgs,
|
||||||
RunE: runTerminate,
|
RunE: runTerminate,
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ func terminate(cmd *cobra.Command, terminator cloudTerminator, fileHandler file.
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd.Println("Your Constellation was terminated successfully.")
|
cmd.Println("Your Constellation cluster was terminated successfully.")
|
||||||
|
|
||||||
var retErr error
|
var retErr error
|
||||||
if err := fileHandler.Remove(constants.StateFilename); err != nil {
|
if err := fileHandler.Remove(constants.StateFilename); err != nil {
|
||||||
|
|
|
@ -93,7 +93,7 @@ func parseVerifyFlags(cmd *cobra.Command) (verifyFlags, error) {
|
||||||
return verifyFlags{}, err
|
return verifyFlags{}, err
|
||||||
}
|
}
|
||||||
if ownerID == "" && clusterID == "" {
|
if ownerID == "" && clusterID == "" {
|
||||||
return verifyFlags{}, errors.New("neither owner ID nor unique ID provided to verify the Constellation")
|
return verifyFlags{}, errors.New("neither owner ID nor unique ID provided to verify the cluster")
|
||||||
}
|
}
|
||||||
|
|
||||||
endpoint, err := cmd.Flags().GetString("node-endpoint")
|
endpoint, err := cmd.Flags().GetString("node-endpoint")
|
||||||
|
|
|
@ -18,7 +18,7 @@ func (c *Client) CreateSecurityGroup(ctx context.Context, input SecurityGroupInp
|
||||||
|
|
||||||
id := uuid.New()
|
id := uuid.New()
|
||||||
createInput := &awsec2.CreateSecurityGroupInput{
|
createInput := &awsec2.CreateSecurityGroupInput{
|
||||||
Description: aws.String("Security group of Constellation. This group was generated through the Constellation CLI."),
|
Description: aws.String("Security group of Constellation cluster. This group was generated through the Constellation CLI."),
|
||||||
GroupName: aws.String("Constellation-" + id.String()),
|
GroupName: aws.String("Constellation-" + id.String()),
|
||||||
DryRun: aws.Bool(true),
|
DryRun: aws.Bool(true),
|
||||||
}
|
}
|
||||||
|
|
|
@ -311,13 +311,13 @@ type insertInstanceTemplateInput struct {
|
||||||
func (i insertInstanceTemplateInput) insertInstanceTemplateRequest() *computepb.InsertInstanceTemplateRequest {
|
func (i insertInstanceTemplateInput) insertInstanceTemplateRequest() *computepb.InsertInstanceTemplateRequest {
|
||||||
req := computepb.InsertInstanceTemplateRequest{
|
req := computepb.InsertInstanceTemplateRequest{
|
||||||
InstanceTemplateResource: &computepb.InstanceTemplate{
|
InstanceTemplateResource: &computepb.InstanceTemplate{
|
||||||
Description: proto.String("This instance belongs to a Constellation."),
|
Description: proto.String("This instance belongs to a Constellation cluster."),
|
||||||
Name: proto.String(i.Name),
|
Name: proto.String(i.Name),
|
||||||
Properties: &computepb.InstanceProperties{
|
Properties: &computepb.InstanceProperties{
|
||||||
ConfidentialInstanceConfig: &computepb.ConfidentialInstanceConfig{
|
ConfidentialInstanceConfig: &computepb.ConfidentialInstanceConfig{
|
||||||
EnableConfidentialCompute: proto.Bool(true),
|
EnableConfidentialCompute: proto.Bool(true),
|
||||||
},
|
},
|
||||||
Description: proto.String("This instance belongs to a Constellation."),
|
Description: proto.String("This instance belongs to a Constellation cluster."),
|
||||||
Disks: []*computepb.AttachedDisk{
|
Disks: []*computepb.AttachedDisk{
|
||||||
{
|
{
|
||||||
InitializeParams: &computepb.AttachedDiskInitializeParams{
|
InitializeParams: &computepb.AttachedDiskInitializeParams{
|
||||||
|
|
|
@ -15,7 +15,7 @@ func (c *Client) CreateServiceAccount(ctx context.Context, input ServiceAccountI
|
||||||
Project: c.project,
|
Project: c.project,
|
||||||
AccountID: "constellation-app-" + c.uid,
|
AccountID: "constellation-app-" + c.uid,
|
||||||
DisplayName: "constellation-app-" + c.uid,
|
DisplayName: "constellation-app-" + c.uid,
|
||||||
Description: "This service account belongs to a Constellation.",
|
Description: "This service account belongs to a Constellation cluster.",
|
||||||
}
|
}
|
||||||
|
|
||||||
email, err := c.insertServiceAccount(ctx, insertInput)
|
email, err := c.insertServiceAccount(ctx, insertInput)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue