apiv1

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2024 License: GPL-3.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// K8sdAPIVersion is the path prefix that will be used for the k8sd endpoints for this api version.
	K8sdAPIVersion = "1.0"

	// AnnotationSkipCleanupKubernetesNodeOnRemove if set, only the microcluster & file cleanup is done.
	// This is useful, if an external controller (e.g. CAPI) is responsible for the Kubernetes node life cycle.
	// By default, the Kubernetes node is removed by k8sd if a node is removed from the cluster.
	AnnotationSkipCleanupKubernetesNodeOnRemove = "k8sd/v1alpha/lifecycle/skip-cleanup-kubernetes-node-on-remove"
)
View Source
const BootstrapClusterRPC = "k8sd/cluster"

BootstrapClusterRPC is the path for the BootstrapCluster RPC.

View Source
const ClusterAPIGetJoinTokenRPC = "x/capi/generate-join-token"

ClusterAPIGetJoinTokenRPC is the path for the ClusterAPIGetJoinToken RPC.

View Source
const ClusterAPIRemoveNodeRPC = "x/capi/remove-node"

ClusterAPIRemoveNodeRPC is the path for the ClusterAPIRemoveNode RPC.

View Source
const ClusterAPISetAuthTokenRPC = "x/capi/set-auth-token"

ClusterAPISetAuthTokenRPC is the path for the ClusterAPISetAuthToken RPC.

View Source
const ClusterStatusRPC = "k8sd/cluster"

ClusterStatusRPC is the path for the ClusterStatus RPC.

View Source
const GenerateKubernetesAuthTokenRPC = "kubernetes/auth/tokens"

GenerateKubernetesAuthTokenRPC is the path for the GenerateKubernetesAuthToken RPC.

View Source
const GetClusterConfigRPC = "k8sd/cluster/config"

GetClusterConfigRPC is the path for the GetClusterConfig RPC.

View Source
const GetJoinTokenRPC = "k8sd/cluster/tokens"

GetJoinTokenRPC is the path for the GetJoinToken RPC.

View Source
const GetWorkerJoinInfoRPC = "k8sd/worker/info"

GetWorkerJoinInfoRPC is the path for the GetWorkerJoinInfo RPC.

View Source
const JoinClusterRPC = "k8sd/cluster/join"

JoinClusterRPC is the path for the JoinCluster RPC.

View Source
const KubeConfigRPC = "k8sd/kubeconfig"

KubeConfigRPC is the path for the KubeConfig RPC.

View Source
const NodeStatusRPC = "k8sd/node"

NodeStatusRPC is the path for the NodeStatus RPC.

View Source
const RefreshCertificatesPlanRPC = "k8sd/refresh-certs/plan"

RefreshCertificatesPlanRPC is the path for the RefreshCertificatesPlan RPC.

View Source
const RefreshCertificatesRunRPC = "k8sd/refresh-certs/run"

RefreshCertificatesRunRPC is the path for the RefreshCertificatesRun RPC.

View Source
const RemoveNodeRPC = "k8sd/cluster/remove"

RemoveNodeRPC is the path for the RemoveNode RPC.

View Source
const RevokeKubernetesAuthTokenRPC = "kubernetes/auth/tokens"

RevokeKubernetesAuthTokenRPC is the path for the RevokeKubernetesAuthToken RPC.

View Source
const SetClusterConfigRPC = "k8sd/cluster/config"

SetClusterConfigRPC is the path for the SetClusterConfig RPC.

Variables

This section is empty.

Functions

This section is empty.

Types

type BootstrapClusterRequest

type BootstrapClusterRequest struct {
	Name    string          `json:"name"`
	Address string          `json:"address"`
	Config  BootstrapConfig `json:"config"`
	Timeout time.Duration   `json:"timeout"`
}

BootstrapClusterRequest is the request message for the BootstrapCluster RPC.

type BootstrapClusterResponse

type BootstrapClusterResponse NodeStatus

BootstrapClusterResponse is the response message for the BootstrapClusterRPC.

type BootstrapConfig

