shipping_openbao_logs #17

Closed
Michal.Wrobel wants to merge 130 commits from shipping_openbao_logs into development
No description provided.
<yet to be described>
Michal.Wrobel added 91 commits 2025-03-20 14:51:09 +00:00
# Conflicts:
#	.gitignore
- name: sidecar-container-alloy-config
      configMap:
        name: sidecar-container-alloy-config
- name: grafana-alloy
     image: grafana/alloy:latest
     ports:
       - containerPort: 12345
     volumeMounts:
       - name: sidecar-container-alloy-config
         mountPath: /etc/alloy
         subPath: config.yaml
     args:
       - --config.file=/etc/alloy/config.yaml
#    - --config.file=/etc/alloy/config.yaml
- name: alloy-data
      emptyDir: {}
runAsUser: 1000
        fsGroup: 1000
fsGroup: 1000
Reviewed-on: #16
runAsGroup: 1000
        runAsNonRoot: true
        runAsUser: 100
#   - name: alloy-data
      #     mountPath: /var/lib/alloy/data
#   - name: grafana-alloy
  #     image: grafana/alloy:latest
  #     ports:
  #       - containerPort: 12345
#   - name: alloy-data
      #     mountPath: /var/lib/alloy/data
      # securityContext:
      #   runAsUser: 0
chmod 644 /var/log/openbao.log
      chown openbao:openbao /var/1og/openbao_audit.log
      bao audit enable file file_path=/var/log/openbao.log
chmod 644 /var/log/openbao.log
      chown openbao:openbao /var/1og/openbao_audit.log
      bao audit enable file file_path=/var/log/openbao.log removed
echo 'OpenBao has crashed - giving Alloy time to collect logs...' >> var/log/openbao.log;
          sleep 20;
          echo 'Sidecar exiting.';
          exit 1;
# echo 'OpenBao has crashed - giving Alloy time to collect logs...' >> var/log/openbao.log;
          # sleep 20;
          # echo 'Sidecar exiting.';
          # exit 1;
echo 'Hello'
          sleep 5;
          done
        "]
chmod 644 /var/log/openbao.log
      chown openbao:openbao /var/1og/openbao_audit.log
      bao audit enable file file_path=/var/log/openbao.log
while true; do
            echo 'Hello'
          sleep 5;
          done
        "]
while true; do
            echo 'Hello'
          sleep 5;
          done
        "]
runAsUser: 1001
image: busybox
      command: ["sh", "-c", "chown -R 1000:1000 /var/log && chmod -R 775 /var/log"]
      securityContext:
        runAsUser: 0
      volumeMounts:
        - mountPath: /var/log
          name: log-storage
image: busybox
      command: ["sh", "-c", "chown -R 1000:1000 /var/log && chmod -R 775 /var/log"]
      volumeMounts:
        - mountPath: /var/log
          name: log-storage
- name: log-storage
      path: /var/log/test
volumeMounts:
        - name: log-storage
          mountPath: /var/log/test
- name: log-storage
      path: /var/log/test
- mountPath: /var/log/test
      name: plugins
      readOnly: false
- mountPath: /
      name: plugins
      readOnly: false
#   - mountPath: /
  #     name: plugins
  #     readOnly: false
- name: log-storage
      emptyDir: {}
- mountPath: /var/log/test
      name: plugins
      readOnly: false
- mountPath: /var/log/test
      name: log-storage
      readOnly: false
chmod 644 /var/log/openbao.log
      chown openbao:openbao /var/log/openbao.log
      bao audit enable file file_path=/var/log/openbao.log removed
# bao audit enable file file_path=/openbao/logs/openbao.log
bao audit enable -path="file" file file_path=/openbao/logs/openbao.log
path_targets = [{"__path__" = "/openbao/logs/*"}]
        sync_period = "5s"
      }

      loki.source.file "openbao_logs" {
        targets    = local.file_match.openbao_file_logs.output
        forward_to = [loki.write.local_loki.receiver]
      }
configMap:
        name: sidecar-container-alloy-config
items:
                - key: "config.yaml"
                  path: "config.alloy"
mountPath: /etc/alloy
              items:
                - key: "config.yaml"
                  path: "config.alloy"
path: "/config.alloy"
                - key: "config.yaml"
                  path: "/pupa/config.alloy"
Michal.Wrobel added 1 commit 2025-03-20 15:03:24 +00:00
Michal.Wrobel added 1 commit 2025-03-20 15:14:07 +00:00
Michal.Wrobel added 1 commit 2025-03-20 15:18:46 +00:00
Michal.Wrobel added 1 commit 2025-03-24 11:54:30 +00:00
enabled: true
Michal.Wrobel added 1 commit 2025-03-24 12:12:48 +00:00
enabled: true
    execCommand:
      - /bin/sh
      - -c
      - bao status
