managers

package
v0.0.0-...-6873b5e Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NS_CLONER_ANNOTATION              = "cloner.io/enabled"
	TARGET_NS_ANNOTATION              = "cloner.io/source-namespace"
	TARGET_NS_ANNOTATION_ENABLED      = "cloner.io/cloned"
	TARGET_CM_ANNOTATION              = "cloner.io/source-configmap"
	TARGET_SECRET_ANNOTATION          = "cloner.io/source-secret"
	TARGET_DEPLOYMENT_ANNOTATION      = "cloner.io/source-deployment"
	TARGET_JOB_ANNOTATION             = "cloner.io/source-job"
	TARGET_CRONJOB_ANNOTATION         = "cloner.io/source-cronjob"
	TARGET_SERVICE_ANNOTATION         = "cloner.io/source-service"
	TARGET_INGRESS_ANNOTATION         = "cloner.io/source-ingress"
	TARGET_SA_ANNOTATION              = "cloner.io/source-serviceaccount"
	TARGET_VIRTUAL_SERVICE_ANNOTATION = "cloner.io/source-virtualservice"
	// Kube-green specifics (Reference: https://kube-green.dev/docs/apireference_v1alpha1/)
	KUBE_GREEN_SLEEPAT_ANNOTATION = "sleep-info.kube-green.com/sleep-time"
	KUBE_GREEN_WAKEAT_ANNOTATION  = "sleep-info.kube-green.com/wake-up-time"
	KUBE_GREEN_TZ_ANNOTATION      = "sleep-info.kube-green.com/timezone"
	KUBE_GREEN_TIMEZONE           = "Asia/Kolkata"
	// Complicated Cron - Setup everyday at 11pm and Wake up at 7 am
	KUBE_GREEN_SLEEP_TIME  = "*:0/23"
	KUBE_GREEN_WAKE_TIME   = "*:0/7"
	KUBE_GREEN_API_VERSION = "kube-green.com/v1alpha1"
	KUBE_GREEN_KIND        = "SleepInfo"
	KUBE_GREEN_SAMPLE_YAML = `` /* 183-byte string literal not displayed */

)

Variables

Functions

func GetConfigMapYaml

func GetConfigMapYaml(clientset *kubernetes.Clientset, namespace string) ([]ConfigMap, *Error)

func GetDeploymentForNS

func GetDeploymentForNS(clientset *kubernetes.Clientset, namespace string) ([]Deployment, *Error)

func GetDeploymentYaml

func GetDeploymentYaml(clientset *kubernetes.Clientset, namespace string) (DeploymentContainers, *Error)

func GetSecretYaml

func GetSecretYaml(clientset *kubernetes.Clientset, namespace string) ([]Secret, *Error)

Types

type ConfigMap

type ConfigMap struct {
	Name      string            `json:"name"`
	Namespace string            `json:"namespace"`
	Data      map[string]string `json:"data"`
	POD       string            `json:"POD"`
	App       string            `json:"app"`
}

type Container

type Container map[string]string

type Deployment

type Deployment struct {
	Name      string
	Namespace string
	POD       string
	App       string
}

type DeploymentContainers

type DeploymentContainers struct {
	Deployments []DeploymentDetail `json:"deployments"`
}

type DeploymentDetail

type DeploymentDetail struct {
	Name       string      `json:"name"`
	Namespace  string      `json:"namespace"`
	POD        string      `json:"pod"`
	App        string      `json:"app"`
	Containers []Container `json:"containers"`
	Replicas   *int32      `json:replicas`
}

type Error

type Error struct {
	Code    int
	Message string
}

func CloneConfigMap

func CloneConfigMap(clientset *kubernetes.Clientset, sourceNamespace, targetNamespace string) *Error

func CloneCronJobs

func CloneCronJobs(clientset *kubernetes.Clientset, sourceNamespace, targetNamespace string) *Error

func CloneDeployments

func CloneDeployments(clientset *kubernetes.Clientset, sourceNamespace, targetNamespace string) *Error

func CloneHPA

func CloneHPA(clientset *kubernetes.Clientset, sourceNamespace, targetNamespace string) *Error

func CloneIngresses

func CloneIngresses(clientset *kubernetes.Clientset, sourceNamespace, targetNamespace string) *Error

func CloneIstioVirtualServices

func CloneIstioVirtualServices(dynamicClient dynamic.Interface, sourceNamespace, targetNamespace string) *Error

func CloneJobs

func CloneJobs(clientset *kubernetes.Clientset, sourceNamespace, targetNamespace string) *Error

func CloneNamespace

func CloneNamespace(clientset *kubernetes.Clientset, dynamicClientSet *dynamic.DynamicClient, sourceNamespace, targetNamespace string) *Error

func ClonePDB

func ClonePDB(clientset *kubernetes.Clientset, sourceNamespace, targetNamespace string) *Error

func CloneSTS

func CloneSTS(clientset *kubernetes.Clientset, sourceNamespace, targetNamespace string) *Error

TODO: Need to check this

func CloneSecret

func CloneSecret(clientset *kubernetes.Clientset, sourceNamespace, targetNamespace string) *Error

func CloneServices

func CloneServices(clientset *kubernetes.Clientset, sourceNamespace, targetNamespace string) *Error

func CloneSeviceAccount

func CloneSeviceAccount(clientset *kubernetes.Clientset, sourceNamespace, targetNamespace string) *Error

func GetNS

func GetNS(clientset *kubernetes.Clientset) ([]map[string]string, *Error)

func PatchConfigMap

func PatchConfigMap(clientset *kubernetes.Clientset, namespace string, configMapName string, data map[string]string) *Error

func PatchDeploymentImage

func PatchDeploymentImage(clientset *kubernetes.Clientset, namespace string, deploymentStr string, containerName string, image string) *Error

func PatchSecret

func PatchSecret(clientset *kubernetes.Clientset, namespace string, secretName string, data map[string]interface{}) *Error

func RemoveNamespace

func RemoveNamespace(clientset *kubernetes.Clientset, namespace string) *Error

type Secret

type Secret struct {
	Name      string            `json:"name"`
	Namespace string            `json:"namespace"`
	Data      map[string]string `json:"data"`
	POD       string            `json:"POD"`
	App       string            `json:"app"`
}

Jump to

Keyboard shortcuts

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