Documentation
¶
Overview ¶
Package apiv1 contains types that are copied from https://github.com/canonical/k8s-snap/tree/release-1.30/src/k8s/api/v1
This is because until the k8s-snap API is split into its own separate package, and we want to avoid pulling in all the other dependencies.
Index ¶
- type BootstrapConfig
- type ControlPlaneNodeJoinConfig
- type DNSConfig
- type GatewayConfig
- type GetJoinTokenRequest
- type GetJoinTokenResponse
- type IngressConfig
- type LoadBalancerConfig
- type LocalStorageConfig
- type MetricsServerConfig
- type NetworkConfig
- type RemoveNodeRequest
- type UserFacingClusterConfig
- type WorkerNodeJoinConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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"`
}
BootstrapConfig is copied from https://github.com/canonical/k8s-snap/tree/main/src/k8s/api/v1/bootstrap_config.go#L9
type ControlPlaneNodeJoinConfig ¶
type ControlPlaneNodeJoinConfig 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"`
}
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"`
}
type GatewayConfig ¶
type GatewayConfig struct {
Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
}
type GetJoinTokenRequest ¶
type GetJoinTokenRequest struct {
// If true, a token for joining a worker node is created.
// If false, a token for joining a control plane node is created.
Worker bool `json:"worker"`
// Name of the node that should join.
Name string `json:"name"`
}
GetJoinTokenRequest is used to request a token for joining a node to the cluster.
type GetJoinTokenResponse ¶
type GetJoinTokenResponse struct {
// We want to be able to quickly find the tokens in the code, but have the same
// JSON response for control-plane and worker nodes, thus the discrepancy in naming.
EncodedToken string `json:"token"`
}
GetJoinTokenResponse is used to return a token for joining nodes in the cluster.
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"`
}
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"`
}
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"`
}
type MetricsServerConfig ¶
type MetricsServerConfig struct {
Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
}
type NetworkConfig ¶
type NetworkConfig struct {
Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
}
type RemoveNodeRequest ¶
RemoveNodeRequest is used to request to remove a node from the cluster.
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"`
}
type WorkerNodeJoinConfig ¶
type WorkerNodeJoinConfig 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"`
}
Click to show internal directories.
Click to hide internal directories.