Documentation ¶
Index ¶
- type Clusters
- func (c *Clusters) GetApplication(ctx context.Context, ...) (*clustersProto.GetApplicationResponse, error)
- func (c *Clusters) GetApplications(ctx context.Context, ...) (*clustersProto.GetApplicationsResponse, error)
- func (c *Clusters) GetCRDs(ctx context.Context, getCRDsRequest *clustersProto.GetCRDsRequest) (*clustersProto.GetCRDsResponse, error)
- func (c *Clusters) GetClusters(ctx context.Context, getClustersRequest *clustersProto.GetClustersRequest) (*clustersProto.GetClustersResponse, error)
- func (c *Clusters) GetNamespaces(ctx context.Context, getNamespacesRequest *clustersProto.GetNamespacesRequest) (*clustersProto.GetNamespacesResponse, error)
- func (c *Clusters) GetResources(ctx context.Context, getResourcesRequest *clustersProto.GetResourcesRequest) (*clustersProto.GetResourcesResponse, error)
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Clusters ¶
type Clusters struct { clustersProto.UnimplementedClustersServer // contains filtered or unexported fields }
Clusters contains all fields and methods to interact with the configured Kubernetes clusters. It must implement the Clusters service from the protocol buffers definition.
func Load ¶
Load loads all clusters for the given configuration. The clusters can be retrieved from different providers. Currently we are supporting incluster configuration and kubeconfig files. In the future it is planning to directly support GKE, EKS, AKS, etc.
func (*Clusters) GetApplication ¶
func (c *Clusters) GetApplication(ctx context.Context, getApplicationRequest *clustersProto.GetApplicationRequest) (*clustersProto.GetApplicationResponse, error)
GetApplication returns a single application with the given name in the given cluster and namespace. If there isn't, such an application an error is returned.
func (*Clusters) GetApplications ¶
func (c *Clusters) GetApplications(ctx context.Context, getApplicationsRequest *clustersProto.GetApplicationsRequest) (*clustersProto.GetApplicationsResponse, error)
GetApplications returns a list of applications for the given clusters and namespaces. To generate this list, we loop over every cluster and namespace and try to get the applications for this.
func (*Clusters) GetCRDs ¶
func (c *Clusters) GetCRDs(ctx context.Context, getCRDsRequest *clustersProto.GetCRDsRequest) (*clustersProto.GetCRDsResponse, error)
GetCRDs returns all CRDs for all clusters. Instead of only returning the CRDs for a list of specified clusters, we return all CRDs, so that we only have to call this function once from the React app. The CRDs form all loaded clusters are merged and then deduplicated.
func (*Clusters) GetClusters ¶
func (c *Clusters) GetClusters(ctx context.Context, getClustersRequest *clustersProto.GetClustersRequest) (*clustersProto.GetClustersResponse, error)
GetClusters returns all loaded Kubernetes clusters. We are not returning the complete cluster structure. Instead we are returning just the names of the clusters. We are also sorting the clusters alphabetically, to improve the user experience in the frontend. NOTE: Maybe we can also save the cluster names slice, since the name of a cluster couldn't change during runtime.
func (*Clusters) GetNamespaces ¶
func (c *Clusters) GetNamespaces(ctx context.Context, getNamespacesRequest *clustersProto.GetNamespacesRequest) (*clustersProto.GetNamespacesResponse, error)
GetNamespaces returns all namespaces for the given clusters. As we did it for the clusters, we are also just returning the names of all namespaces. After we retrieved all namespaces we have to depulicate them, so that our frontend logic can handle them properly. We are also sorting the namespaces alphabetically.
func (*Clusters) GetResources ¶
func (c *Clusters) GetResources(ctx context.Context, getResourcesRequest *clustersProto.GetResourcesRequest) (*clustersProto.GetResourcesResponse, error)
GetResources returns a list of resources for the given clusters and namespaces. To generate this list, we loop over every cluster and namespace and try to get the resources for this. A resource is identified by it's Kubernetes API path and name.