Deploy KMS server image in Constellation

Add image pull secret for ghcr.io
This commit is contained in:
Christoph Meyer 2022-04-12 14:07:17 +00:00 committed by cm
parent 4dcb3aa062
commit db5468a886
22 changed files with 384 additions and 33 deletions

View file

@ -1,17 +0,0 @@
package cmd
const (
// wireguardAdminMTU is the MTU designated for the admin's WireGuard interface.
//
// WireGuard doesn't support Path MTU Discovery. Thus, its default MTU can be too high on some networks.
wireguardAdminMTU = 1300
// masterSecretLengthDefault is the default length in bytes for CLI generated master secrets.
masterSecretLengthDefault = 32
// masterSecretLengthMin is the minimal length in bytes for user provided master secrets.
masterSecretLengthMin = 16
// constellationNameLength is the maximum length of a Constellation's name.
constellationNameLength = 37
)

View file

@ -133,10 +133,10 @@ func parseCreateFlags(cmd *cobra.Command, provider cloudprovider.Provider) (crea
if err != nil {
return createFlags{}, err
}
if len(name) > constellationNameLength {
if len(name) > constants.ConstellationNameLength {
return createFlags{}, fmt.Errorf(
"name for Constellation cluster too long, maximum length is %d, got %d: %s",
constellationNameLength, len(name), name,
constants.ConstellationNameLength, len(name), name,
)
}

View file

@ -103,7 +103,7 @@ func TestCreate(t *testing.T) {
provider: cloudprovider.GCP,
controllerCountFlag: intPtr(1),
workerCountFlag: intPtr(1),
nameFlag: strings.Repeat("a", constellationNameLength+1),
nameFlag: strings.Repeat("a", constants.ConstellationNameLength+1),
wantErr: true,
},
"flag control-plane-count invalid": {

View file

@ -153,7 +153,7 @@ func initialize(ctx context.Context, cmd *cobra.Command, protCl protoClient, ser
return err
}
vpnConfig, err := vpnHandler.Create(result.coordinatorPubKey, result.coordinatorPubIP, string(flags.userPrivKey), result.clientVpnIP, wireguardAdminMTU)
vpnConfig, err := vpnHandler.Create(result.coordinatorPubKey, result.coordinatorPubIP, string(flags.userPrivKey), result.clientVpnIP, constants.WireguardAdminMTU)
if err != nil {
return err
}
@ -374,14 +374,14 @@ func readOrGeneratedMasterSecret(w io.Writer, fileHandler file.Handler, filename
if err != nil {
return nil, err
}
if len(decoded) < masterSecretLengthMin {
if len(decoded) < constants.MasterSecretLengthMin {
return nil, errors.New("provided master secret is smaller than the required minimum of 16 Bytes")
}
return decoded, nil
}
// No file given, generate a new secret, and save it to disk
masterSecret, err := util.GenerateRandomBytes(masterSecretLengthDefault)
masterSecret, err := util.GenerateRandomBytes(constants.MasterSecretLengthDefault)
if err != nil {
return nil, err
}