type BootstrapConfig struct {
	// ClusterConfig
	ClusterConfig UserFacingClusterConfig `json:"cluster-config,omitempty" yaml:"cluster-config,omitempty"`

	// Seed configuration for the control plane (flat on purpose). Empty values are ignored
	ControlPlaneTaints  []string `json:"control-plane-taints,omitempty" yaml:"control-plane-taints,omitempty"`
	PodCIDR             *string  `json:"pod-cidr,omitempty" yaml:"pod-cidr,omitempty"`
	ServiceCIDR         *string  `json:"service-cidr,omitempty" yaml:"service-cidr,omitempty"`
	DisableRBAC         *bool    `json:"disable-rbac,omitempty" yaml:"disable-rbac,omitempty"`
	SecurePort          *int     `json:"secure-port,omitempty" yaml:"secure-port,omitempty"`
	K8sDqlitePort       *int     `json:"k8s-dqlite-port,omitempty" yaml:"k8s-dqlite-port,omitempty"`
	DatastoreType       *string  `json:"datastore-type,omitempty" yaml:"datastore-type,omitempty"`
	DatastoreServers    []string `json:"datastore-servers,omitempty" yaml:"datastore-servers,omitempty"`
	DatastoreCACert     *string  `json:"datastore-ca-crt,omitempty" yaml:"datastore-ca-crt,omitempty"`
	DatastoreClientCert *string  `json:"datastore-client-crt,omitempty" yaml:"datastore-client-crt,omitempty"`
	DatastoreClientKey  *string  `json:"datastore-client-key,omitempty" yaml:"datastore-client-key,omitempty"`

	// Seed configuration for certificates
	ExtraSANs []string `json:"extra-sans,omitempty" yaml:"extra-sans,omitempty"`

	// Seed configuration for external certificates (cluster-wide)
	CACert                          *string `json:"ca-crt,omitempty" yaml:"ca-crt,omitempty"`
	CAKey                           *string `json:"ca-key,omitempty" yaml:"ca-key,omitempty"`
	ClientCACert                    *string `json:"client-ca-crt,omitempty" yaml:"client-ca-crt,omitempty"`
	ClientCAKey                     *string `json:"client-ca-key,omitempty" yaml:"client-ca-key,omitempty"`
	FrontProxyCACert                *string `json:"front-proxy-ca-crt,omitempty" yaml:"front-proxy-ca-crt,omitempty"`
	FrontProxyCAKey                 *string `json:"front-proxy-ca-key,omitempty" yaml:"front-proxy-ca-key,omitempty"`
	FrontProxyClientCert            *string `json:"front-proxy-client-crt,omitempty" yaml:"front-proxy-client-crt,omitempty"`
	FrontProxyClientKey             *string `json:"front-proxy-client-key,omitempty" yaml:"front-proxy-client-key,omitempty"`
	APIServerKubeletClientCert      *string `json:"apiserver-kubelet-client-crt,omitempty" yaml:"apiserver-kubelet-client-crt,omitempty"`
	APIServerKubeletClientKey       *string `json:"apiserver-kubelet-client-key,omitempty" yaml:"apiserver-kubelet-client-key,omitempty"`
	AdminClientCert                 *string `json:"admin-client-crt,omitempty" yaml:"admin-client-crt,omitempty"`
	AdminClientKey                  *string `json:"admin-client-key,omitempty" yaml:"admin-client-key,omitempty"`
	KubeProxyClientCert             *string `json:"kube-proxy-client-crt,omitempty" yaml:"kube-proxy-client-crt,omitempty"`
	KubeProxyClientKey              *string `json:"kube-proxy-client-key,omitempty" yaml:"kube-proxy-client-key,omitempty"`
	KubeSchedulerClientCert         *string `json:"kube-scheduler-client-crt,omitempty" yaml:"kube-scheduler-client-crt,omitempty"`
	KubeSchedulerClientKey          *string `json:"kube-scheduler-client-key,omitempty" yaml:"kube-scheduler-client-key,omitempty"`
	KubeControllerManagerClientCert *string `json:"kube-controller-manager-client-crt,omitempty" yaml:"kube-controller-manager-client-crt,omitempty"`
	KubeControllerManagerClientKey  *string `json:"kube-controller-manager-client-key,omitempty" yaml:"kube-ControllerManager-client-key,omitempty"`
	ServiceAccountKey               *string `json:"service-account-key,omitempty" yaml:"service-account-key,omitempty"`

	// Seed configuration for external certificates (node-specific)
	APIServerCert     *string `json:"apiserver-crt,omitempty" yaml:"apiserver-crt,omitempty"`
	APIServerKey      *string `json:"apiserver-key,omitempty" yaml:"apiserver-key,omitempty"`
	KubeletCert       *string `json:"kubelet-crt,omitempty" yaml:"kubelet-crt,omitempty"`
	KubeletKey        *string `json:"kubelet-key,omitempty" yaml:"kubelet-key,omitempty"`
	KubeletClientCert *string `json:"kubelet-client-crt,omitempty" yaml:"kubelet-client-crt,omitempty"`
	KubeletClientKey  *string `json:"kubelet-client-key,omitempty" yaml:"kubelet-client-key,omitempty"`

	// ExtraNodeConfigFiles will be written to /var/snap/k8s/common/args/conf.d
	ExtraNodeConfigFiles map[string]string `json:"extra-node-config-files,omitempty" yaml:"extra-node-config-files,omitempty"`

	// Extra args to add to individual services (set any arg to null to delete)
	ExtraNodeKubeAPIServerArgs         map[string]*string `json:"extra-node-kube-apiserver-args,omitempty" yaml:"extra-node-kube-apiserver-args,omitempty"`
	ExtraNodeKubeControllerManagerArgs map[string]*string `json:"extra-node-kube-controller-manager-args,omitempty" yaml:"extra-node-kube-controller-manager-args,omitempty"`
	ExtraNodeKubeSchedulerArgs         map[string]*string `json:"extra-node-kube-scheduler-args,omitempty" yaml:"extra-node-kube-scheduler-args,omitempty"`
	ExtraNodeKubeProxyArgs             map[string]*string `json:"extra-node-kube-proxy-args,omitempty" yaml:"extra-node-kube-proxy-args,omitempty"`
	ExtraNodeKubeletArgs               map[string]*string `json:"extra-node-kubelet-args,omitempty" yaml:"extra-node-kubelet-args,omitempty"`
	ExtraNodeContainerdArgs            map[string]*string `json:"extra-node-containerd-args,omitempty" yaml:"extra-node-containerd-args,omitempty"`
	ExtraNodeK8sDqliteArgs             map[string]*string `json:"extra-node-k8s-dqlite-args,omitempty" yaml:"extra-node-k8s-dqlite-args,omitempty"`

	// Extra configuration for the containerd config.toml
	ExtraNodeContainerdConfig MapStringAny `json:"extra-node-containerd-config,omitempty" yaml:"extra-node-containerd-config,omitempty"`
}

BootstrapConfig is used to seed cluster configuration when bootstrapping a new cluster.

func (*BootstrapConfig) GetAPIServerCert

func (b *BootstrapConfig) GetAPIServerCert() string

func (*BootstrapConfig) GetAPIServerKey

func (b *BootstrapConfig) GetAPIServerKey() string

func (*BootstrapConfig) GetAPIServerKubeletClientCert

func (b *BootstrapConfig) GetAPIServerKubeletClientCert() string

func (*BootstrapConfig) GetAPIServerKubeletClientKey

func (b *BootstrapConfig) GetAPIServerKubeletClientKey() string

func (*BootstrapConfig) GetAdminClientCert

func (b *BootstrapConfig) GetAdminClientCert() string

func (*BootstrapConfig) GetAdminClientKey

func (b *BootstrapConfig) GetAdminClientKey() string

func (*BootstrapConfig) GetCACert

func (b *BootstrapConfig) GetCACert() string

func (*BootstrapConfig) GetCAKey

func (b *BootstrapConfig) GetCAKey() string

func (*BootstrapConfig) GetClientCACert

func (b *BootstrapConfig) GetClientCACert() string

