Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding default configmap and secret to promtail-app #49

Merged
merged 20 commits into from
Mar 24, 2023

Conversation

marieroque
Copy link
Contributor

@marieroque marieroque commented Mar 22, 2023

towards giantswarm/roadmap#2054

This PR:

  • adds default configmap and secret to promtail-app

Checklist

  • Update changelog in CHANGELOG.md.
  • Make sure values.yaml and values.schema.json are valid.

How do we test it ?

First, we need to deploy manually:

  • gauss-logging-secret secret:
promtail:
  config:
    clients:
      - url: https://loki.XXXXX
        tenant_id: gauss-gauss
        basic_auth:
          username: lokiwrite
          password: XXXXXXXXXX
        backoff_config:
          max_period: 10m
        external_labels:
          installation: gauss
          cluster_id: gauss
  • gauss-logging-config configmap:
apiVersion: v1                                                                                                                                                                                                                                                                            
data:                                                                                                                                                                                                                                                                                     
  values: |
    promtail:
      rbac:
        create: true
        pspEnabled: true
      extraArgs:
        - '-log-config-reverse-order'
      config:
        clients:
          - url: https://loki.XXX
            # the whole client config for this URL
            # including but not limited to authentication credentials
            # is stored in Flux secret
        snippets:
          extraScrapeConfigs: |
            # this one includes also system logs reported by systemd-journald
            - job_name: systemd_journal_run
              journal:
                path: /run/log/journal
                max_age: 12h
                json: true
              relabel_configs:
                - source_labels: ['__journal__systemd_unit']
                  target_label: 'systemd_unit'
                - source_labels: ['__journal__hostname']
                  target_label: 'hostname'
            - job_name: systemd_journal_var
              journal:
                path: /var/log/journal
                max_age: 12h
                json: true
              relabel_configs:
                - source_labels: ['__journal__systemd_unit']
                  target_label: 'systemd_unit'
                - source_labels: ['__journal__hostname']
                  target_label: 'hostname'
      extraVolumes:
        - name: journal-run
          hostPath:
            path: /run/log/journal/
        - name: journal-var
          hostPath:
            path: /var/log/journal/
      extraVolumeMounts:
        - name: journal-run
          mountPath: /run/log/journal/
          readOnly: true
        - name: journal-var
          mountPath: /var/log/journal/
          readOnly: true
kind: ConfigMap
metadata:
  name: gauss-logging-config
  namespace: giantswarm

Once specific branch deployed:

  • Check promtail pods are running
  • Check logs are present on gorilla grafana

@marieroque marieroque requested a review from a team as a code owner March 22, 2023 11:21
Marie Roque added 2 commits March 22, 2023 12:22
@marieroque marieroque marked this pull request as draft March 22, 2023 12:57
@marieroque
Copy link
Contributor Author

Process validated on MC gauss.

Pods are running:

[observability-bundle]$ k get po -A| grep promt
kube-system           promtail-app-2jhfm                                                1/1     Running            0                  3m7s
kube-system           promtail-app-7w8wr                                                1/1     Running            0                  3m7s
kube-system           promtail-app-8j6f4                                                1/1     Running            0                  3m7s
kube-system           promtail-app-8kj5k                                                1/1     Running            0                  3m7s
kube-system           promtail-app-hfk2g                                                1/1     Running            0                  3m7s
kube-system           promtail-app-ltzz9                                                1/1     Running            0                  3m7s
kube-system           promtail-app-pglt8                                                1/1     Running            0                  3m7s
kube-system           promtail-app-sjfg6                                                1/1     Running            0                  3m7s
kube-system           promtail-app-wbxhs                                                1/1     Running            0                  3m7s

Logs are sent to gorilla grafana:
image

@marieroque marieroque changed the title Adding defautl configmap and secret to promtail-app Adding default configmap and secret to promtail-app Mar 22, 2023
CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Contributor

@QuentinBisson QuentinBisson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that works, that's wonderful

@marieroque
Copy link
Contributor Author

If that works, that's wonderful

It doesn't work:

reason: 'Upgrade "observability-bundle" failed: cannot patch "promtail-app" with                                                                                                                                                                                                      
      kind App: admission webhook "apps.app-admission-controller.giantswarm.io" denied                                                                                                                                                                                                    
      the request: parsing failed error: unable to parse app: &errors.errorString{s:"v1alpha1.App.Spec:                                                                                                                                                                                   
      v1alpha1.AppSpec.ExtraConfigs: []v1alpha1.AppExtraConfig: v1alpha1.AppExtraConfig.Name:                                                                                                                                                                                             
      ReadString: expects \" or n, but found [, error found in #10 byte of ...|\",\"name\":[\"-logging-|...,                                                                                                                                                                              
      bigger context ...|ntswarm\",\"extraConfigs\":[{\"kind\":\"secret\",\"name\":[\"-logging-secret\"],\"namespace\":\"giantswarm\",\"prior|..."}'

@QuentinBisson
Copy link
Contributor

@marieroque can you add the changelog entry?

@marieroque marieroque marked this pull request as ready for review March 24, 2023 08:27
@marieroque marieroque merged commit c863b65 into main Mar 24, 2023
@marieroque marieroque deleted the add-config-and-secret-to-promtail branch March 24, 2023 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants