k8s

package
v0.0.0-...-11b31ba Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ApplicationCrdName defines the CRD name for Application of application-connector module.
	ApplicationCrdName string = "applications.applicationconnector.kyma-project.io"
	// ApplicationKind defines the Kind name for Application of application-connector module.
	ApplicationKind string = "Application"
	// ApplicationAPIVersion defines the API version for Application of application-connector module.
	ApplicationAPIVersion string = "applicationconnector.kyma-project.io/v1alpha1"

	// APIRuleCrdName defines the CRD name for APIRule of kyma api-gateway module.
	APIRuleCrdName string = "apirules.gateway.kyma-project.io"
	// PeerAuthenticationCRDName is the name of the Istio peer authentication CRD.
	PeerAuthenticationCRDName = "peerauthentications.security.istio.io"
)

Variables

View Source
var ErrSecretRefInvalid = errors.New("invalid namespaced name. It must be in the format of 'namespace/name'")

Functions

func NatsGVK

func NatsGVK() schema.GroupVersionResource

Types

type Client

type Client interface {
	GetDeployment(ctx context.Context, name, namespace string) (*kappsv1.Deployment, error)
	GetDeploymentDynamic(ctx context.Context, name, namespace string) (*kappsv1.Deployment, error)
	UpdateDeployment(ctx context.Context, deployment *kappsv1.Deployment) error
	DeleteDeployment(ctx context.Context, name, namespace string) error
	DeleteClusterRole(ctx context.Context, name, namespace string) error
	DeleteClusterRoleBinding(ctx context.Context, name, namespace string) error
	DeleteResource(ctx context.Context, object client.Object) error
	GetNATSResources(ctx context.Context, namespace string) (*natsv1alpha1.NATSList, error)
	PatchApply(ctx context.Context, object client.Object) error
	GetSecret(ctx context.Context, namespacedName string) (*kcorev1.Secret, error)
	GetCRD(ctx context.Context, name string) (*kapiextensionsv1.CustomResourceDefinition, error)
	ApplicationCRDExists(ctx context.Context) (bool, error)
	PeerAuthenticationCRDExists(ctx context.Context) (bool, error)
	APIRuleCRDExists(ctx context.Context) (bool, error)
	GetSubscriptions(ctx context.Context) (*eventingv1alpha2.SubscriptionList, error)
	GetConfigMap(ctx context.Context, name, namespace string) (*kcorev1.ConfigMap, error)
	PatchApplyPeerAuthentication(ctx context.Context, authentication *istiopkgsecurityv1beta1.PeerAuthentication) error
}

func NewKubeClient

func NewKubeClient(client client.Client, clientset kapixclientset.Interface, fieldManager string,
	dynamicClient dynamic.Interface,
) Client

type KubeClient

type KubeClient struct {
	// contains filtered or unexported fields
}

func (*KubeClient) APIRuleCRDExists

func (c *KubeClient) APIRuleCRDExists(ctx context.Context) (bool, error)

func (*KubeClient) ApplicationCRDExists

func (c *KubeClient) ApplicationCRDExists(ctx context.Context) (bool, error)

func (*KubeClient) DeleteClusterRole

func (c *KubeClient) DeleteClusterRole(ctx context.Context, name, namespace string) error

func (*KubeClient) DeleteClusterRoleBinding

func (c *KubeClient) DeleteClusterRoleBinding(ctx context.Context, name, namespace string) error

func (*KubeClient) DeleteDeployment

func (c *KubeClient) DeleteDeployment(ctx context.Context, name, namespace string) error

func (*KubeClient) DeleteResource

func (c *KubeClient) DeleteResource(ctx context.Context, object client.Object) error

func (*KubeClient) GetCRD

func (*KubeClient) GetConfigMap

func (c *KubeClient) GetConfigMap(ctx context.Context, name, namespace string) (*kcorev1.ConfigMap, error)

GetConfigMap returns a ConfigMap based on the given name and namespace.

func (*KubeClient) GetDeployment

func (c *KubeClient) GetDeployment(ctx context.Context, name, namespace string) (*kappsv1.Deployment, error)

func (*KubeClient) GetDeploymentDynamic

func (c *KubeClient) GetDeploymentDynamic(ctx context.Context, name, namespace string) (*kappsv1.Deployment, error)

func (*KubeClient) GetNATSResources

func (c *KubeClient) GetNATSResources(ctx context.Context, namespace string) (*natsv1alpha1.NATSList, error)

func (*KubeClient) GetSecret

func (c *KubeClient) GetSecret(ctx context.Context, namespacedName string) (*kcorev1.Secret, error)

GetSecret returns the secret with the given namespaced name. namespacedName is in the format of "namespace/name".

func (*KubeClient) GetSubscriptions

func (c *KubeClient) GetSubscriptions(ctx context.Context) (*eventingv1alpha2.SubscriptionList, error)

func (*KubeClient) PatchApply

func (c *KubeClient) PatchApply(ctx context.Context, object client.Object) error

PatchApply uses the server-side apply to create/update the resource. The object must define `GVK` (i.e. object.TypeMeta).

func (*KubeClient) PatchApplyPeerAuthentication

func (c *KubeClient) PatchApplyPeerAuthentication(ctx context.Context, pa *istiopkgsecurityv1beta1.PeerAuthentication) error

PatchApplyPeerAuthentication creates the Istio PeerAuthentications.

func (*KubeClient) PeerAuthenticationCRDExists

func (c *KubeClient) PeerAuthenticationCRDExists(ctx context.Context) (bool, error)

func (*KubeClient) UpdateDeployment

func (c *KubeClient) UpdateDeployment(ctx context.Context, deployment *kappsv1.Deployment) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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