kube

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2021 License: Apache-2.0 Imports: 17 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.

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"
)
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"
)

Variables

View Source
var (
	EndpointsInformer coreinformers.EndpointsInformer

	CoreSharedInformerFactory informers.SharedInformerFactory
)

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.

func GetApisixClient

func GetApisixClient() clientset.Interface

func GetKubeClient

func GetKubeClient() kubernetes.Interface

func InitInformer

func InitInformer(cfg *config.Config) error

initInformer initializes all related shared informers. Deprecate: will be refactored in the future without notification.

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, or V1() will panic.
	V1() *configv1.ApisixRoute
	// V2alpha1 returns the ApisixRoute in apisix.apache.org/v1alpha1, the real
	// ApisixRoute must be in this group version, or V2alpha1() will panic.
	V2alpha1() *configv2alpha1.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)
}

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

func NewApisixRouteLister added in v0.4.0

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
	// 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
}

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)
}

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.

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.
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.
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