# README

Operator

See the binary documentation for deployment instructions.

Testing

The operator has an end-to-end test suite to run functional tests against a real Kubernetes cluster.

To run the tests a kubeconfig pointing to a GKE cluster is required. This is generally already taken care of while setting up a GKE cluster (instructions). Use kubectl config {current,set}-context to verify or change which cluster the tests will execute against.

The test expects various resources, which are part of deploying the operator, to be installed in the cluster:

kubectl apply -f ../../cmd/operator/deploy/crds/
kubectl apply -f ../../cmd/operator/deploy/operator/00-namespace.yaml
kubectl apply -f ../../cmd/operator/deploy/operator/01-priority-class.yaml

The operator itself is run locally within the test suite. Thus, make sure the blocking webhooks are not currently enabled:

kubectl delete -f ../../cmd/operator/deploy/operator/08-validatingwebhookconfiguration.yaml
kubectl delete -f ../../cmd/operator/deploy/operator/09-mutatingwebhookconfiguration.yaml

The tests verify the metric data written into GCM, for which information about the GKE cluster must be provided. Execute the tests with:

go test ./e2e/ \
    --project-id=$PROJECT_ID --cluster=$CLUSTER_NAME --location=$LOCATION

Credentials

Tests by default assume to run in a GKE cluster and that they can infer sufficient credentials from the environment.

If that's not the case the --skip-gcm flag disables tests paths that require connectivity to the GMP and GCM backends.

Alternatively, the --gcp-service-account=<filepath> flag allows providing a GCP service account credentials file which is used for deployed components instead of relying on the environment. The service account needs permission to read and write metric data against the --project-id. Running the test on GKE with and without this option provides more comprehensive coverage.

Code Generation

To update generated code when changes to Custom Resource Definitions are made run:

make regen

The generated CRD YAMLs may require manual editing. Especially consider whether fields are correctly marked as required or not.

# Packages

No description provided by the author

# Functions

New instantiates a new Operator.
NewScheme creates a new Kubernetes runtime.Scheme for the GMP Operator.

# Constants

AlertmanagerAppName is the name of the alert manager application.
Secret paths.
Collector Kubernetes Deployment extraction/detection.
Secret paths.
Secret paths.
Secret paths.
AnnotationMetricName is the component name, will be exposed as metric name.
ClusterAutoscalerSafeEvictionLabel is the annotation label that determines whether the cluster autoscaler can safely evict a Pod when the Pod doesn't satisfy certain eviction criteria.
Secret paths.
Collector Kubernetes Deployment extraction/detection.
Collector Kubernetes Deployment extraction/detection.
Collector Kubernetes Deployment extraction/detection.
DefaultOperatorNamespace is the namespace in which all resources owned by the operator are installed.
DefaultPublicNamespace is the namespace where the operator will check for user-specified configuration data.
KubernetesAppName is the k8s Application, will be exposed as component name.
LabelAppName is the well-known app name label.
LabelInstanceName is the well-known instance name label.
Base resource names which may be used for multiple different resource kinds related to the given component.
Base resource names which may be used for multiple different resource kinds related to the given component.
NameOperator is a fixed name used in various resources managed by the operator.
Base resource names which may be used for multiple different resource kinds related to the given component.
Base resource names which may be used for multiple different resource kinds related to the given component.
RuleEvaluatorAppName is the name of the rule-evaluator application.
Collector Kubernetes Deployment extraction/detection.
Secret paths.

# Variables

No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
Operator to implement managed collection for Google Prometheus Engine.
Options for the Operator.
No description provided by the author