Skip to content

Example: Apache with monitoring

Stéphane Brunner edited this page May 31, 2024 · 4 revisions

In this example, we use a sidekick container to be able to extract the Apache metrics.

  services:
    apache:
      enabled: false

      podMonitor:
        enabled: true
        endpoint:
          honorLabels: true
          interval: 10s
          port: prometheus

      service:
        ports:
          - port: 80
            targetPort: http
            protocol: TCP
            name: http

      containers:
        apache:
          ports:
            http:
              containerPort: 8080
              protocol: TCP

        apache-exporter:
          args:
            - --scrape_uri=http://localhost:8080/server-status-remote?auto

          ports:
            prometheus:
              containerPort: 9117
              protocol: TCP

          readinessProbe:
            httpGet:
              path: /
              port: prometheus
            initialDelaySeconds: 5
            timeoutSeconds: 10
            periodSeconds: 20

          resources:
            limits:
              memory: 30Mi
              cpu: '2'
              ephemeral-storage: 16Mi
            requests:
              memory: 10Mi
              cpu: 1m

Clone this wiki locally