k8s

package module
v0.1.20 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 25 Imported by: 1

README

stuttgart-things/sthingsK8s

module providing k8s golang functions

Author Information

Patrick Hermann, stuttgart-things 04/2022

License

Licensed under the Apache License, Version 2.0 (the "License").

You may obtain a copy of the License at 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.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertKubeconfigFileToByteArray

func ConvertKubeconfigFileToByteArray(kubeconfigPath string) []byte

func ConvertYAMLtoDeployment added in v0.1.16

func ConvertYAMLtoDeployment(yamlString string) (bool, *v1Apps.Deployment)

func ConvertYAMLtoPipelineRun added in v0.1.16

func ConvertYAMLtoPipelineRun(yamlString string) (bool, *v1.PipelineRun, error)

func CreateDynamicResourcesFromTemplate

func CreateDynamicResourcesFromTemplate(kubeconfig *rest.Config, templatedResource []byte, namespace string) (bool, error)

func CreateInClusterRestConfig

func CreateInClusterRestConfig() *rest.Config

func CreateNamespace added in v0.1.5

func CreateNamespace(kubeConfig *rest.Config, namespaceName string)

func CreateRestConfig

func CreateRestConfig(kubeconfig []byte) *rest.Config

func CreateRestMapperAndDynamicInterface

func CreateRestMapperAndDynamicInterface(kubeconfig *rest.Config) (meta.RESTMapper, dynamic.Interface)

func DeleteResource added in v0.1.20

func DeleteResource(kubeconfig *rest.Config, name, group, version, resouce, namespace string) (bool, error)

func GetK8sNamespaces added in v0.1.5

func GetK8sNamespaces(kubeConfig *rest.Config) []string

func GetKubeConfig

func GetKubeConfig(kubeConfigPath string) (clusterConfig *rest.Config, clusterConnection string)

func VerifyYamlJobDefinition added in v0.1.12

func VerifyYamlJobDefinition(jobManifest string) (bool, error)

Types

type K8sResource

type K8sResource struct {
	Name       string `mapstructure:"name"`
	Kind       string `mapstructure:"kind"`
	ApiVersion string `mapstructure:"api-version"`
}

func GetK8sResourcesByKind

func GetK8sResourcesByKind(kubeconfig *rest.Config, apiVersion, kind, namespace string, debug bool) []K8sResource

Jump to

Keyboard shortcuts

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