func (*BootstrapConfig) GetClientCAKey

func (b *BootstrapConfig) GetClientCAKey() string

func (*BootstrapConfig) GetDatastoreCACert

func (b *BootstrapConfig) GetDatastoreCACert() string

func (*BootstrapConfig) GetDatastoreClientCert

func (b *BootstrapConfig) GetDatastoreClientCert() string

func (*BootstrapConfig) GetDatastoreClientKey

func (b *BootstrapConfig) GetDatastoreClientKey() string

func (*BootstrapConfig) GetDatastoreType

func (b *BootstrapConfig) GetDatastoreType() string

func (*BootstrapConfig) GetFrontProxyCACert

func (b *BootstrapConfig) GetFrontProxyCACert() string

func (*BootstrapConfig) GetFrontProxyCAKey

func (b *BootstrapConfig) GetFrontProxyCAKey() string

func (*BootstrapConfig) GetFrontProxyClientCert

func (b *BootstrapConfig) GetFrontProxyClientCert() string

func (*BootstrapConfig) GetFrontProxyClientKey

func (b *BootstrapConfig) GetFrontProxyClientKey() string

func (*BootstrapConfig) GetK8sDqlitePort

func (b *BootstrapConfig) GetK8sDqlitePort() int

func (*BootstrapConfig) GetKubeControllerManagerClientCert

func (b *BootstrapConfig) GetKubeControllerManagerClientCert() string

func (*BootstrapConfig) GetKubeControllerManagerClientKey

func (b *BootstrapConfig) GetKubeControllerManagerClientKey() string

func (*BootstrapConfig) GetKubeProxyClientCert

func (b *BootstrapConfig) GetKubeProxyClientCert() string

func (*BootstrapConfig) GetKubeProxyClientKey

func (b *BootstrapConfig) GetKubeProxyClientKey() string

func (*BootstrapConfig) GetKubeSchedulerClientCert

func (b *BootstrapConfig) GetKubeSchedulerClientCert() string

func (*BootstrapConfig) GetKubeSchedulerClientKey

func (b *BootstrapConfig) GetKubeSchedulerClientKey() string

func (*BootstrapConfig) GetKubeletCert

func (b *BootstrapConfig) GetKubeletCert() string

func (*BootstrapConfig) GetKubeletClientCert

func (b *BootstrapConfig) GetKubeletClientCert() string

func (*BootstrapConfig) GetKubeletClientKey

func (b *BootstrapConfig) GetKubeletClientKey() string

func (*BootstrapConfig) GetKubeletKey

func (b *BootstrapConfig) GetKubeletKey() string

func (*BootstrapConfig) GetServiceAccountKey

func (b *BootstrapConfig) GetServiceAccountKey() string

type ClusterAPIGetJoinTokenRequest

type ClusterAPIGetJoinTokenRequest GetJoinTokenRequest

ClusterAPIGetJoinTokenRequest is the request message for the ClusterAPIGetJoinToken RPC (same as GetJoinToken).

type ClusterAPIGetJoinTokenResponse

type ClusterAPIGetJoinTokenResponse GetJoinTokenResponse

ClusterAPIGetJoinTokenResponse is the response message for the ClusterAPIGetJoinToken RPC (same as GetJoinToken).

type ClusterAPIRemoveNodeRequest

type ClusterAPIRemoveNodeRequest RemoveNodeRequest

ClusterAPIRemoveNodeRequest is the request message for the ClusterAPIRemoveNode RPC (same as RemoveNode).

type ClusterAPIRemoveNodeResponse

type ClusterAPIRemoveNodeResponse RemoveNodeResponse

ClusterAPIRemoveNodeResponse is the response message for the ClusterAPIRemoveNode RPC (same as RemoveNode).

type ClusterAPISetAuthTokenRequest

type ClusterAPISetAuthTokenRequest struct {
	Token string `json:"token"`
}

ClusterAPISetAuthTokenRequest is the request message for the ClusterAPISetAuthToken RPC.

type ClusterAPISetAuthTokenResponse

type ClusterAPISetAuthTokenResponse struct{}

ClusterAPISetAuthTokenResponse is the response message for the ClusterAPISetAuthToken RPC.

type ClusterRole

type ClusterRole string
const (
	ClusterRoleControlPlane ClusterRole = "control-plane"
	ClusterRoleWorker       ClusterRole = "worker"
	// The role of a node is unknown if it has not yet joined a cluster,
	// currently joining or is about to leave.
	ClusterRoleUnknown ClusterRole = "unknown"
)

type ClusterStatus

type ClusterStatus struct {
	// Ready is true if at least one node in the cluster is in READY state.
	Ready     bool                    `json:"ready,omitempty"`
	Members   []NodeStatus            `json:"members,omitempty"`
	Config    UserFacingClusterConfig `json:"config,omitempty"`
	Datastore Datastore               `json:"datastore,omitempty"`

	DNS           FeatureStatus `json:"dns,omitempty" yaml:"dns,omitempty"`
	Network       FeatureStatus `json:"network,omitempty" yaml:"network,omitempty"`
	LoadBalancer  FeatureStatus `json:"load-balancer,omitempty" yaml:"load-balancer,omitempty"`
	Ingress       FeatureStatus `json:"ingress,omitempty" yaml:"ingress,omitempty"`
	Gateway       FeatureStatus `json:"gateway,omitempty" yaml:"gateway,omitempty"`
	MetricsServer FeatureStatus `json:"metrics-server,omitempty" yaml:"metrics-server,omitempty"`
	LocalStorage  FeatureStatus `json:"local-storage,omitempty" yaml:"local-storage,omitempty"`
}

ClusterStatus holds information about the cluster, e.g. its current members

type ClusterStatusRequest

type ClusterStatusRequest struct{}

ClusterStatusRequest is the request message for the ClusterStatus RPC.

type ClusterStatusResponse

type ClusterStatusResponse struct {
	ClusterStatus ClusterStatus `json:"status"`
}

ClusterStatusResponse is the response message for the ClusterStatus RPC.

type ControlPlaneJoinConfig

