2022-03-22 11:03:15 -04:00
|
|
|
package pubapi
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2022-04-20 09:22:39 -04:00
|
|
|
"github.com/edgelesssys/constellation/coordinator/kms"
|
2022-03-22 11:03:15 -04:00
|
|
|
"github.com/edgelesssys/constellation/coordinator/peer"
|
2022-04-13 03:18:32 -04:00
|
|
|
"github.com/edgelesssys/constellation/coordinator/role"
|
2022-03-22 11:03:15 -04:00
|
|
|
"github.com/edgelesssys/constellation/coordinator/state"
|
|
|
|
kubeadm "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta3"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Core interface {
|
|
|
|
GetVPNPubKey() ([]byte, error)
|
|
|
|
SetVPNIP(string) error
|
2022-04-13 06:39:55 -04:00
|
|
|
GetVPNIP() (string, error)
|
2022-03-30 08:28:14 -04:00
|
|
|
InitializeStoreIPs() error
|
|
|
|
GetNextNodeIP() (string, error)
|
2022-04-13 06:39:55 -04:00
|
|
|
GetNextCoordinatorIP() (string, error)
|
2022-03-22 11:03:15 -04:00
|
|
|
SwitchToPersistentStore() error
|
|
|
|
GetIDs(masterSecret []byte) (ownerID []byte, clusterID []byte, err error)
|
2022-04-13 03:18:32 -04:00
|
|
|
PersistNodeState(role role.Role, ownerID []byte, clusterID []byte) error
|
2022-03-22 11:03:15 -04:00
|
|
|
SetUpKMS(ctx context.Context, storageURI, kmsURI, kekID string, useExisting bool) error
|
2022-04-20 09:22:39 -04:00
|
|
|
GetKMSInfo() (kms.KMSInformation, error)
|
2022-04-12 08:24:36 -04:00
|
|
|
GetDataKey(ctx context.Context, keyID string, length int) ([]byte, error)
|
2022-04-20 05:38:56 -04:00
|
|
|
GetDiskUUID() (string, error)
|
|
|
|
UpdateDiskPassphrase(passphrase string) error
|
2022-03-22 11:03:15 -04: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 06:39:55 -04:00
|
|
|
AddPeerToStore(peer.Peer) error
|
|
|
|
AddPeerToVPN(peer.Peer) error
|
2022-03-22 11:03:15 -04:00
|
|
|
UpdatePeers([]peer.Peer) error
|
|
|
|
|
2022-03-25 05:42:27 -04:00
|
|
|
InitCluster(autoscalingNodeGroups []string, cloudServiceAccountURI string) ([]byte, error)
|
2022-03-22 11:03:15 -04:00
|
|
|
JoinCluster(kubeadm.BootstrapTokenDiscovery) error
|
|
|
|
}
|