-
Notifications
You must be signed in to change notification settings - Fork 432
/
context.go
32 lines (24 loc) · 946 Bytes
/
context.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package cluster
import (
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"sigs.k8s.io/controller-runtime/pkg/client"
"github.com/solo-io/gloo/pkg/utils/kubeutils/kubectl"
)
// Context contains the metadata about a Kubernetes cluster
// It also includes useful utilities for interacting with that cluster
type Context struct {
// The name of the Kubernetes cluster
// The assumption is that when multiple clusters are running at once, they will each have unique names
Name string
// The context of the Kubernetes cluster
KubeContext string
// RestConfig holds the common attributes that can be passed to a Kubernetes client on initialization
RestConfig *rest.Config
// A CLI for interacting with Kubernetes cluster
Cli *kubectl.Cli
// A client to perform CRUD operations on the Kubernetes Cluster
Client client.Client
// A set of clients for interacting with the Kubernetes Cluster
Clientset *kubernetes.Clientset
}