kubernetes

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDeployment added in v1.4.0

func CreateDeployment(name, image string, envs []corev1.EnvVar) appsv1.Deployment

func CreateService added in v1.4.0

func CreateService(name string) interface{}

func CreateUnstructured

func CreateUnstructured(crd crd.CRD, metadata Metadata, spec, status map[string]interface{}) (unstructured.Unstructured, error)

func ExtractSecrets

func ExtractSecrets(componentName string, c crd.CRD, spec map[string]interface{}) (map[string]string, error)

ExtractSecrets looks up resource schema, extracts secret objects if passed spec contains secret data and returns a map with base64 encoded values. It does not validate the spec against the CRD.

Types

type Metadata

type Metadata struct {
	Name        string            `json:"name" yaml:"name"`
	Namespace   string            `json:"namespace,omitempty" yaml:"namespace,omitempty"`
	Labels      map[string]string `json:"labels" yaml:"labels"`
	Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
}

type Object

type Object struct {
	APIVersion string                 `json:"apiVersion" yaml:"apiVersion"`
	Kind       string                 `json:"kind" yaml:"kind"`
	Metadata   Metadata               `json:"metadata" yaml:"metadata"`
	Spec       map[string]interface{} `json:"spec,omitempty" yaml:"spec,omitempty"`

	// for Secrets
	Data map[string]string `json:"data,omitempty" yaml:"data,omitempty"`
	Type string            `json:"type,omitempty" yaml:"type,omitempty"`
}

func CreateObject

func CreateObject(crd crd.CRD, metadata Metadata, spec map[string]interface{}) (Object, error)

Jump to

Keyboard shortcuts

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