resources

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultResourcesPerPlatform = map[string][]string{
	"default": []string{
		"open-policy-agent",
	},
	"aks": []string{
		"azure-storage-classes",
		"pod-security-policies",
		"priority-classes",
		"resource-quotas",
		"kube-state-metrics",

		"aks-aad-pod-identity-nmi-mic",
		"aks-acr-docker-secret",
	},
	"eks": []string{
		"aws-auth",
		"eks-calico",
		"rook-cluster",
		"rook-common",
		"rook-operator",
		"rook-blockstore",
		"rook-filestore",
		"ebs-blockstore",
		"efs-filestore",
		"pod-security-policies",
		"priority-classes",
		"resource-quotas",
		"eks-heapster",
		"kube-state-metrics",
		"eks-network-policies",
	},
	"aws": []string{
		"ebs-blockstore",
	},
	"vsphere": []string{
		"vsphere-volumes",
	},
	"raw":       []string{},
	"vra":       []string{},
	"stacki":    []string{},
	"openstack": []string{},
}

DefaultResourcesPerPlatform store the resources to create in a K8s cluster after it's up and running. Some resources are applied on any platform, those are under the name of "default", and some platforms require specific resources

View Source
var ResourceTemplates map[string]string

ResourceTemplates contain the code of the resources from the templates/resource directory. The value of ResourceTemplates is in the generated file 'code.go'

Functions

func DefaultResourcesFor

func DefaultResourcesFor(platforms ...string) []string

DefaultResourcesFor return the list of resources to create in a K8s cluster on the given platforms. The list includes the default resources that should be in every platform

Types

type Resources

type Resources struct {
	// contains filtered or unexported fields
}

Resources is a list of resources with the kubernetes client used to access the cluster where these resources exists

func New

func New(kubeconfigPath string, ui *ui.UI) (*Resources, error)

New creates a list of resources

func (*Resources) AddData

func (r *Resources) AddData(name, value string)

AddData adds into the map of data the given value on that name

func (*Resources) AddDefaultResourcesFor

func (r *Resources) AddDefaultResourcesFor(platforms ...string)

AddDefaultResourcesFor adds the default list of resources for the given platforms

func (*Resources) AddResources

func (r *Resources) AddResources(resources []string) error

AddResources adds the given list of resources to the list of resources. Returns an error if it's a template resource that does not exists

func (*Resources) AppendData

func (r *Resources) AppendData(data map[string]string)

AppendData appends into the map of data the given map of values

func (*Resources) Apply

func (r *Resources) Apply(name string) (err error)

Apply applies the given resource into the Kubernetes cluster

func (*Resources) ApplyAll

func (r *Resources) ApplyAll() error

ApplyAll mimic the `kubectl apply` command to create or update all the resources in the list

func (*Resources) Export

func (r *Resources) Export(exportDir string) error

Export exports all the Kubernetes manifest templates to the given directory

func (*Resources) KubernetesClient

func (r *Resources) KubernetesClient() *kube.Client

KubernetesClient returns the Kubernetes Client

func (*Resources) KubernetesClientSet

func (r *Resources) KubernetesClientSet() (*kubernetes.Clientset, error)

KubernetesClientSet returns the Kubernetes Clientset from the kubernetes client config

func (*Resources) Names

func (r *Resources) Names() []string

Names return the names of the resources loaded

func (*Resources) Render

func (r *Resources) Render(name string, filename string) ([]byte, error)

Render creates a resource from a resource name

Jump to

Keyboard shortcuts

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