How to deploy Sentry on a Kubernetes cluster with an external custom ingress

how-to-deploy-sentry-on-a-kubernetes-cluster-with-an-external-custom-ingress

Context and reasoning

Sentry can be installed on a Kubernetes cluster with the help of the official Sentry Helm chart. I have installed a full version of Gitlab on a Rancher managed Kubernetes cluster with the usual griefs that come with the installation of such a behemoth: optimizing resources, picking the right subchart to install and how to install it. Everything was working fine until we had several machines crashes and I had to reinstall Gitlab from the custom chart I created. The installation only kept the gitaly, postgresql and redis PVCs, and to my devopsy sorrow, the minio storage was gone. There is no way around it, minio has to be installed seprately for a production ready self managed Gitlab. Here’s how.

Pre-requisites

  • A working Kubernetes installation and a distributes block storage for Kubernetes (I am using Longhorn on Rancher)
  • A working helm tooling

Custom ingress

I could not make the included ingress configuration work. Here’s a custom ingress that targets the -sentry-web service to the outside world.

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: "{{ .Release.Name }}-sentry"
  labels:
    {{- include "chart.labels" . | nindent 4 }}
  annotations:
    {{- include "ingress.annotations" . | nindent 4 }}  
spec:
  tls:
  - hosts:  
    - sentry.mywebsite.dev  
    secretName: "sentry.mywebsite.dev-tls"
  rules:
  - host: sentry.mywebsite.dev
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: "{{ .Release.Name }}-sentry-web"
            port: 
              number: 9000

Install sentry

These are the helm chart values needed to kickstart the sentry installation:

  kafka:
    enabled: true
  user:
    create: true
    email: 
    password: 
  asHook: true
  sentry:
    singleOrganization: false
    worker:
      replicas: 2  
  auth:
    register: false
  hooks:
    activeDeadlineSeconds: 6500
  ingress:
    enabled: false  
  nginx:
    enabled: false
  clickhouse:
    enabled: true
    clickhouse:
      replicas: "1"  
  postgresql:
    enabled: true  

Bonus: use sentry in a helm chart

...
- name: sentry
    alias: sentry
    version: 23.x
    repository: https://sentry-kubernetes.github.io/charts
    condition: sentry.enabled
...

Voilà! You have a fully working Sentry installation.

A capture of the Sentry home screen

Consumption

Here’s a quick Loki view at how much Sentry consumes of my cluster’s resource with no app being monitored.

I will not provide the exact details of every measurement as the cluster’s name is redacted, but as you can see, Sentry taxes a heavy toll on the cluster’s resources. At rest it takes up to 13Gb of RAM!

Inspirations and references

Total
0
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post
business-process-design:-definition-+-steps

Business Process Design: Definition + Steps

Next Post
how-to-deploy-a-node-server-in-ec2

How to deploy a node server in EC2

Related Posts