type ControlPlaneJoinConfig struct {
	ExtraSANS []string `json:"extra-sans,omitempty" yaml:"extra-sans,omitempty"`

	// Seed certificates for external CA
	FrontProxyClientCert            *string `json:"front-proxy-client-crt,omitempty" yaml:"front-proxy-client-crt,omitempty"`
	FrontProxyClientKey             *string `json:"front-proxy-client-key,omitempty" yaml:"front-proxy-client-key,omitempty"`
	KubeProxyClientCert             *string `json:"kube-proxy-client-crt,omitempty" yaml:"kube-proxy-client-crt,omitempty"`
	KubeProxyClientKey              *string `json:"kube-proxy-client-key,omitempty" yaml:"kube-proxy-client-key,omitempty"`
	KubeSchedulerClientCert         *string `json:"kube-scheduler-client-crt,omitempty" yaml:"kube-scheduler-client-crt,omitempty"`
	KubeSchedulerClientKey          *string `json:"kube-scheduler-client-key,omitempty" yaml:"kube-scheduler-client-key,omitempty"`
	KubeControllerManagerClientCert *string `json:"kube-controller-manager-client-crt,omitempty" yaml:"kube-controller-manager-client-crt,omitempty"`
	KubeControllerManagerClientKey  *string `json:"kube-controller-manager-client-key,omitempty" yaml:"kube-ControllerManager-client-key,omitempty"`

	APIServerCert     *string `json:"apiserver-crt,omitempty" yaml:"apiserver-crt,omitempty"`
	APIServerKey      *string `json:"apiserver-key,omitempty" yaml:"apiserver-key,omitempty"`
	KubeletCert       *string `json:"kubelet-crt,omitempty" yaml:"kubelet-crt,omitempty"`
	KubeletKey        *string `json:"kubelet-key,omitempty" yaml:"kubelet-key,omitempty"`
	KubeletClientCert *string `json:"kubelet-client-crt,omitempty" yaml:"kubelet-client-crt,omitempty"`
	KubeletClientKey  *string `json:"kubelet-client-key,omitempty" yaml:"kubelet-client-key,omitempty"`

	// ExtraNodeConfigFiles will be written to /var/snap/k8s/common/args/conf.d
	ExtraNodeConfigFiles map[string]string `json:"extra-node-config-files,omitempty" yaml:"extra-node-config-files,omitempty"`

	// Extra args to add to individual services (set any arg to null to delete)
	ExtraNodeKubeAPIServerArgs         map[string]*string `json:"extra-node-kube-apiserver-args,omitempty" yaml:"extra-node-kube-apiserver-args,omitempty"`
	ExtraNodeKubeControllerManagerArgs map[string]*string `json:"extra-node-kube-controller-manager-args,omitempty" yaml:"extra-node-kube-controller-manager-args,omitempty"`
	ExtraNodeKubeSchedulerArgs         map[string]*string `json:"extra-node-kube-scheduler-args,omitempty" yaml:"extra-node-kube-scheduler-args,omitempty"`
	ExtraNodeKubeProxyArgs             map[string]*string `json:"extra-node-kube-proxy-args,omitempty" yaml:"extra-node-kube-proxy-args,omitempty"`
	ExtraNodeKubeletArgs               map[string]*string `json:"extra-node-kubelet-args,omitempty" yaml:"extra-node-kubelet-args,omitempty"`
	ExtraNodeContainerdArgs            map[string]*string `json:"extra-node-containerd-args,omitempty" yaml:"extra-node-containerd-args,omitempty"`
	ExtraNodeK8sDqliteArgs             map[string]*string `json:"extra-node-k8s-dqlite-args,omitempty" yaml:"extra-node-k8s-dqlite-args,omitempty"`

	// Extra configuration for the containerd config.toml
	ExtraNodeContainerdConfig MapStringAny `json:"extra-node-containerd-config,omitempty" yaml:"extra-node-containerd-config,omitempty"`
}

func (*ControlPlaneJoinConfig) GetAPIServerCert

func (c *ControlPlaneJoinConfig) GetAPIServerCert() string

func (*ControlPlaneJoinConfig) GetAPIServerKey

func (c *ControlPlaneJoinConfig) GetAPIServerKey() string

func (*ControlPlaneJoinConfig) GetFrontProxyClientCert

func (c *ControlPlaneJoinConfig) GetFrontProxyClientCert() string

func (*ControlPlaneJoinConfig) GetFrontProxyClientKey

func (c *ControlPlaneJoinConfig) GetFrontProxyClientKey() string

func (*ControlPlaneJoinConfig) GetKubeControllerManagerClientCert

func (b *ControlPlaneJoinConfig) GetKubeControllerManagerClientCert() string

func (*ControlPlaneJoinConfig) GetKubeControllerManagerClientKey

func (b *ControlPlaneJoinConfig) GetKubeControllerManagerClientKey() string

func (*ControlPlaneJoinConfig) GetKubeProxyClientCert

func (b *ControlPlaneJoinConfig) GetKubeProxyClientCert() string

func (*ControlPlaneJoinConfig) GetKubeProxyClientKey

func (b *ControlPlaneJoinConfig) GetKubeProxyClientKey() string

func (*ControlPlaneJoinConfig) GetKubeSchedulerClientCert

func (b *ControlPlaneJoinConfig) GetKubeSchedulerClientCert() string

func (*ControlPlaneJoinConfig) GetKubeSchedulerClientKey

func (b *ControlPlaneJoinConfig) GetKubeSchedulerClientKey() string

func (*ControlPlaneJoinConfig) GetKubeletCert

func (c *ControlPlaneJoinConfig) GetKubeletCert() string

func (*ControlPlaneJoinConfig) GetKubeletClientCert

func (c *ControlPlaneJoinConfig) GetKubeletClientCert() string

func (*ControlPlaneJoinConfig) GetKubeletClientKey

func (c *ControlPlaneJoinConfig) GetKubeletClientKey() string

func (*ControlPlaneJoinConfig) GetKubeletKey

func (c *ControlPlaneJoinConfig) GetKubeletKey() string

type DNSConfig

