clusterconfig

package
v0.0.0-...-3bfe646 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: Apache-2.0 Imports: 11 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(config Interface, opts ...teleservices.MarshalOption) ([]byte, error)

Marshal marshals this resource as JSON

func ToUnknown

func ToUnknown(config Interface) (*storage.UnknownResource, error)

ToUnknown returns this resource as a storage.UnknownResource

Types

type AWSEncryptionProvider

type AWSEncryptionProvider struct {
	// AccountID specifies AWS account ID used to construct the KMS key ARN.
	AccountID string `json:"accountID,omitempty"`
	// KeyID specifies the KMS key ID used to construct the KMS key ARN.
	KeyID string `json:"keyID,omitempty"`
	// Region specifies the AWS region of the KMS key.
	Region string `json:"region,omitempty"`
}

AWSEncryptionProvider defines AWS encryption provider configuration. The configured fields will be used to construct KMS key ARN.

func (*AWSEncryptionProvider) ARN

func (r *AWSEncryptionProvider) ARN() string

ARN returns the key ARN. Format: `arn:aws:kms:${Region}:${AccountID}:key/${KeyID}`

type ComponentConfigs

type ComponentConfigs struct {
	// Kubelet defines kubelet configuration
	Kubelet *Kubelet `json:"kubelet,omitempty"`
}

ComponentConfigs groups component configurations

type ControlPlaneComponent

type ControlPlaneComponent struct {
	json.RawMessage
}

ControlPlaneComponent defines configuration of a control plane component

type EncryptionProvider

type EncryptionProvider struct {
	// Disabled disables resource encryption if set to true.
	Disabled bool `json:"disabled,omitempty"`
	// AWS specifies AWS encryption provider configuration.
	AWS *AWSEncryptionProvider `json:"aws,omitempty"`
}

EncryptionProvider specifies configuration for an encryption provider.

type Global

type Global struct {
	// CloudProvider specifies the cloud provider
	CloudProvider string `json:"cloudProvider,omitempty"`
	// CloudConfig describes the cloud configuration.
	// The configuration is provider-specific
	CloudConfig string `json:"cloudConfig,omitempty"`
	// ServiceCIDR represents the IP range from which to assign service cluster IPs.
	// This must not overlap with any IP ranges assigned to nodes for pods.
	// Targets: api server, controller manager
	ServiceCIDR string `json:"serviceCIDR,omitempty"`
	// ServiceNodePortRange defines the range of ports to reserve for services with NodePort visibility.
	// Inclusive at both ends of the range.
	// Targets: api server
	ServiceNodePortRange string `json:"serviceNodePortRange,omitempty"`
	// PodCIDR defines the CIDR Range for Pods in cluster.
	// Targets: controller manager, kubelet
	PodCIDR string `json:"podCIDR,omitempty"`
	// PodSubnetSize defines the size of the subnet allocated for each host.
	PodSubnetSize string `json:"podSubnetSize,omitempty"`
	// ProxyPortRange specifies the range of host ports (beginPort-endPort, single port or beginPort+offset, inclusive)
	// that may be consumed in order to proxy service traffic.
	// If (unspecified, 0, or 0-0) then ports will be randomly chosen.
	// Targets: kube-proxy
	ProxyPortRange string `json:"proxyPortRange,omitempty"`
	// FeatureGates defines the set of key=value pairs that describe feature gates for alpha/experimental features.
	// Targets: all components
	FeatureGates map[string]bool `json:"featureGates,omitempty"`
	// HighAvailability enables high availability mode for Kubernetes.
	HighAvailability *bool `json:"highAvailability,omitempty"`
	// FlannelBackend optionally specifies the backend to pair with flannel.
	FlannelBackend *string `json:"flannelBackend,omitempty"`
	// EncryptionProvider optionally specifies a Kubernetes encryption provider.
	EncryptionProvider *EncryptionProvider `json:"encryptionProvider,omitempty"`
}

Global describes global configuration

func (Global) IsEmpty

func (r Global) IsEmpty() bool

IsEmpty determines whether this global configuration is empty.

type Interface

type Interface interface {
	// Resource provides common resource methods
	teleservices.Resource
	// GetKubeletConfig returns the configuration of the kubelet
	GetKubeletConfig() *Kubelet
	// GetGlobalConfig returns the global configuration
	GetGlobalConfig() Global
	// SetGlobalConfig sets the new global configuration
	SetGlobalConfig(Global)
	// SetCloudProvider sets the cloud provider for this configuration
	SetCloudProvider(provider string)
}

Interface manages cluster configuration

type Kubelet

type Kubelet struct {
	// ExtraArgs lists additional command line arguments
	ExtraArgs []string `json:"extraArgs,omitempty"`
	// Config defines the kubelet configuration as a JSON-formatted
	// payload
	Config json.RawMessage `json:"config,omitempty"`
}

Kubelet defines kubelet configuration

func (*Kubelet) IsEmpty

func (r *Kubelet) IsEmpty() bool

IsEmpty determines whether this kubelet configuration is empty. A nil receiver is considered empty

type Resource

type Resource struct {
	// Kind is the resource kind
	Kind string `json:"kind"`
	// Version is the resource version
	Version string `json:"version"`
	// Metadata specifies resource metadata
	Metadata teleservices.Metadata `json:"metadata"`
	// Spec defines the resource
	Spec Spec `json:"spec"`
}

Resource describes the cluster configuration resource

func New

func New(spec Spec) *Resource

New returns a new instance of the resource initialized to specified spec

func NewEmpty

func NewEmpty() *Resource

NewEmpty returns a new instance of the resource initialized to defaults

func Unmarshal

func Unmarshal(data []byte) (*Resource, error)

Unmarshal unmarshals the resource from either YAML- or JSON-encoded data

func (*Resource) Expiry

func (r *Resource) Expiry() time.Time

Expiry returns expiration time

func (*Resource) GetGlobalConfig

func (r *Resource) GetGlobalConfig() Global

GetGlobalConfig returns the global configuration

func (*Resource) GetKubeletConfig

func (r *Resource) GetKubeletConfig() *Kubelet

GetKubeletConfig returns the configuration of the kubelet

func (*Resource) GetMetadata

func (r *Resource) GetMetadata() teleservices.Metadata

GetMetadata returns resource metadata

func (*Resource) GetName

func (r *Resource) GetName() string

GetName returns the name of the resource name

func (Resource) Merge

func (r Resource) Merge(other Resource) Resource

Merge merges changes from other into this resource. Only non-empty fields in other different from those in r will be set in r. Returns a copy of r with necessary modifications

func (*Resource) SetCloudProvider

func (r *Resource) SetCloudProvider(provider string)

SetCloudProvider sets the cloud provider for this configuration

func (*Resource) SetExpiry

func (r *Resource) SetExpiry(expires time.Time)

SetExpiry resets expiration time to the specified value

func (*Resource) SetGlobalConfig

func (r *Resource) SetGlobalConfig(config Global)

SetGlobalConfig sets the new global configuration

func (*Resource) SetName

func (r *Resource) SetName(name string)

SetName resets the resource name to the specified value

func (*Resource) SetTTL

func (r *Resource) SetTTL(clock clockwork.Clock, ttl time.Duration)

SetTTL resets the resources's time to live to the specified value using given clock implementation

type Spec

type Spec struct {
	// ComponentsConfigs groups component configurations
	ComponentConfigs
	// TODO: Scheduler, ControllerManager, Proxy
	// Global describes global configuration
	Global Global `json:"global,omitempty"`
}

Spec defines the cluster configuration resource

Jump to

Keyboard shortcuts

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