2022-03-22 15:03:15 +00:00
|
|
|
package pubapi
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"github.com/edgelesssys/constellation/coordinator/peer"
|
2022-06-13 14:23:19 +00:00
|
|
|
"github.com/edgelesssys/constellation/coordinator/pubapi/pubproto"
|
2022-04-13 07:18:32 +00:00
|
|
|
"github.com/edgelesssys/constellation/coordinator/role"
|
2022-03-22 15:03:15 +00:00
|
|
|
"github.com/edgelesssys/constellation/coordinator/state"
|
2022-06-15 14:00:48 +00:00
|
|
|
attestationtypes "github.com/edgelesssys/constellation/internal/attestation/types"
|
2022-05-16 15:32:00 +00:00
|
|
|
"github.com/edgelesssys/constellation/internal/deploy/ssh"
|
2022-06-29 14:13:01 +00:00
|
|
|
kms "github.com/edgelesssys/constellation/kms/setup"
|
2022-03-22 15:03:15 +00:00
|
|
|
kubeadm "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta3"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Core interface {
|
|
|
|
GetVPNPubKey() ([]byte, error)
|
|
|
|
SetVPNIP(string) error
|
2022-04-13 10:39:55 +00:00
|
|
|
GetVPNIP() (string, error)
|
2022-03-30 12:28:14 +00:00
|
|
|
InitializeStoreIPs() error
|
|
|
|
GetNextNodeIP() (string, error)
|
2022-04-13 10:39:55 +00:00
|
|
|
GetNextCoordinatorIP() (string, error)
|
2022-03-22 15:03:15 +00:00
|
|
|
SwitchToPersistentStore() error
|
|
|
|
GetIDs(masterSecret []byte) (ownerID []byte, clusterID []byte, err error)
|
2022-04-28 08:10:02 +00:00
|
|
|
PersistNodeState(role role.Role, vpnIP string, ownerID []byte, clusterID []byte) error
|
2022-03-22 15:03:15 +00:00
|
|
|
SetUpKMS(ctx context.Context, storageURI, kmsURI, kekID string, useExisting bool) error
|
2022-04-20 13:22:39 +00:00
|
|
|
GetKMSInfo() (kms.KMSInformation, error)
|
2022-04-12 12:24:36 +00:00
|
|
|
GetDataKey(ctx context.Context, keyID string, length int) ([]byte, error)
|
2022-04-20 09:38:56 +00:00
|
|
|
GetDiskUUID() (string, error)
|
|
|
|
UpdateDiskPassphrase(passphrase string) error
|
2022-03-22 15:03:15 +00:00
|
|
|
|
|
|
|
GetState() state.State
|
|
|
|
RequireState(...state.State) error
|
|
|
|
AdvanceState(newState state.State, ownerID, clusterID []byte) error
|
|
|
|
|
|
|
|
GetPeers(resourceVersion int) (int, []peer.Peer, error)
|
|
|
|
AddPeer(peer.Peer) error
|
2022-04-13 10:39:55 +00:00
|
|
|
AddPeerToStore(peer.Peer) error
|
|
|
|
AddPeerToVPN(peer.Peer) error
|
2022-03-22 15:03:15 +00:00
|
|
|
UpdatePeers([]peer.Peer) error
|
|
|
|
|
2022-05-16 15:32:00 +00:00
|
|
|
CreateSSHUsers([]ssh.UserKey) error
|
|
|
|
|
2022-06-15 14:00:48 +00:00
|
|
|
InitCluster(
|
|
|
|
ctx context.Context, autoscalingNodeGroups []string, cloudServiceAccountURI string, id attestationtypes.ID, masterSecret []byte, sshUserKeys []*pubproto.SSHUserKey,
|
|
|
|
) ([]byte, error)
|
2022-05-24 08:04:42 +00:00
|
|
|
JoinCluster(ctx context.Context, joinToken *kubeadm.BootstrapTokenDiscovery, certificateKey string, role role.Role) error
|
2022-03-22 15:03:15 +00:00
|
|
|
}
|