IPCEICIS-3111 #21

Closed
Michal.Wrobel wants to merge 131 commits from IPCEICIS-3111 into development

see https://jira.telekom-mms.com/browse/IPCEICIS-3111

⚠️Please squash the commits⚠️

see https://jira.telekom-mms.com/browse/IPCEICIS-3111 ⚠️Please squash the commits⚠️
Michal.Wrobel added 131 commits 2025-03-26 15:00:21 +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"
enabled: true
enabled: true
    execCommand:
      - /bin/sh
      - -c
      - bao status
# bao audit enable -path="file" file file_path=/openbao/logs/openbao.log
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
bao audit enable -path="stdout" file file_path=stdout
      bao audit enable -path="file" file file_path=/openbao/logs/openbao.log
hostPath:
        path: /var/log
        type: Directory
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
    }
listener {
          address = "0.0.0.0:1514"
        }
        forward_to = [loki.write.local_loki.receiver]
      }
- name: "tcp_socket"
    port: 1514
    targetPort: 1514
    protocol: "TCP"
    appProtocol: "tcp"
- name: "tcp_socket"
      port: 1514
      targetPort: 1514
      protocol: "TCP"
      appProtocol: "tcp"
#   - name: "tcp_socket"
  #     port: 1514
  #     targetPort: 1514
  #     protocol: "TCP"
  #     appProtocol: "tcp"
- name: "tcp_socket"
      port: 1514
      targetPort: 1514
      protocol: "TCP"
      appProtocol: "tcp"
name: alloy-config
    key: config.alloy
name: alloy-config
  key: config.alloy
targets    = discovery.relabel.pod_logs.output
        forward_to = [loki.write.local_loki.receiver]
      }
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-03-26 15:01:42 +00:00
Author
Owner

see the comments in the ticket

see the comments in the ticket

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
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#21
No description provided.