kubernetes-sync

by OpsLevel

Helm chartv0.8.0App v2024.9.5Verified publisher

An agent for synchronizing Kubernetes data with OpsLevel

About this chart

Kubernetes Sync

This chart for kubectl-opslevel creates a deployment to run the app in the background using $ kubectl-opslevel service reconcile.

The app attaches to the Kubernetes event stream and listens for any create and update events. These are then processed by the tool and the resulting service data is sent OpsLevel.

Make sure you have the OpsLevel Helm chart repository added.

Deploy

# double check that you are in the correct cluster
kctx

# double check that your config file is correct
cat opslevel-k8s.yaml

# export API token and desired namespace (defaults to 'opslevel')
 OPSLEVEL_API_TOKEN="..." NAMESPACE="..."

#
#   IF INSTALLING FOR THE FIRST TIME:
#
helm install sync opslevel/kubernetes-sync \
    --namespace="${NAMESPACE:-opslevel}" \
    --create-namespace \
    --set-file sync.config=./opslevel-k8s.yaml \
    --set apitoken="$OPSLEVEL_API_TOKEN"

#
#   RE-DEPLOYS:
#
helm upgrade sync opslevel/kubernetes-sync \
    --namespace="${NAMESPACE:-opslevel}" \
    --set-file sync.config=./opslevel-k8s.yaml \
    --set apitoken="$OPSLEVEL_API_TOKEN"

Deploy without using our public container registry

To deploying using an image from your own registry, edit this line in values.yaml:

image: public.ecr.aws/opslevel/kubectl-opslevel:v2024.4.3

and then deploy using helm.

Deploy kubernetes-sync with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has kubernetes-sync on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartkubernetes-sync is pinned at v0.8.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply