apiv1

package
v1.0.15 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 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.
	//
	// Deprecated: Use the respective annotation from annotations package instead.
	AnnotationSkipCleanupKubernetesNodeOnRemove = "k8sd/v1alpha/lifecycle/skip-cleanup-kubernetes-node-on-remove"

	// AnnotationSkipStopServicesOnRemove if set, the k8s services will not be stopped on the leaving node when removing the node.
	// This is useful, if an external controller (e.g. CAPI) is responsible for the Kubernetes node life cycle.
	// By default, all services are stopped on leaving nodes.
	//
	// Deprecated: Use the respective annotation from annotations package instead.
	AnnotationSkipStopServicesOnRemove = "k8sd/v1alpha/lifecycle/skip-stop-services-on-remove"
)
View Source
const BootstrapClusterRPC = "k8sd/cluster"

BootstrapClusterRPC is the path for the BootstrapCluster RPC.

View Source
const ClusterAPIApproveWorkerCSRRPC = "x/capi/refresh-certs/approve"
View Source
const ClusterAPICertificatesExpiryRPC = "x/capi/certificates-expiry"

ClusterAPICertificatesExpiryRPC is the path for the ClusterAPICertificatesExpiry RPC.

View Source
const ClusterAPICertificatesPlanRPC = "x/capi/refresh-certs/plan"
View Source
const ClusterAPICertificatesRunRPC = "x/capi/refresh-certs/run"
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 ReviewKubernetesAuthTokenRPC string = "kubernetes/auth/webhook"

ReviewKubernetesAuthTokenRPC is the path for the ReviewKubernetesAuthToken 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.

View Source
const SnapRefreshRPC = "snap/refresh"

SnapRefreshRPC is the path for the SnapRefresh RPC.

View Source
const SnapRefreshStatusRPC = "snap/refresh-status"