type DNSConfig struct {
	Enabled             *bool     `json:"enabled,omitempty" yaml:"enabled,omitempty"`
	ClusterDomain       *string   `json:"cluster-domain,omitempty" yaml:"cluster-domain,omitempty"`
	ServiceIP           *string   `json:"service-ip,omitempty" yaml:"service-ip,omitempty"`
	UpstreamNameservers *[]string `json:"upstream-nameservers,omitempty" yaml:"upstream-nameservers,omitempty"`
}

func (DNSConfig) GetClusterDomain

func (c DNSConfig) GetClusterDomain() string

func (DNSConfig) GetEnabled

func (c DNSConfig) GetEnabled() bool

func (DNSConfig) GetServiceIP

func (c DNSConfig) GetServiceIP() string

func (DNSConfig) GetUpstreamNameservers

func (c DNSConfig) GetUpstreamNameservers() []string

func (DNSConfig) String

func (c DNSConfig) String() string

type Datastore

type Datastore struct {
	Type    string   `json:"type,omitempty"`
	Servers []string `json:"servers,omitempty" yaml:"servers,omitempty"`
}

type DatastoreRole

type DatastoreRole string

DatastoreRole as provided by dqlite

const (
	DatastoreRoleVoter   DatastoreRole = "voter"
	DatastoreRoleStandBy DatastoreRole = "stand-by"
	DatastoreRoleSpare   DatastoreRole = "spare"
	DatastoreRolePending DatastoreRole = "PENDING"
	DatastoreRoleUnknown DatastoreRole = "unknown"
)

type FeatureStatus

type FeatureStatus struct {
	// Enabled shows whether or not the deployment of manifests for a status was successful.
	Enabled bool `json:"enabled" yaml:"enabled"`
	// Message contains information about the status of a feature. It is only supposed to be human readable and informative and should not be programmatically parsed.
	Message string `json:"message" yaml:"message"`
	// Version shows the version of the deployed feature.
	Version string `json:"version" yaml:"version"`
	// UpdatedAt shows when the last update was done.
	UpdatedAt time.Time `json:"updated-at" yaml:"updated-at"`
}

FeatureStatus encapsulates the deployment status of a feature.

func (FeatureStatus) String

func (f FeatureStatus) String() string

type GatewayConfig

type GatewayConfig struct {
	Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
}

func (GatewayConfig) GetEnabled

func (c GatewayConfig) GetEnabled() bool

func (GatewayConfig) String

func (c GatewayConfig) String() string

type GenerateKubernetesAuthTokenRequest

type GenerateKubernetesAuthTokenRequest struct {
	Username string   `json:"username"`
	Groups   []string `json:"groups"`
}

GenerateKubernetesAuthTokenRequest is the request message for the GenerateKubernetesAuthToken RPC.

type GenerateKubernetesAuthTokenResponse

type GenerateKubernetesAuthTokenResponse struct {
	Token string `json:"token"`
}

GenerateKubernetesAuthTokenResponse is the response message for the GenerateKubernetesAuthToken RPC.

type GetClusterConfigRequest

type GetClusterConfigRequest struct{}

GetClusterConfigRequest is the request message for the GetClusterConfig RPC.

type GetClusterConfigResponse

type GetClusterConfigResponse struct {
	Config UserFacingClusterConfig `json:"status"`
}

GetClusterConfigResponse is the response message for the GetClusterConfig RPC.

type GetJoinTokenRequest

type GetJoinTokenRequest struct {
	// Name is the name of the token to generate.
	Name string `json:"name"`
	// Worker should be set to true to generate a token for joining a worker node.
	Worker bool `json:"worker"`
	// TTL is the duration until the token expires (time-to-live).
	TTL time.Duration `json:"ttl,omitempty"`
}

GetJoinTokenRequest is the request message for the GetJoinToken RPC.

type GetJoinTokenResponse

type GetJoinTokenResponse struct {
	// EncodedToken is the generated join token.
	EncodedToken string `json:"token"`
}

GetJoinTokenResponse is the response message for the GetJoinToken RPC.

type GetWorkerJoinInfoRequest

type GetWorkerJoinInfoRequest struct {
	// Address is the address of the worker node.
	Address string `json:"address"`
}

GetWorkerJoinInfoRequest is the request message for the GetWorkerJoinInfo RPC.

type GetWorkerJoinInfoResponse

type GetWorkerJoinInfoResponse struct {
	// CACert is the PEM encoded certificate authority of the cluster.
	CACert string `json:"ca,omitempty"`
	// ClientCACert is the PEM encoded certificate authority of the cluster clients.
	ClientCACert string `json:"client-ca,omitempty"`
	// APIServers is a list of kube-apiserver endpoints of the cluster.
	APIServers []string `json:"apiServers"`
	// KubeletClientCert is the certificate to use in kubelet to authenticate with kube-apiserver.
	KubeletClientCert string `json:"kubeletClientCert"`
	// KubeletClientKey is the private key to use in kubelet to authenticate with kube-apiserver.
	KubeletClientKey string `json:"kubeletClientKey"`
	// KubeProxyClientCert is the certificate to use in kube-proxy to authenticate with kube-apiserver.
	KubeProxyClientCert string `json:"kubeProxyClientCert"`
	// KubeProxyClientKey is the private key to use in kube-proxy to authenticate with kube-apiserver.
	KubeProxyClientKey string `json:"kubeProxyClientKey"`
	// PodCIDR is the configured CIDR for pods in the cluster.
	PodCIDR string `json:"podCIDR"`
	// ServiceCIDR is the configured CIDR for services in the cluster.
	ServiceCIDR string `json:"serviceCIDR"`
	// ClusterDNS is the DNS server address of the cluster.
	ClusterDNS string `json:"clusterDNS,omitempty"`
	// ClusterDomain is the DNS domain of the cluster.
	ClusterDomain string `json:"clusterDomain,omitempty"`
	// CloudProvider is the cloud provider used in the cluster.
	CloudProvider string `json:"cloudProvider,omitempty"`
	// KubeletCert is the certificate to use for kubelet TLS. It will be empty if the cluster is not using self-signed certificates.
	KubeletCert string `json:"kubeletCrt,omitempty"`
	// KubeletKey is the private key to use for kubelet TLS. It will be empty if the cluster is not using self-signed certificates.
	KubeletKey string `json:"kubeletKey,omitempty"`
	// K8sdPublicKey is the public key that can be used to validate authenticity of cluster messages.
	K8sdPublicKey string `json:"k8sdPublicKey,omitempty"`
}

