kubernetes

package
v0.0.0-...-047f893 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2024 License: Apache-2.0 Imports: 19 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

	// 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) *Infra

NewInfra returns a new Infra.

func (*Infra) CreateOrUpdateProxyInfra

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

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

func (*Infra) DeleteProxyInfra

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

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

type InfraClient

type InfraClient struct {
	client.Client
}

func New

func New(cli client.Client) *InfraClient

func (*InfraClient) CreateOrUpdate

func (cli *InfraClient) CreateOrUpdate(ctx context.Context, key client.ObjectKey, current client.Object, specific client.Object, updateChecker func() bool) error

func (*InfraClient) Delete

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

func (*InfraClient) GetUID

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

GetUID retrieves the uid of one resource.

type ResourceRender

type ResourceRender interface {
	Name() string
	ServiceAccount() (*corev1.ServiceAccount, error)
	Service() (*corev1.Service, error)
	ConfigMap() (*corev1.ConfigMap, error)
	Deployment() (*appsv1.Deployment, error)
	HorizontalPodAutoscaler() (*autoscalingv2.HorizontalPodAutoscaler, 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