SnapRefreshRPC is the path for the SnapRefresh 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 UserFacingClusterConfig `json:"cluster-config,omitempty" yaml:"cluster-config,omitempty"`

	// List of taints to be applied to control plane nodes.
	ControlPlaneTaints []string `json:"control-plane-taints,omitempty" yaml:"control-plane-taints,omitempty"`
	// The CIDR to be used for assigning pod addresses.
	// If omitted defaults to `10.1.0.0/16`.
	PodCIDR *string `json:"pod-cidr,omitempty" yaml:"pod-cidr,omitempty"`
	// The CIDR to be used for assigning service addresses.
	// If omitted defaults to `10.152.183.0/24`.
	ServiceCIDR *string `json:"service-cidr,omitempty" yaml:"service-cidr,omitempty"`
	// Determines if RBAC should be disabled.
	// If omitted defaults to `false`.
	DisableRBAC *bool `json:"disable-rbac,omitempty" yaml:"disable-rbac,omitempty"`
	// The port number for kube-apiserver to use.
	// If omitted defaults to `6443`.
	SecurePort *int `json:"secure-port,omitempty" yaml:"secure-port,omitempty"`
	// The port number for k8s-dqlite to use.
	// If omitted defaults to `9000`.
	K8sDqlitePort *int `json:"k8s-dqlite-port,omitempty" yaml:"k8s-dqlite-port,omitempty"`
	// The type of datastore to be used.
	// If omitted defaults to `k8s-dqlite`.
	//
	// Can be used to point to an external datastore like etcd.
	//
	// Possible Values: `k8s-dqlite | external`.
	DatastoreType *string `json:"datastore-type,omitempty" yaml:"datastore-type,omitempty"`
	// The server addresses to be used when `datastore-type` is set to `external`.
	DatastoreServers []string `json:"datastore-servers,omitempty" yaml:"datastore-servers,omitempty"`
	// The CA certificate to be used when communicating with the external datastore.
	DatastoreCACert *string `json:"datastore-ca-crt,omitempty" yaml:"datastore-ca-crt,omitempty"`
	// The client certificate to be used when communicating with the external
	// datastore.
	DatastoreClientCert *string `json:"datastore-client-crt,omitempty" yaml:"datastore-client-crt,omitempty"`
	// The client key to be used when communicating with the external datastore.
	DatastoreClientKey *string `json:"datastore-client-key,omitempty" yaml:"datastore-client-key,omitempty"`

	// List of extra SANs to be added to certificates.
	ExtraSANs []string `json:"extra-sans,omitempty" yaml:"extra-sans,omitempty"`

	// The CA certificate to be used for Kubernetes services.
	// If omitted defaults to an auto generated certificate.
	CACert *string `json:"ca-crt,omitempty" yaml:"ca-crt,omitempty"`
	// The CA key to be used for Kubernetes services.
	// If omitted defaults to an auto generated key.
	CAKey *string `json:"ca-key,omitempty" yaml:"ca-key,omitempty"`
	// The client CA certificate to be used for Kubernetes services.
	// If omitted defaults to an auto generated certificate.
	ClientCACert *string `json:"client-ca-crt,omitempty" yaml:"client-ca-crt,omitempty"`
	// The client CA key to be used for Kubernetes services.
	// If omitted defaults to an auto generated key.
	ClientCAKey *string `json:"client-ca-key,omitempty" yaml:"client-ca-key,omitempty"`
	// The CA certificate to be used for the front proxy.
	// If omitted defaults to an auto generated certificate.
	FrontProxyCACert *string `json:"front-proxy-ca-crt,omitempty" yaml:"front-proxy-ca-crt,omitempty"`
	// The CA key to be used for the front proxy.
	// If omitted defaults to an auto generated key.
	FrontProxyCAKey *string `json:"front-proxy-ca-key,omitempty" yaml:"front-proxy-ca-key,omitempty"`
	// The client certificate to be used for the front proxy.
	// If omitted defaults to an auto generated certificate.
	FrontProxyClientCert *string `json:"front-proxy-client-crt,omitempty" yaml:"front-proxy-client-crt,omitempty"`
	// The client key to be used for the front proxy.
	// If omitted defaults to an auto generated key.
	FrontProxyClientKey *string `json:"front-proxy-client-key,omitempty" yaml:"front-proxy-client-key,omitempty"`
	// The client certificate to be used by kubelet for communicating with the kube-apiserver.
	// If omitted defaults to an auto generated certificate.
	APIServerKubeletClientCert *string `json:"apiserver-kubelet-client-crt,omitempty" yaml:"apiserver-kubelet-client-crt,omitempty"`
	// The client key to be used by kubelet for communicating with the kube-apiserver.
	// If omitted defaults to an auto generated key.
	APIServerKubeletClientKey *string `json:"apiserver-kubelet-client-key,omitempty" yaml:"apiserver-kubelet-client-key,omitempty"`

	// The admin client certificate to be used for Kubernetes services.
	// If omitted defaults to an auto generated certificate.
	AdminClientCert *string `json:"admin-client-crt,omitempty" yaml:"admin-client-crt,omitempty"`
	// The admin client key to be used for Kubernetes services.
	// If omitted defaults to an auto generated key.
	AdminClientKey *string `json:"admin-client-key,omitempty" yaml:"admin-client-key,omitempty"`
	// The client certificate to be used for the kube-proxy.
	// If omitted defaults to an auto generated certificate.
	KubeProxyClientCert *string `json:"kube-proxy-client-crt,omitempty" yaml:"kube-proxy-client-crt,omitempty"`
	// The client key to be used for the kube-proxy.
	// If omitted defaults to an auto generated key.
	KubeProxyClientKey *string `json:"kube-proxy-client-key,omitempty" yaml:"kube-proxy-client-key,omitempty"`
	// The client certificate to be used for the kube-scheduler.
	// If omitted defaults to an auto generated certificate.
	KubeSchedulerClientCert *string `json:"kube-scheduler-client-crt,omitempty" yaml:"kube-scheduler-client-crt,omitempty"`
	// The client key to be used for the kube-scheduler.
	// If omitted defaults to an auto generated key.
	KubeSchedulerClientKey *string `json:"kube-scheduler-client-key,omitempty" yaml:"kube-scheduler-client-key,omitempty"`
	// The client certificate to be used for the Kubernetes controller manager.
	// If omitted defaults to an auto generated certificate.
	KubeControllerManagerClientCert *string `json:"kube-controller-manager-client-crt,omitempty" yaml:"kube-controller-manager-client-crt,omitempty"`
	// The client key to be used for the Kubernetes controller manager.
	// If omitted defaults to an auto generated key.
	KubeControllerManagerClientKey *string `json:"kube-controller-manager-client-key,omitempty" yaml:"kube-ControllerManager-client-key,omitempty"`
	// The key to be used by the default service account.
	// If omitted defaults to an auto generated key.
	ServiceAccountKey *string `json:"service-account-key,omitempty" yaml:"service-account-key,omitempty"`

	// The certificate to be used for the kube-apiserver.
	// If omitted defaults to an auto generated certificate.
	APIServerCert *string `json:"apiserver-crt,omitempty" yaml:"apiserver-crt,omitempty"`
	// The key to be used for the kube-apiserver.
	// If omitted defaults to an auto generated key.
	APIServerKey *string `json:"apiserver-key,omitempty" yaml:"apiserver-key,omitempty"`
	// The certificate to be used for the kubelet.
	// If omitted defaults to an auto generated certificate.
	KubeletCert *string `json:"kubelet-crt,omitempty" yaml:"kubelet-crt,omitempty"`
	// The key to be used for the kubelet.
	// If omitted defaults to an auto generated key.
	KubeletKey *string `json:"kubelet-key,omitempty" yaml:"kubelet-key,omitempty"`
	// The certificate to be used for the kubelet client.
	// If omitted defaults to an auto generated certificate.
	KubeletClientCert *string `json:"kubelet-client-crt,omitempty" yaml:"kubelet-client-crt,omitempty"`
	// The key to be used for the kubelet client.
	// If omitted defaults to an auto generated key.
	KubeletClientKey *string `json:"kubelet-client-key,omitempty" yaml:"kubelet-client-key,omitempty"`

	// Additional files that are uploaded `/var/snap/k8s/common/args/conf.d/<filename>`
	// to a node on bootstrap. These files can then be referenced by Kubernetes
	// service arguments.
	//
	// The format is `map[<filename>]<filecontent>`.
	ExtraNodeConfigFiles map[string]string `json:"extra-node-config-files,omitempty" yaml:"extra-node-config-files,omitempty"`

	// Additional arguments that are passed to the `kube-apiserver` only for that specific node.
	// A parameter that is explicitly set to `null` is deleted.
	// The format is `map[<--flag-name>]<value>`.
	ExtraNodeKubeAPIServerArgs map[string]*string `json:"extra-node-kube-apiserver-args,omitempty" yaml:"extra-node-kube-apiserver-args,omitempty"`
	// Additional arguments that are passed to the `kube-controller-manager` only for that specific node.
	// A parameter that is explicitly set to `null` is deleted.
	// The format is `map[<--flag-name>]<value>`.
	ExtraNodeKubeControllerManagerArgs map[string]*string `json:"extra-node-kube-controller-manager-args,omitempty" yaml:"extra-node-kube-controller-manager-args,omitempty"`
	// Additional arguments that are passed to the `kube-scheduler` only for that specific node.
	// A parameter that is explicitly set to `null` is deleted.
	// The format is `map[<--flag-name>]<value>`.
	ExtraNodeKubeSchedulerArgs map[string]*string `json:"extra-node-kube-scheduler-args,omitempty" yaml:"extra-node-kube-scheduler-args,omitempty"`
	// Additional arguments that are passed to the `kube-proxy` only for that specific node.
	// A parameter that is explicitly set to `null` is deleted.
	// The format is `map[<--flag-name>]<value>`.
	ExtraNodeKubeProxyArgs map[string]*string `json:"extra-node-kube-proxy-args,omitempty" yaml:"extra-node-kube-proxy-args,omitempty"`
	// Additional arguments that are passed to the `kubelet` only for that specific node.
	// A parameter that is explicitly set to `null` is deleted.
	// The format is `map[<--flag-name>]<value>`.
	ExtraNodeKubeletArgs map[string]*string `json:"extra-node-kubelet-args,omitempty" yaml:"extra-node-kubelet-args,omitempty"`
	// Additional arguments that are passed to `containerd` only for that specific node.
	// A parameter that is explicitly set to `null` is deleted.
	// The format is `map[<--flag-name>]<value>`.
	ExtraNodeContainerdArgs map[string]*string `json:"extra-node-containerd-args,omitempty" yaml:"extra-node-containerd-args,omitempty"`
	// Additional arguments that are passed to `k8s-dqlite` only for that specific node.
	// A parameter that is explicitly set to `null` is deleted.
	// The format is `map[<--flag-name>]<value>`.
	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"`

	// The base directory in which the containerd-related files are located.
	ContainerdBaseDir string `json:"containerd-base-dir,omitempty" yaml:"containerd-base-dir,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 CertificatesExpiryRequest added in v1.0.7

type CertificatesExpiryRequest struct{}

CertificatesExpiryRequest is the request message for the CertificatesExpiry RPC.

type CertificatesExpiryResponse added in v1.0.7

type CertificatesExpiryResponse struct {
	// ExpiryDate is the expiry date of the certificates on the node in RFC3339 format.
	ExpiryDate string `json:"expiry-date"`
}

CertificatesExpiryResponse is the response message for the CertificatesExpiry RPC.

type ClusterAPIApproveWorkerCSRRequest added in v1.0.10

type ClusterAPIApproveWorkerCSRRequest struct {
	Seed int `json:"seed"`
}

ClusterAPIApproveWorkerCSRRequest is the request message for the ClusterAPIApproveWorkerCSR RPC.

type ClusterAPIApproveWorkerCSRResponse added in v1.0.10

type ClusterAPIApproveWorkerCSRResponse struct{}

ClusterAPIApproveWorkerCSRResponse is the response message for the ClusterAPIApproveWorkerCSR RPC.

type ClusterAPICertificatesPlanRequest added in v1.0.8

type ClusterAPICertificatesPlanRequest RefreshCertificatesPlanRequest

ClusterAPICertificatesPlanRequest is the request message for the ClusterAPICertificatesPlan RPC (same as RefreshCertificatesPlan).

type ClusterAPICertificatesPlanResponse added in v1.0.8

type ClusterAPICertificatesPlanResponse RefreshCertificatesPlanResponse

ClusterAPICertificatesPlanResponse is the response message for the ClusterAPICertificatesPlan RPC (same as RefreshCertificatesPlan).

type ClusterAPICertificatesRunRequest added in v1.0.8

type ClusterAPICertificatesRunRequest RefreshCertificatesRunRequest

ClusterAPICertificatesRunRequest is the request message for the ClusterAPICertificatesRun RPC (same as RefreshCertificatesRun).

type ClusterAPICertificatesRunResponse added in v1.0.8

type ClusterAPICertificatesRunResponse RefreshCertificatesRunResponse

ClusterAPICertificatesRunResponse is the response message for the ClusterAPICertificatesRun RPC (same as RefreshCertificatesRun).

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 {
	// List of extra SANs to be added to certificates.
	ExtraSANS []string `json:"extra-sans,omitempty" yaml:"extra-sans,omitempty"`

	// The client certificate to be used for the front proxy.
	// If omitted defaults to an auto generated certificate.
	FrontProxyClientCert *string `json:"front-proxy-client-crt,omitempty" yaml:"front-proxy-client-crt,omitempty"`
	// The client key to be used for the front proxy.
	// If omitted defaults to an auto generated key.
	FrontProxyClientKey *string `json:"front-proxy-client-key,omitempty" yaml:"front-proxy-client-key,omitempty"`
	// The client certificate to be used by kubelet for communicating with the kube-apiserver.
	// If omitted defaults to an auto generated certificate.
	KubeProxyClientCert *string `json:"kube-proxy-client-crt,omitempty" yaml:"kube-proxy-client-crt,omitempty"`
	// The client key to be used by kubelet for communicating with the kube-apiserver.
	// If omitted defaults to an auto generated key.
	KubeProxyClientKey *string `json:"kube-proxy-client-key,omitempty" yaml:"kube-proxy-client-key,omitempty"`
	// The client certificate to be used for the kube-scheduler.
	// If omitted defaults to an auto generated certificate.
	KubeSchedulerClientCert *string `json:"kube-scheduler-client-crt,omitempty" yaml:"kube-scheduler-client-crt,omitempty"`
	// The client key to be used for the kube-scheduler.
	// If omitted defaults to an auto generated key.
	KubeSchedulerClientKey *string `json:"kube-scheduler-client-key,omitempty" yaml:"kube-scheduler-client-key,omitempty"`
	// The client certificate to be used for the Kubernetes controller manager.
	// If omitted defaults to an auto generated certificate.
	KubeControllerManagerClientCert *string `json:"kube-controller-manager-client-crt,omitempty" yaml:"kube-controller-manager-client-crt,omitempty"`
	// The client key to be used for the Kubernetes controller manager.
	// If omitted defaults to an auto generated key.
	KubeControllerManagerClientKey *string `json:"kube-controller-manager-client-key,omitempty" yaml:"kube-ControllerManager-client-key,omitempty"`

	// The certificate to be used for the kube-apiserver.
	// If omitted defaults to an auto generated certificate.
	APIServerCert *string `json:"apiserver-crt,omitempty" yaml:"apiserver-crt,omitempty"`
	// The key to be used for the kube-apiserver.
	// If omitted defaults to an auto generated key.
	APIServerKey *string `json:"apiserver-key,omitempty" yaml:"apiserver-key,omitempty"`
	// The certificate to be used for the kubelet.
	// If omitted defaults to an auto generated certificate.
	KubeletCert *string `json:"kubelet-crt,omitempty" yaml:"kubelet-crt,omitempty"`
	// The key to be used for the kubelet.
	// If omitted defaults to an auto generated key.
	KubeletKey *string `json:"kubelet-key,omitempty" yaml:"kubelet-key,omitempty"`
	// The client certificate to be used for the kubelet.
	// If omitted defaults to an auto generated certificate.
	KubeletClientCert *string `json:"kubelet-client-crt,omitempty" yaml:"kubelet-client-crt,omitempty"`
	// The client key to be used for the kubelet.
	// If omitted defaults to an auto generated key.
	KubeletClientKey *string `json:"kubelet-client-key,omitempty" yaml:"kubelet-client-key,omitempty"`

	// Additional files that are uploaded `/var/snap/k8s/common/args/conf.d/<filename>`
	// to a node on bootstrap. These files can then be referenced by Kubernetes
	// service arguments.
	//
	// The format is `map[<filename>]<filecontent>`.
	ExtraNodeConfigFiles map[string]string `json:"extra-node-config-files,omitempty" yaml:"extra-node-config-files,omitempty"`

	// Additional arguments that are passed to the `kube-apiserver` only for that specific node.
	// A parameter that is explicitly set to `null` is deleted.
	// The format is `map[<--flag-name>]<value>`.
	ExtraNodeKubeAPIServerArgs map[string]*string `json:"extra-node-kube-apiserver-args,omitempty" yaml:"extra-node-kube-apiserver-args,omitempty"`
	// Additional arguments that are passed to the `kube-controller-manager` only for that specific node.
	// A parameter that is explicitly set to `null` is deleted.
	// The format is `map[<--flag-name>]<value>`.
	ExtraNodeKubeControllerManagerArgs map[string]*string `json:"extra-node-kube-controller-manager-args,omitempty" yaml:"extra-node-kube-controller-manager-args,omitempty"`
	// Additional arguments that are passed to the `kube-scheduler` only for that specific node.
	// A parameter that is explicitly set to `null` is deleted.
	// The format is `map[<--flag-name>]<value>`.
	ExtraNodeKubeSchedulerArgs map[string]*string `json:"extra-node-kube-scheduler-args,omitempty" yaml:"extra-node-kube-scheduler-args,omitempty"`
	// Additional arguments that are passed to the `kube-proxy` only for that specific node.
	// A parameter that is explicitly set to `null` is deleted.
	// The format is `map[<--flag-name>]<value>`.
	ExtraNodeKubeProxyArgs map[string]*string `json:"extra-node-kube-proxy-args,omitempty" yaml:"extra-node-kube-proxy-args,omitempty"`
	// Additional arguments that are passed to the `kubelet` only for that specific node.
	// A parameter that is explicitly set to `null` is deleted.
	// The format is `map[<--flag-name>]<value>`.
	ExtraNodeKubeletArgs map[string]*string `json:"extra-node-kubelet-args,omitempty" yaml:"extra-node-kubelet-args,omitempty"`
	// Additional arguments that are passed to `containerd` only for that specific node.
	// A parameter that is explicitly set to `null` is deleted.
	// The format is `map[<--flag-name>]<value>`.
	ExtraNodeContainerdArgs map[string]*string `json:"extra-node-containerd-args,omitempty" yaml:"extra-node-containerd-args,omitempty"`
	// Additional arguments that are passed to `k8s-dqlite` only for that specific node.
	// A parameter that is explicitly set to `null` is deleted.
	// The format is `map[<--flag-name>]<value>`.
	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"`

	// The base directory in which the containerd-related files are located.
	ContainerdBaseDir string `json:"containerd-base-dir,omitempty" yaml:"containerd-base-dir,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 {
	// Determines if the feature should be enabled.
	// If omitted defaults to `true`
	Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
	// Sets the local domain of the cluster.
	// If omitted defaults to `cluster.local`.
	ClusterDomain *string `json:"cluster-domain,omitempty" yaml:"cluster-domain,omitempty"`
	// Sets the IP address of the dns service. If omitted defaults to the IP address
	// of the Kubernetes service created by the feature.
	//
	// Can be used to point to an external dns server when feature is disabled.
	ServiceIP *string `json:"service-ip,omitempty" yaml:"service-ip,omitempty"`
	// Sets the upstream nameservers used to forward queries for out-of-cluster
	// endpoints.
	//
	// If omitted defaults to `/etc/resolv.conf` and uses the nameservers of the node.
	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 {
	// Determines if the feature should be enabled.
	// If omitted defaults to `true`.
	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"`
	// Annotations is a map of strings that can be used to store arbitrary metadata configuration.
	// Please refer to the ClusterAPI annotations reference for further details on these options.
	Annotations map[string]string `json:"annotations,omitempty"`
}