Michal.Wrobel added 1 commit 2025-03-24 12:32:44 +00:00
# bao audit enable -path="file" file file_path=/openbao/logs/openbao.log
Michal.Wrobel added 1 commit 2025-03-24 12:33:15 +00:00
Michal.Wrobel added 1 commit 2025-03-24 12:38:18 +00:00
Michal.Wrobel added 1 commit 2025-03-24 12:41:50 +00:00
echo $(grep "Initial Root Token:" /tmp/init.txt | awk '{print $NF}')| cat > /openbao/data/initial_token.txt
      echo $(grep "Unseal Key 1:" /tmp/init.txt | awk '{print $NF}')| cat > /openbao/data/unseal_key1.txt
      echo $(grep "Unseal Key 2:" /tmp/init.txt | awk '{print $NF}')| cat > /openbao/data/unseal_key2.txt
      echo $(grep "Unseal Key 3:" /tmp/init.txt | awk '{print $NF}')| cat > /openbao/data/unseal_key3.txt
      echo $(grep "Unseal Key 4:" /tmp/init.txt | awk '{print $NF}')| cat > /openbao/data/unseal_key4.txt
      echo $(grep "Unseal Key 5:" /tmp/init.txt | awk '{print $NF}')| cat > /openbao/data/unseal_key5.txt
      bao login $(grep "Initial Root Token:" /tmp/init.txt | awk '{print $NF}')
      rm /tmp/init.txt
Michal.Wrobel added 1 commit 2025-03-24 12:50:10 +00:00
Michal.Wrobel added 1 commit 2025-03-24 12:50:35 +00:00
Michal.Wrobel added 1 commit 2025-03-24 12:57:41 +00:00
Michal.Wrobel added 1 commit 2025-03-24 13:20:57 +00:00
bao audit enable -path="stdout" file file_path=stdout
      bao audit enable -path="file" file file_path=/openbao/logs/openbao.log
Michal.Wrobel added 1 commit 2025-03-24 13:50:19 +00:00
Author
Owner

⚠️ Please squash the commits ⚠️

⚠️ Please squash the commits ⚠️
Michal.Wrobel requested review from richardrobertreitz 2025-03-24 14:06:41 +00:00
Michal.Wrobel added 1 commit 2025-03-25 10:18:55 +00:00
hostPath:
        path: /var/log
        type: Directory
Michal.Wrobel added 1 commit 2025-03-25 11:51:04 +00:00
Michal.Wrobel added 1 commit 2025-03-25 12:03:31 +00:00
Michal.Wrobel added 1 commit 2025-03-25 12:13:42 +00:00
Michal.Wrobel added 1 commit 2025-03-25 12:19:18 +00:00
Michal.Wrobel added 1 commit 2025-03-25 12:26:32 +00:00
Michal.Wrobel added 1 commit 2025-03-25 12:52:58 +00:00
kind: ConfigMap
metadata:
  name: openbao-logrotate-config
  namespace: openbao
data:
  openbao: |
    /var/log/openbao/*.log {
    size 5k
    rotate 7
    compress
    missingok
    notifempty
    postrotate
        kill -SIGHUP $(pidof bao)
    endscript
    }
Michal.Wrobel added 1 commit 2025-03-25 12:59:28 +00:00
Michal.Wrobel added 1 commit 2025-03-25 13:08:05 +00:00
Michal.Wrobel added 1 commit 2025-03-25 14:02:53 +00:00
Michal.Wrobel added 1 commit 2025-03-25 14:16:09 +00:00
Michal.Wrobel added 1 commit 2025-03-26 10:01:36 +00:00
listener {
          address = "0.0.0.0:1514"
        }
        forward_to = [loki.write.local_loki.receiver]
      }
Michal.Wrobel added 1 commit 2025-03-26 10:46:06 +00:00
- name: "tcp_socket"
    port: 1514
    targetPort: 1514
    protocol: "TCP"
    appProtocol: "tcp"
Michal.Wrobel added 1 commit 2025-03-26 10:53:15 +00:00
- name: "tcp_socket"
      port: 1514
      targetPort: 1514
      protocol: "TCP"
      appProtocol: "tcp"
Michal.Wrobel added 1 commit 2025-03-26 11:28:41 +00:00
#   - name: "tcp_socket"
  #     port: 1514
  #     targetPort: 1514
  #     protocol: "TCP"
  #     appProtocol: "tcp"
Michal.Wrobel added 1 commit 2025-03-26 11:30:34 +00:00
Michal.Wrobel added 1 commit 2025-03-26 11:34:52 +00:00
Michal.Wrobel added 1 commit 2025-03-26 11:38:43 +00:00
Michal.Wrobel added 1 commit 2025-03-26 11:43:05 +00:00
- name: "tcp_socket"
      port: 1514
      targetPort: 1514
      protocol: "TCP"
      appProtocol: "tcp"
Michal.Wrobel added 1 commit 2025-03-26 11:50:17 +00:00
name: alloy-config
    key: config.alloy
Michal.Wrobel added 1 commit 2025-03-26 11:56:06 +00:00
Michal.Wrobel added 1 commit 2025-03-26 12:03:26 +00:00
name: alloy-config
  key: config.alloy
Michal.Wrobel added 1 commit 2025-03-26 12:16:06 +00:00
targets    = discovery.relabel.pod_logs.output
        forward_to = [loki.write.local_loki.receiver]
      }
Michal.Wrobel added 1 commit 2025-03-26 12:46:11 +00:00
Michal.Wrobel added 1 commit 2025-03-26 12:55:50 +00:00
listener {
          address = "0.0.0.0:1514"
          labels   = { component = "loki.source.syslog", protocol = "tcp" }
        }
        forward_to = [loki.write.local_loki.receiver]
      }
Michal.Wrobel closed this pull request 2025-04-02 13:33:26 +00:00
This repo is archived. You cannot comment on pull requests.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: DevFW-CICD/stacks#17
No description provided.