GetWorkerJoinInfoResponse is the response message for the GetWorkerJoinInfo RPC.

type IngressConfig

type IngressConfig struct {
	Enabled             *bool   `json:"enabled,omitempty" yaml:"enabled,omitempty"`
	DefaultTLSSecret    *string `json:"default-tls-secret,omitempty" yaml:"default-tls-secret,omitempty"`
	EnableProxyProtocol *bool   `json:"enable-proxy-protocol,omitempty" yaml:"enable-proxy-protocol,omitempty"`
}

func (IngressConfig) GetDefaultTLSSecret

func (c IngressConfig) GetDefaultTLSSecret() string

func (IngressConfig) GetEnableProxyProtocol

func (c IngressConfig) GetEnableProxyProtocol() bool

func (IngressConfig) GetEnabled

func (c IngressConfig) GetEnabled() bool

func (IngressConfig) String

func (c IngressConfig) String() string

type JoinClusterRequest

type JoinClusterRequest struct {
	// Name of the node that joins.
	Name string `json:"name"`
	// Address to use for microcluster on the joining node.
	Address string `json:"address"`
	// Token is the join token.
	Token string `json:"token"`
	// Config is JSON formatted string of a ControlPlaneJoinConfig (for control plane) or a WorkerJoinConfig (for worker nodes).
	Config string `json:"config"`
	// Timeout is how long to wait until the join is complete.
	Timeout time.Duration `json:"timeout"`
}

JoinClusterRequest is the request message for the JoinCluster RPC.

type JoinClusterResponse

type JoinClusterResponse struct{}

JoinClusterResponse is the response message for the JoinCluster RPC.

type KubeConfigRequest

type KubeConfigRequest struct {
	// Server is the server URL to use (e.g. in case of an external LoadBalancer endpoint).
	Server string `json:"server"`
}

KubeConfigRequest is the request message for the KubeConfig RPC.

type KubeConfigResponse

type KubeConfigResponse struct {
	// KubeConfig is an admin kubeconfig that can be used to access the cluster.
	KubeConfig string `json:"kubeconfig"`
}

KubeConfigResponse is the response message for the KubeConfig RPC.

type LoadBalancerConfig

type LoadBalancerConfig struct {
	Enabled        *bool     `json:"enabled,omitempty" yaml:"enabled,omitempty"`
	CIDRs          *[]string `json:"cidrs,omitempty" yaml:"cidrs,omitempty"`
	L2Mode         *bool     `json:"l2-mode,omitempty" yaml:"l2-mode,omitempty"`
	L2Interfaces   *[]string `json:"l2-interfaces,omitempty" yaml:"l2-interfaces,omitempty"`
	BGPMode        *bool     `json:"bgp-mode,omitempty" yaml:"bgp-mode,omitempty"`
	BGPLocalASN    *int      `json:"bgp-local-asn,omitempty" yaml:"bgp-local-asn,omitempty"`
	BGPPeerAddress *string   `json:"bgp-peer-address,omitempty" yaml:"bgp-peer-address,omitempty"`
	BGPPeerASN     *int      `json:"bgp-peer-asn,omitempty" yaml:"bgp-peer-asn,omitempty"`
	BGPPeerPort    *int      `json:"bgp-peer-port,omitempty" yaml:"bgp-peer-port,omitempty"`
}

func (LoadBalancerConfig) GetBGPLocalASN

func (c LoadBalancerConfig) GetBGPLocalASN() int

func (LoadBalancerConfig) GetBGPMode

func (c LoadBalancerConfig) GetBGPMode() bool

func (LoadBalancerConfig) GetBGPPeerASN

func (c LoadBalancerConfig) GetBGPPeerASN() int

func (LoadBalancerConfig) GetBGPPeerAddress

func (c LoadBalancerConfig) GetBGPPeerAddress() string

func (LoadBalancerConfig) GetBGPPeerPort

func (c LoadBalancerConfig) GetBGPPeerPort() int

func (LoadBalancerConfig) GetCIDRs

func (c LoadBalancerConfig) GetCIDRs() []string

func (LoadBalancerConfig) GetEnabled

func (c LoadBalancerConfig) GetEnabled() bool

func (LoadBalancerConfig) GetL2Interfaces

func (c LoadBalancerConfig) GetL2Interfaces() []string

func (LoadBalancerConfig) GetL2Mode

func (c LoadBalancerConfig) GetL2Mode() bool

func (LoadBalancerConfig) String

func (c LoadBalancerConfig) String() string

type LocalStorageConfig

type LocalStorageConfig struct {
	Enabled       *bool   `json:"enabled,omitempty" yaml:"enabled,omitempty"`
	LocalPath     *string `json:"local-path,omitempty" yaml:"local-path,omitempty"`
	ReclaimPolicy *string `json:"reclaim-policy,omitempty" yaml:"reclaim-policy,omitempty"`
	Default       *bool   `json:"default,omitempty" yaml:"default,omitempty"`
}

func (LocalStorageConfig) GetDefault

func (c LocalStorageConfig) GetDefault() bool

func (LocalStorageConfig) GetEnabled

func (c LocalStorageConfig) GetEnabled() bool

func (LocalStorageConfig) GetLocalPath

func (c LocalStorageConfig) GetLocalPath() string

func (LocalStorageConfig) GetReclaimPolicy

func (c LocalStorageConfig) GetReclaimPolicy() string

func (LocalStorageConfig) String

func (c LocalStorageConfig) String() string

type MapStringAny added in v1.0.2

type MapStringAny map[string]any

MapStringAny is a map[string]any that can be loaded from YAML.

func (*MapStringAny) UnmarshalYAML added in v1.0.2