GetWorkerJoinInfoResponse is the response message for the GetWorkerJoinInfo RPC.

type IngressConfig

type IngressConfig struct {
	// Determines if the feature should be enabled.
	// If omitted defaults to `false`
	Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
	// Sets the name of the secret to be used for providing default encryption to
	// ingresses.
	//
	// Ingresses can specify another TLS secret in their resource definitions,
	// in which case the default secret won't be used.
	DefaultTLSSecret *string `json:"default-tls-secret,omitempty" yaml:"default-tls-secret,omitempty"`
	// Determines if the proxy protocol should be enabled for ingresses.
	// If omitted defaults to `false`.
	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 {
	// Determines if the feature should be enabled.
	// If omitted defaults to `false`.
	Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
	// Sets the CIDRs used for assigning IP addresses to Kubernetes services with type
	// `LoadBalancer`.
	CIDRs *[]string `json:"cidrs,omitempty" yaml:"cidrs,omitempty"`
	// Determines if L2 mode should be enabled.
	// If omitted defaults to `false`.
	L2Mode *bool `json:"l2-mode,omitempty" yaml:"l2-mode,omitempty"`
	// Sets the interfaces to be used for announcing IP addresses through ARP.
	// If omitted all interfaces will be used.
	L2Interfaces *[]string `json:"l2-interfaces,omitempty" yaml:"l2-interfaces,omitempty"`
	// Determines if BGP mode should be enabled.
	// If omitted defaults to `false`.
	BGPMode *bool `json:"bgp-mode,omitempty" yaml:"bgp-mode,omitempty"`
	// Sets the ASN to be used for the local virtual BGP router.
	// Required if bgp-mode is true.
	BGPLocalASN *int `json:"bgp-local-asn,omitempty" yaml:"bgp-local-asn,omitempty"`
	// Sets the IP address of the BGP peer.
	// Required if bgp-mode is true.
	BGPPeerAddress *string `json:"bgp-peer-address,omitempty" yaml:"bgp-peer-address,omitempty"`
	// Sets the ASN of the BGP peer.
	// Required if bgp-mode is true.
	BGPPeerASN *int `json:"bgp-peer-asn,omitempty" yaml:"bgp-peer-asn,omitempty"`
	// Sets the port of the BGP peer.
	// Required if bgp-mode is true.
	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 {
	// Determines if the feature should be enabled.
	// If omitted defaults to `false`.
	Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
	// Sets the path to be used for storing volume data.
	// If omitted defaults to `/var/snap/k8s/common/rawfile-storage`
	LocalPath *string `json:"local-path,omitempty" yaml:"local-path,omitempty"`
	// Sets the reclaim policy of the storage class.
	// If omitted defaults to `Delete`.
	// Possible values: `Retain | Recycle | Delete`
	ReclaimPolicy *string `json:"reclaim-policy,omitempty" yaml:"reclaim-policy,omitempty"`
	// Determines if the storage class should be set as default.
	// If omitted defaults to `true`
	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 {
	// Determines if the feature should be enabled.
	// If omitted defaults to `true`.
	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 {
	// Determines if the feature should be enabled.
	// If omitted defaults to `true`
	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 SnapRefreshRequest added in v1.0.4

type SnapRefreshRequest struct {
	// Channel is the channel to refresh the snap to.
	Channel string `json:"channel"`
	// Revision is the revision number to refresh the snap to.
	Revision string `json:"revision"`
	// LocalPath is the local path to use to refresh the snap.
	LocalPath string `json:"localPath"`
}

SnapRefreshRequest is the request message for the SnapRefresh RPC.

type SnapRefreshResponse added in v1.0.5

type SnapRefreshResponse struct {
	// The change id belonging to a snap refresh/install operation.
	ChangeID string `json:"changeId"`
}

SnapRefreshResponse is the response message for the SnapRefresh RPC.

type SnapRefreshStatusRequest added in v1.0.5

type SnapRefreshStatusRequest struct {
	// The change id belonging to a snap refresh/install operation.
	ChangeID string `json:"changeId"`
}

SnapRefreshStatusRequest is the request message for the SnapRefreshStatus RPC.

type SnapRefreshStatusResponse added in v1.0.5

type SnapRefreshStatusResponse struct {
	// Status is the status of the snap refresh/install operation.
	Status string `json:"status"`
	// Completed is a boolean indicating if the snap refresh/install operation has completed.
	// The status should be considered final when this is true.
	Completed bool `json:"completed"`
	// ErrorMessage is the error message if the snap refresh/install operation failed.
	ErrorMessage string `json:"errorMessage"`
}

SnapRefreshStatusResponse is the response message for the SnapRefreshStatus 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 {
	// Configuration options for the network feature.
	Network NetworkConfig `json:"network,omitempty" yaml:"network,omitempty"`
	// Configuration options for the dns feature.
	DNS DNSConfig `json:"dns,omitempty" yaml:"dns,omitempty"`
	// Configuration options for the ingress feature.
	Ingress IngressConfig `json:"ingress,omitempty" yaml:"ingress,omitempty"`
	// Configuration options for the load-balancer feature.
	LoadBalancer LoadBalancerConfig `json:"load-balancer,omitempty" yaml:"load-balancer,omitempty"`
	// Configuration options for the local-storage feature.
	LocalStorage LocalStorageConfig `json:"local-storage,omitempty" yaml:"local-storage,omitempty"`
	// Configuration options for the gateway feature.
	Gateway GatewayConfig `json:"gateway,omitempty" yaml:"gateway,omitempty"`
	// Configuration options for the metric server feature.
	MetricsServer MetricsServerConfig `json:"metrics-server,omitempty" yaml:"metrics-server,omitempty"`
	// Sets the cloud provider to be used by the cluster.
	//
	// When this is set as `external`, node will wait for an external cloud provider to
	// do cloud specific setup and finish node initialisation.
	//
	// Possible values: `external`.
	CloudProvider *string `json:"cloud-provider,omitempty" yaml:"cloud-provider,omitempty"`
	// Annotations is a map of strings that can be used to store arbitrary metadata configuration.
	// Please refer to the annotations reference for further details on these options.
	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"`
	// Datastore server addresses.
	Servers *[]string `json:"servers,omitempty" yaml:"servers,omitempty"`
	// Datastore CA certificate.
	CACert *string `json:"ca-crt,omitempty" yaml:"ca-crt,omitempty"`
	// Datastore client certificate.
	ClientCert *string `json:"client-crt,omitempty" yaml:"client-crt,omitempty"`
	// Datastore client key.
	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 {
	// The certificate to be used for the kubelet.
	// If omitted defaults to an auto generated certificate.
	KubeletCert *string `json:"kubelet-crt,omitempty" yaml:"kubelet-crt,omitempty"`
	// The key to be used for the kubelet.
	// If omitted defaults to an auto generated key.
	KubeletKey *string `json:"kubelet-key,omitempty" yaml:"kubelet-key,omitempty"`
	// The client certificate to be used for the kubelet.
	// If omitted defaults to an auto generated certificate.
	KubeletClientCert *string `json:"kubelet-client-crt,omitempty" yaml:"kubelet-client-crt,omitempty"`
	// The client key to be used for the kubelet.
	// If omitted defaults to an auto generated key.
	KubeletClientKey *string `json:"kubelet-client-key,omitempty" yaml:"kubelet-client-key,omitempty"`
	// The client certificate to be used for the kube-proxy.
	// If omitted defaults to an auto generated certificate.
	KubeProxyClientCert *string `json:"kube-proxy-client-crt,omitempty" yaml:"kube-proxy-client-crt,omitempty"`
	// The client key to be used for the kube-proxy.
	// If omitted defaults to an auto generated key.
	KubeProxyClientKey *string `json:"kube-proxy-client-key,omitempty" yaml:"kube-proxy-client-key,omitempty"`

	// Additional files that are uploaded `/var/snap/k8s/common/args/conf.d/<filename>`
	// to a node on bootstrap. These files can then be referenced by Kubernetes
	// service arguments.
	//
	// The format is `map[<filename>]<filecontent>`.
	ExtraNodeConfigFiles map[string]string `json:"extra-node-config-files,omitempty" yaml:"extra-node-config-files,omitempty"`

	// Additional arguments that are passed to the `kube-proxy` only for that specific node.
	// A parameter that is explicitly set to `null` is deleted.
	// The format is `map[<--flag-name>]<value>`.
	ExtraNodeKubeProxyArgs map[string]*string `json:"extra-node-kube-proxy-args,omitempty" yaml:"extra-node-kube-proxy-args,omitempty"`
	// Additional arguments that are passed to the `kubelet` only for that specific node.
	// A parameter that is explicitly set to `null` is deleted.
	// The format is `map[<--flag-name>]<value>`.
	ExtraNodeKubeletArgs map[string]*string `json:"extra-node-kubelet-args,omitempty" yaml:"extra-node-kubelet-args,omitempty"`
	// Additional arguments that are passed to `containerd` only for that specific node.
	// A parameter that is explicitly set to `null` is deleted.
	// The format is `map[<--flag-name>]<value>`.
	ExtraNodeContainerdArgs map[string]*string `json:"extra-node-containerd-args,omitempty" yaml:"extra-node-containerd-args,omitempty"`
	// Additional arguments that are passed to `k8s-api-server-proxy` only for that specific node.
	// A parameter that is explicitly set to `null` is deleted.
	// The format is `map[<--flag-name>]<value>`.
	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"`

	// The base directory in which the containerd-related files are located.
	ContainerdBaseDir string `json:"containerd-base-dir,omitempty" yaml:"containerd-base-dir,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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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