clusterconfig

package
v0.0.0-...-fb8dd36 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package clusterconfig contains helper functions for dealing with the configuration of all Skia Infra k8s clusters. See /infra/kube/README.md for an overview of how clusters are managed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	// Type is the type of cluster: always "gke", previously could be "k3s".
	Type string `json:"type"`

	// Zone is the GCE zone.
	Zone string `json:"zone"`

	// Project is the GCE project name, e.g. google.com:skia-corp.
	Project string `json:"project"`

	// ContextName is the name of the context the cluster should have e.g. gke_skia-public_us-central1-a_skia-public
	ContextName string `json:"context_name"`
}

Cluster is detailed info on a particular cluster in a ClusterConfig.

type ClusterConfig

type ClusterConfig struct {
	// GitDir is where to check out Repo.
	GitDir string `json:"gitdir"`

	// Repo is the clone URL of the Git repo that contains our YAML files.
	Repo string `json:"repo"`

	// Clusters maps the common kubernetes cluster name to the details for that cluster.
	Clusters map[string]Cluster `json:"clusters"`
}

ClusterConfig describes the format of the infra/kube/clusters/config.json file.

func New

func New(configFile string) (ClusterConfig, error)

New returns a ClusterConfig for accessing the config.json file that contains information on each cluster we use.

If configFile is the empty string then the config.json file relative to this source file will be loaded.

See /infra/kube/README.md for a description of the config.json file format.

func NewFromEmbeddedConfig

func NewFromEmbeddedConfig() (*ClusterConfig, error)

NewFromEmbeddedConfig returns a new ClusterConfig from the embedded config.json file in //kube/clusters.

func NewWithCheckout

func NewWithCheckout(ctx context.Context, configFile string) (ClusterConfig, git.Checkout, error)

NewWithCheckout returns a ClusterConfig for accessing the config.json file that contains information on each cluster we use, and also checks out the YAML files for all the clusters.

If configFile is the empty string then the config.json file relative to this source file will be loaded.

See /infra/kube/README.md for a description of the config.json file format.

Jump to

Keyboard shortcuts

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