kube

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2021 License: Apache-2.0 Imports: 29 Imported by: 1

Documentation

Overview

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	// ApisixRouteV1 represents the ApisixRoute in apisix.apache.org/v1 group version.
	ApisixRouteV1 = "apisix.apache.org/v1"
	// ApisixRouteV2alpha1 represents the ApisixRoute in apisix.apache.org/v2alpha1 group version
	ApisixRouteV2alpha1 = "apisix.apache.org/v2alpha1"
	// ApisixRouteV2beta1 represents the ApisixRoute in apisix.apache.org/v2beta1 group version
	ApisixRouteV2beta1 = "apisix.apache.org/v2beta1"
	// ApisixRouteV2beta2 represents the ApisixRoute in apisix.apache.org/v2beta2 group version
	ApisixRouteV2beta2 = "apisix.apache.org/v2beta2"
)
View Source
const (
	// IngressV1 represents the Ingress in networking/v1 group version.
	IngressV1 = "networking/v1"
	// IngressV1beta1 represents the Ingress in networking/v1beta1 group version.
	IngressV1beta1 = "networking/v1beta1"
	// IngressExtensionsV1beta1 represents the Ingress in extensions/v1beta1 group version.
	IngressExtensionsV1beta1 = "extensions/v1beta1"
)

Variables

This section is empty.

Functions

func BuildRestConfig

func BuildRestConfig(kubeconfig, context string) (*rest.Config, error)

BuildRestConfig builds the rest.Config object from kubeconfig filepath and context, if kubeconfig is missing, building from in-cluster configuration.

Types

type ApisixRoute added in v0.4.0

type ApisixRoute interface {
	// GroupVersion returns the api group version of the
	// real ApisixRoute.
	GroupVersion() string
	// V1 returns the ApisixRoute in apisix.apache.org/v1, the real
	// ApisixRoute must be in this group version, otherwise will panic.
	V1() *configv1.ApisixRoute
	// V2alpha1 returns the ApisixRoute in apisix.apache.org/v2alpha1, the real
	// ApisixRoute must be in this group version, otherwise will panic.
	V2alpha1() *configv2alpha1.ApisixRoute
	// V2beta1 returns the ApisixRoute in apisix.apache.org/v2beta1, the real
	// ApisixRoute must be in this group version, otherwise will panic.
	V2beta1() *configv2beta1.ApisixRoute
	// V2beta2 returns the ApisixRoute in apisix.apache.org/v2beta2, the real
	// ApisixRoute must be in this group version, otherwise will panic.
	V2beta2() *configv2beta2.ApisixRoute
	// ResourceVersion returns the the resource version field inside
	// the real ApisixRoute.
	ResourceVersion() string
}

ApisixRoute is an encapsulation for ApisixRoute resource with different versions, for now, they are apisix.apache.org/v1 and apisix.apache.org/v2alpha1

func MustNewApisixRoute added in v0.4.0

func MustNewApisixRoute(obj interface{}) ApisixRoute

MustNewApisixRoute creates a kube.ApisixRoute object according to the type of obj.

func NewApisixRoute added in v0.4.0

func NewApisixRoute(obj interface{}) (ApisixRoute, error)

NewApisixRoute creates a kube.ApisixRoute object according to the type of obj. It returns nil and the error reason when the type assertion fails.

type ApisixRouteEvent added in v0.4.0

type ApisixRouteEvent struct {
	Key          string
	OldObject    ApisixRoute
	GroupVersion string
}

ApisixRouteEvent contains the ApisixRoute key (namespace/name) and the group version message.

type ApisixRouteInformer added in v0.4.0

type ApisixRouteInformer interface {
	Run(chan struct{})
}

ApisixRouteInformer is an encapsulation for the informer of ApisixRoute, it aims at to be compatible with different ApisixRoute versions.

type ApisixRouteLister added in v0.4.0

type ApisixRouteLister interface {
	// V1 gets the ApisixRoute in apisix.apache.org/v1.
	V1(string, string) (ApisixRoute, error)
	// V2alpha1 gets the ApisixRoute in apisix.apache.org/v2alpha1.
	V2alpha1(string, string) (ApisixRoute, error)
	// V2beta1 gets the ApisixRoute in apisix.apache.org/v2beta1.
	V2beta1(string, string) (ApisixRoute, error)
	// V2beta2 gets the ApisixRoute in apisix.apache.org/v2beta2.
	V2beta2(string, string) (ApisixRoute, error)
}

ApisixRouteLister is an encapsulation for the lister of ApisixRoute, it aims at to be compatible with different ApisixRoute versions.

type Endpoint added in v1.1.0

type Endpoint interface {
	// ServiceName returns the corresponding service owner of this endpoint.
	ServiceName() string
	// Namespace returns the residing namespace.
	Namespace() string
	// Endpoints returns the corresponding endpoints which matches the ServicePort.
	Endpoints(port *corev1.ServicePort) []HostPort
}

Endpoint is an encapsulation for the Kubernetes Endpoint and EndpointSlice objects.

func NewEndpoint added in v1.1.0

func NewEndpoint(ep *corev1.Endpoints) Endpoint

NewEndpoint creates an Endpoint which entity is Kubernetes Endpoints.

func NewEndpointWithSlice added in v1.1.0

func NewEndpointWithSlice(ep *discoveryv1.EndpointSlice) Endpoint

NewEndpointWithSlice creates an Endpoint which entity is Kubernetes EndpointSlices.

type EndpointLister added in v1.1.0