func (dst *MapStringAny) UnmarshalYAML(f func(any) error) error

type MetricsServerConfig

type MetricsServerConfig struct {
	Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
}

func (MetricsServerConfig) GetEnabled

func (c MetricsServerConfig) GetEnabled() bool

func (MetricsServerConfig) String

func (c MetricsServerConfig) String() string

type NetworkConfig

type NetworkConfig struct {
	Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
}

func (NetworkConfig) GetEnabled

func (c NetworkConfig) GetEnabled() bool

func (NetworkConfig) String

func (c NetworkConfig) String() string

type NodeStatus

type NodeStatus struct {
	// Name is the name for this cluster member that was when joining the cluster.
	// This is typically the hostname of the node.
	Name string `json:"name,omitempty" yaml:"name,omitempty"`
	// Address is the IP address of the node.
	Address string `json:"address,omitempty" yaml:"address,omitempty"`
	// ClusterRole is the role that the node has within the k8s cluster.
	ClusterRole ClusterRole `json:"cluster-role,omitempty" yaml:"cluster-role,omitempty"`
	// DatastoreRole is the role that the node has within the datastore cluster.
	// Only applicable for control-plane nodes, empty for workers.
	DatastoreRole DatastoreRole `json:"datastore-role,omitempty" yaml:"datastore-role,omitempty"`
}

NodeStatus holds information about a node in the k8s cluster.

type NodeStatusRequest

type NodeStatusRequest struct{}

NodeStatusRequest is the request message for the NodeStatus RPC.

type NodeStatusResponse

type NodeStatusResponse struct {
	NodeStatus NodeStatus `json:"status"`
}

NodeStatusResponse is the response message for the NodeStatus RPC.

type RefreshCertificatesPlanRequest

type RefreshCertificatesPlanRequest struct{}

RefreshCertificatesPlanRequest is the request message for the RefreshCertificatesPlan RPC.

type RefreshCertificatesPlanResponse

type RefreshCertificatesPlanResponse struct {
	// Seed should be passed by clients to the RefreshCertificatesRun RPC.
	Seed int `json:"seconds"`
	// CertificateSigningRequests is a list of names of the CertificateSigningRequests that need to be signed externally (for worker nodes).
	CertificateSigningRequests []string `json:"certificate-signing-requests"`
}

RefreshCertificatesPlanResponse is the response message for the RefreshCertificatesPlan RPC.

type RefreshCertificatesRunRequest

type RefreshCertificatesRunRequest struct {
	// Seed must match the value returned by the RefreshCertificatesPlan RPC.
	Seed int `json:"seed"`
	// ExpirationSeconds is the desired duration of the new certificates.
	ExpirationSeconds int `json:"expiration-seconds"`
	// ExtraSANs is a list of extra SANs (DNS names or IP addresses) to add to the kube-apiserver certificates.
	// ExtraSANs is ignored for worker nodes.
	ExtraSANs []string `json:"extra-sans"`
}

RefreshCertificatesRunRequest is the request message for the RefreshCertificatesRun RPC.

type RefreshCertificatesRunResponse

type RefreshCertificatesRunResponse struct {
	// ExpirationSeconds is the duration of the new certificates (might not match the requested value).
	ExpirationSeconds int `json:"expiration-seconds"`
}

RefreshCertificatesRunResponse is the response message for the RefreshCertificatesRun RPC.

type RemoveNodeRequest

type RemoveNodeRequest struct {
	Name    string        `json:"name"`
	Force   bool          `json:"force"`
	Timeout time.Duration `json:"timeout"`
}

RemoveNodeRequest is the request message for the RemoveNode RPC.

type RemoveNodeResponse

type RemoveNodeResponse struct{}

RemoveNodeResponse is the response message for the RemoveNode RPC.

type RevokeKubernetesAuthTokenRequest

type RevokeKubernetesAuthTokenRequest struct {
	Token string `json:"token"`
}

RevokeKubernetesAuthTokenRequest is the request message for the RevokeKubernetesAuthToken RPC.

type RevokeKubernetesAuthTokenResponse

type RevokeKubernetesAuthTokenResponse struct{}

RevokeKubernetesAuthTokenResponse is the response message for the RevokeKubernetesAuthToken RPC.

type SetClusterConfigRequest

type SetClusterConfigRequest struct {
	Config    UserFacingClusterConfig   `json:"config,omitempty" yaml:"config,omitempty"`
	Datastore UserFacingDatastoreConfig `json:"datastore,omitempty" yaml:"datastore,omitempty"`
}

SetClusterConfigRequest is the request message for the SetClusterConfig RPC.

type SetClusterConfigResponse

type SetClusterConfigResponse struct{}

SetClusterConfigResponse is the response message for the SetClusterConfig RPC.

type TokenReview

type TokenReview struct {
	APIVersion string            `json:"apiVersion"`
	Kind       string            `json:"kind"`
	Spec       TokenReviewSpec   `json:"spec"`
	Status     TokenReviewStatus `json:"status"`
}

TokenReviewRequest is the request for "POST 1.0/kubernetes/auth/webhook". This mirrors the definition of the Kubernetes API group="authentication.k8s.io/v1" kind="TokenReview" https://kubernetes.io/docs/reference/kubernetes-api/authentication-resources/token-review-v1/

type TokenReviewSpec

type TokenReviewSpec struct {
	Audiences []string `json:"audiences,omitempty"`
	Token     string   `json:"token"`
}

TokenReviewSpec is set by kube-apiserver in TokenReview. This mirrors the definition of the Kubernetes API group="authentication.k8s.io/v1" kind="TokenReview" https://kubernetes.io/docs/reference/kubernetes-api/authentication-resources/token-review-v1/#TokenReviewSpec

type TokenReviewStatus

type TokenReviewStatus struct {
	Audiences     []string                  `json:"audiences,omitempty"`
	Authenticated bool                      `json:"authenticated"`
	Error         string                    `json:"error,omitempty"`
	User          TokenReviewStatusUserInfo `json:"user,omitempty"`
}

