sentry-kubernetes

by Mokto

Helm chartv0.4.0App latest

A Helm chart for sentry-kubernetes (https://github.com/getsentry/sentry-kubernetes)

About this chart

sentry-kubernetes

sentry-kubernetes is a utility that pushes Kubernetes events to Sentry.

Installation:

$ helm install sentry/sentry-kubernetes --name my-release --set sentry.dsn=<your-dsn>

Configuration

The following table lists the configurable parameters of the sentry-kubernetes chart and their default values:

ParameterDescriptionDefault
sentry.dsnSentry DSNEmpty
existingSecretExisting secret to read DSN fromEmpty
sentry.environmentSentry environmentEmpty
sentry.releaseSentry release versionEmpty
sentry.logLevelSentry log level (trace, debug, info, warn, error, disabled)info
sentry.watchNamespacesComma-separated list of namespaces to watch (set to __all__ to watch all namespaces)default
sentry.watchHistoricalSet to 1 to report all existing (old) events, 0 to only report new events0
sentry.clusterConfigTypeCluster configuration type (auto, in-cluster, out-cluster)auto
sentry.kubeconfigPathFilesystem path to the kubeconfig used to connect to the cluster (used if clusterConfigType is out-cluster)Empty
sentry.monitorCronjobsSet to 1 to enable Sentry Crons integration for CronJob objects0
sentry.customDsnsSet to 1 to enable custom DSN specified in annotations with the key k8s.sentry.io/dsn0
image.repositoryContainer image namegetsentry/sentry-kubernetes
image.tagContainer image taglatest
rbac.createIf true, create and use RBAC resourcestrue
serviceAccount.nameService account to be used. If not set and serviceAccount.create is true, a name is generated using the fullname templateEmpty
serviceAccount.createIf true, create a new service accounttrue
priorityClassNamepod priorityClassNameEmpty
resourcesResource requests and limits{}
nodeSelectorNode labels for pod assignment{}
tolerationsTolerations for pod assignment[]
podAnnotationsAnnotations to add to the pod{}
podLabelsAdditional labels to add to the pod{}
rbac.custom_rulesList of custom RBAC rules to extend default permissions. Each rule can specify apiGroups, resources, and verbs.[]
sentry.appendEnvList of custom environment variables to append. Each item can specify a name and either a value or a valueFrom reference.[]

Usage

After installing the chart, you can configure various aspects of the sentry-kubernetes integration by modifying the values.yaml file or using --set flags during installation.

Example values.yaml Configuration

Here's an example values.yaml that sets up sentry-kubernetes with custom configurations (remove unused values for default values):


sentry:
  dsn: <your-dsn>
  environment: production
  release: "1.0.0"
  logLevel: info
  watchNamespaces: "default,production"
  watchHistorical: "1"
  clusterConfigType: auto
  kubeconfigPath: "/path/to/kubeconfig"
  monitorCronjobs: "1"
  customDsns: "1"
  appendEnv:
    - name: SENTRY_NEW_ENV_1
      value: "newvalues"
    - name: SENTRY_NEW_ENV_2
      value: "newvalues"


rbac:
  # Specifies whether RBAC resources should be created
  create: true
  # Will replace the default rules
  custom_rules:
   - verbs:
       - get
       - list
       - watch
     apiGroups:
       - 'apps'
       - 'batch'
       - ''
     resources:
       - events
       - jobs
       - deployments
       - replicasets
       - cronjobs
       - pods

resources:
  limits:
    cpu: 500m
    memory: 512Mi
  requests:
    cpu: 250m
    memory: 256Mi

Deploy sentry-kubernetes with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has sentry-kubernetes 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 chartsentry-kubernetes is pinned at v0.4.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