type EndpointLister interface {
	// GetEndpoint fetches an Endpoint which entity is the Kubernetes
	// Endpoint according to the namespace and name.
	GetEndpoint(string, string) (Endpoint, error)
	// GetEndpointSlices fetches an EndpointSlices which entity is the Kubernetes
	// EndpointSlice according to the namespace and service name label.
	GetEndpointSlices(string, string) (Endpoint, error)
}

EndpointLister is an encapsulation for the lister of Kubernetes Endpoint and EndpointSlice.

func NewEndpointListerAndInformer added in v1.1.0

func NewEndpointListerAndInformer(factory informers.SharedInformerFactory, useEndpointSlice bool) (EndpointLister, cache.SharedIndexInformer)

NewEndpointListerAndInformer creates an EndpointLister and the sharedIndexInformer.

type HostPort added in v1.1.0

type HostPort struct {
	Host string
	Port int
}

type Ingress added in v0.4.0

type Ingress interface {
	// GroupVersion returns the api group version of the
	// real ingress.
	GroupVersion() string
	// V1 returns the ingress in networking/v1, the real
	// ingress must be in networking/v1, or V1() will panic.
	V1() *networkingv1.Ingress
	// V1beta1 returns the ingress in networking/v1beta1, the real
	// ingress must be in networking/v1beta1, or V1beta1() will panic.
	V1beta1() *networkingv1beta1.Ingress
	// ExtensionsV1beta1 returns the ingress in extensions/v1beta1, the real
	// ingress must be in extensions/v1beta1, or ExtensionsV1beta1() will panic.
	ExtensionsV1beta1() *extensionsv1beta1.Ingress
	// ResourceVersion returns the the resource version field inside
	// the real Ingress.
	ResourceVersion() string
}

Ingress is an encapsulation for Kubernetes Ingress with different versions, for now, they are networking/v1 and networking/v1beta1.

func MustNewIngress added in v0.4.0

func MustNewIngress(obj interface{}) Ingress

MustNewIngress creates a kube.Ingress object according to the type of obj.

func NewIngress added in v0.4.0

func NewIngress(obj interface{}) (Ingress, error)

NewIngress creates a kube.Ingress object according to the type of obj. It returns nil and the error reason when the type assertion fails.

type IngressEvent added in v0.4.0

type IngressEvent struct {
	Key          string
	GroupVersion string
	OldObject    Ingress
}

IngressEvents contains the ingress key (namespace/name) and the group version message.

type IngressInformer added in v0.4.0

type IngressInformer interface {
	Run(chan struct{})
}

IngressInformer is an encapsulation for the informer of Kubernetes Ingress, it aims at to be compatible with different Ingress versions.

type IngressLister added in v0.4.0

type IngressLister interface {
	// V1 gets the ingress in networking/v1.
	V1(string, string) (Ingress, error)
	// V1beta1 gets the ingress in networking/v1beta1.
	V1beta1(string, string) (Ingress, error)
	// ExtensionsV1beta1 gets the ingress in extensions/v1beta1.
	ExtensionsV1beta1(string, string) (Ingress, error)
}

IngressLister is an encapsulation for the lister of Kubernetes Ingress, it aims at to be compatible with different Ingress versions.

func NewIngressLister added in v0.4.0

NewIngressLister creates an version-neutral Ingress lister.

type KubeClient added in v1.0.0

type KubeClient struct {

	// Client is the object used to operate Kubernetes builtin resources.
	Client kubernetes.Interface
	// APISIXClient is the object used to operate resources under apisix.apache.org group.
	APISIXClient clientset.Interface
	// contains filtered or unexported fields
}

KubeClient contains some objects used to communicate with Kubernetes API Server.

func NewKubeClient added in v1.0.0

func NewKubeClient(cfg *config.Config) (*KubeClient, error)

NewKubeClient creates a high-level Kubernetes client.

func (*KubeClient) NewAPISIXSharedIndexInformerFactory added in v1.0.0

func (k *KubeClient) NewAPISIXSharedIndexInformerFactory() externalversions.SharedInformerFactory

NewAPISIXSharedIndexInformerFactory returns an index informer factory object used to watch and list Kubernetes resources in apisix.apache.org group.

func (*KubeClient) NewSharedIndexInformerFactory added in v1.0.0

func (k *KubeClient) NewSharedIndexInformerFactory() informers.SharedInformerFactory

NewSharedIndexInformerFactory returns an index informer factory object used to watch and list Kubernetes builtin resources.

Directories

Path Synopsis
apisix
apis/config/v1
+groupName=apisix.apache.org Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
+groupName=apisix.apache.org Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
apis/config/v2alpha1
+groupName=apisix.apache.org Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
+groupName=apisix.apache.org Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
apis/config/v2beta1
+k8s:deepcopy-gen=package +groupName=apisix.apache.org Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
+k8s:deepcopy-gen=package +groupName=apisix.apache.org Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
apis/config/v2beta2
+k8s:deepcopy-gen=package +groupName=apisix.apache.org Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
+k8s:deepcopy-gen=package +groupName=apisix.apache.org Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
client/clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
client/clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
client/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
client/clientset/versioned/typed/config/v1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
client/clientset/versioned/typed/config/v1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
client/clientset/versioned/typed/config/v2alpha1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
client/clientset/versioned/typed/config/v2alpha1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
client/clientset/versioned/typed/config/v2beta1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
client/clientset/versioned/typed/config/v2beta1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
client/clientset/versioned/typed/config/v2beta2
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
client/clientset/versioned/typed/config/v2beta2/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
annotations
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.

Jump to

Keyboard shortcuts

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