Help us shape the future of Go! Take the 2026 Go Developer Survey

kubernetes

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Infra

type Infra struct {
	// Namespace is the Namespace used for managed infra.
	Namespace string

	// EnvoyGateway is the configuration used to startup Envoy Gateway.
	EnvoyGateway *egv1a1.EnvoyGateway

	// Client wrap k8s client.
	Client *InfraClient
}

Infra manages the creation and deletion of Kubernetes infrastructure based on Infra IR resources.

func NewInfra

func NewInfra(cli client.Client, cfg *config.Server) *Infra

NewInfra returns a new Infra.

func (*Infra) CreateOrUpdateProxyInfra added in v0.3.0

func (i *Infra) CreateOrUpdateProxyInfra(ctx context.Context, infra *ir.Infra) error

CreateOrUpdateProxyInfra creates the managed kube infra, if it doesn't exist.

func (*Infra) CreateOrUpdateRateLimitInfra added in v0.3.0

func (i *Infra) CreateOrUpdateRateLimitInfra(ctx context.Context) error

CreateOrUpdateRateLimitInfra creates the managed kube rate limit infra, if it doesn't exist.

func (*Infra) DeleteProxyInfra added in v0.3.0

func (i *Infra) DeleteProxyInfra(ctx context.Context, infra *ir.Infra) error

DeleteProxyInfra removes the managed kube infra, if it doesn't exist.

func (*Infra) DeleteRateLimitInfra added in v0.3.0

func (i *Infra) DeleteRateLimitInfra(ctx context.Context) error

DeleteRateLimitInfra removes the managed kube infra, if it doesn't exist.

type InfraClient added in v0.5.0

type InfraClient struct {
	client.Client
}

func New added in v0.5.0

func New(cli client.Client) *InfraClient

func (*InfraClient) Delete added in v0.5.0

func (cli *InfraClient) Delete(ctx context.Context, object client.Object) error

func (*InfraClient) GetUID added in v0.5.0

func (cli *InfraClient) GetUID(ctx context.Context, key client.ObjectKey, current client.Object) (types.UID, error)

GetUID retrieves the uid of one resource.

func (*InfraClient) ServerSideApply added in v1.0.2

func (cli *InfraClient) ServerSideApply(ctx context.Context, obj client.Object) error

type ResourceRender added in v0.5.0

type ResourceRender interface {
	Name() string
	LabelSelector() labels.Selector
	ServiceAccount() (*corev1.ServiceAccount, error)
	Service() (*corev1.Service, error)
	ConfigMap() (*corev1.ConfigMap, error)
	Deployment() (*appsv1.Deployment, error)
	DeploymentSpec() (*egv1a1.KubernetesDeploymentSpec, error)
	DaemonSet() (*appsv1.DaemonSet, error)
	DaemonSetSpec() (*egv1a1.KubernetesDaemonSetSpec, error)
	HorizontalPodAutoscaler() (*autoscalingv2.HorizontalPodAutoscaler, error)
	HorizontalPodAutoscalerSpec() (*egv1a1.KubernetesHorizontalPodAutoscalerSpec, error)
	PodDisruptionBudget() (*policyv1.PodDisruptionBudget, error)
	PodDisruptionBudgetSpec() (*egv1a1.KubernetesPodDisruptionBudgetSpec, error)
}

ResourceRender renders Kubernetes infrastructure resources based on Infra IR resources.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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