TokenReviewStatus is set by the webhook server in TokenReview. This mirrors the definition of the Kubernetes API group="authentication.k8s.io/v1" kind="TokenReview" https://kubernetes.io/docs/reference/kubernetes-api/authentication-resources/token-review-v1/#TokenReviewStatus

type TokenReviewStatusUserInfo

type TokenReviewStatusUserInfo struct {
	Extra    map[string][]string `json:"extra,omitempty"`
	Groups   []string            `json:"groups,omitempty"`
	Username string              `json:"username,omitempty"`
	UID      string              `json:"uid,omitempty"`
}

TokenReviewStatusUserInfo is set by the webhook server in TokenReview. This mirrors the definition of the Kubernetes API group="authentication.k8s.io/v1" kind="TokenReview" https://kubernetes.io/docs/reference/kubernetes-api/authentication-resources/token-review-v1/#TokenReviewStatus

type UserFacingClusterConfig

type UserFacingClusterConfig struct {
	Network       NetworkConfig       `json:"network,omitempty" yaml:"network,omitempty"`
	DNS           DNSConfig           `json:"dns,omitempty" yaml:"dns,omitempty"`
	Ingress       IngressConfig       `json:"ingress,omitempty" yaml:"ingress,omitempty"`
	LoadBalancer  LoadBalancerConfig  `json:"load-balancer,omitempty" yaml:"load-balancer,omitempty"`
	LocalStorage  LocalStorageConfig  `json:"local-storage,omitempty" yaml:"local-storage,omitempty"`
	Gateway       GatewayConfig       `json:"gateway,omitempty" yaml:"gateway,omitempty"`
	MetricsServer MetricsServerConfig `json:"metrics-server,omitempty" yaml:"metrics-server,omitempty"`
	CloudProvider *string             `json:"cloud-provider,omitempty" yaml:"cloud-provider,omitempty"`
	Annotations   map[string]string   `json:"annotations,omitempty" yaml:"annotations,omitempty"`
}

func (UserFacingClusterConfig) String

func (c UserFacingClusterConfig) String() string

type UserFacingDatastoreConfig

type UserFacingDatastoreConfig struct {
	// Type of the datastore. Needs to be "external".
	Type       *string   `json:"type,omitempty" yaml:"type,omitempty"`
	Servers    *[]string `json:"servers,omitempty" yaml:"servers,omitempty"`
	CACert     *string   `json:"ca-crt,omitempty" yaml:"ca-crt,omitempty"`
	ClientCert *string   `json:"client-crt,omitempty" yaml:"client-crt,omitempty"`
	ClientKey  *string   `json:"client-key,omitempty" yaml:"client-key,omitempty"`
}

func (UserFacingDatastoreConfig) GetCACert

func (c UserFacingDatastoreConfig) GetCACert() string

func (UserFacingDatastoreConfig) GetClientCert

func (c UserFacingDatastoreConfig) GetClientCert() string

func (UserFacingDatastoreConfig) GetClientKey

func (c UserFacingDatastoreConfig) GetClientKey() string

func (UserFacingDatastoreConfig) GetServers

func (c UserFacingDatastoreConfig) GetServers() []string

func (UserFacingDatastoreConfig) GetType

func (c UserFacingDatastoreConfig) GetType() string

type WorkerJoinConfig

type WorkerJoinConfig struct {
	KubeletCert         *string `json:"kubelet-crt,omitempty" yaml:"kubelet-crt,omitempty"`
	KubeletKey          *string `json:"kubelet-key,omitempty" yaml:"kubelet-key,omitempty"`
	KubeletClientCert   *string `json:"kubelet-client-crt,omitempty" yaml:"kubelet-client-crt,omitempty"`
	KubeletClientKey    *string `json:"kubelet-client-key,omitempty" yaml:"kubelet-client-key,omitempty"`
	KubeProxyClientCert *string `json:"kube-proxy-client-crt,omitempty" yaml:"kube-proxy-client-crt,omitempty"`
	KubeProxyClientKey  *string `json:"kube-proxy-client-key,omitempty" yaml:"kube-proxy-client-key,omitempty"`

	// ExtraNodeConfigFiles will be written to /var/snap/k8s/common/args/conf.d
	ExtraNodeConfigFiles map[string]string `json:"extra-node-config-files,omitempty" yaml:"extra-node-config-files,omitempty"`

	// Extra args to add to individual services (set any arg to null to delete)
	ExtraNodeKubeProxyArgs         map[string]*string `json:"extra-node-kube-proxy-args,omitempty" yaml:"extra-node-kube-proxy-args,omitempty"`
	ExtraNodeKubeletArgs           map[string]*string `json:"extra-node-kubelet-args,omitempty" yaml:"extra-node-kubelet-args,omitempty"`
	ExtraNodeContainerdArgs        map[string]*string `json:"extra-node-containerd-args,omitempty" yaml:"extra-node-containerd-args,omitempty"`
	ExtraNodeK8sAPIServerProxyArgs map[string]*string `json:"extra-node-k8s-apiserver-proxy-args,omitempty" yaml:"extra-node-k8s-apiserver-proxy-args,omitempty"`

	// Extra configuration for the containerd config.toml
	ExtraNodeContainerdConfig MapStringAny `json:"extra-node-containerd-config,omitempty" yaml:"extra-node-containerd-config,omitempty"`
}

func (*WorkerJoinConfig) GetKubeProxyClientCert

func (w *WorkerJoinConfig) GetKubeProxyClientCert() string

func (*WorkerJoinConfig) GetKubeProxyClientKey

func (w *WorkerJoinConfig) GetKubeProxyClientKey() string

func (*WorkerJoinConfig) GetKubeletCert

func (w *WorkerJoinConfig) GetKubeletCert() string

func (*WorkerJoinConfig) GetKubeletClientCert

func (w *WorkerJoinConfig) GetKubeletClientCert() string

func (*WorkerJoinConfig) GetKubeletClientKey

func (w *WorkerJoinConfig) GetKubeletClientKey() string

func (*WorkerJoinConfig) GetKubeletKey

func (w *WorkerJoinConfig) GetKubeletKey() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL