# Source: promtail/templates/secret.yaml
apiVersion: v1
kind: Secret
metadata:
  name: promtail
  labels:
    helm.sh/chart: promtail-3.5.0
    app.kubernetes.io/name: promtail
    app.kubernetes.io/instance: promtail
    app.kubernetes.io/version: "2.2.0"
    app.kubernetes.io/managed-by: Helm
  annotations:
    meta.helm.sh/release-name: 'promtail'
  namespace: jx-observability
stringData:
  promtail.yaml: "server:\n  log_level: info\n  http_listen_port: 3101\n\nclient:\n  url: http://loki.jx-observability:3100/loki/api/v1/push\n  \n\npositions:\n  filename: /run/promtail/positions.yaml\n\nscrape_configs:\n  # See also https://github.com/grafana/loki/blob/master/production/ksonnet/promtail/scrape_config.libsonnet for reference\n  # Pods with a label 'app.kubernetes.io/name'\n  - job_name: kubernetes-pods-app-kubernetes-io-name\n    pipeline_stages:\n      - cri: {}\n    kubernetes_sd_configs:\n      - role: pod\n    relabel_configs:\n      - action: drop\n        regex: tekton-pipelines\n        source_labels:\n        - __meta_kubernetes_pod_label_app_kubernetes_io_managed_by\n      - action: drop\n        regex: slave\n        source_labels:\n        - __meta_kubernetes_pod_label_jenkins\n      - action: replace\n        source_labels:\n          - __meta_kubernetes_pod_label_app_kubernetes_io_name\n        target_label: app\n      - action: drop\n        regex: ''\n        source_labels:\n          - app\n      - action: replace\n        source_labels:\n          - __meta_kubernetes_pod_label_app_kubernetes_io_instance\n        target_label: instance\n      - action: replace\n        source_labels:\n          - __meta_kubernetes_pod_label_app_kubernetes_io_component\n        target_label: component\n      - action: replace\n        source_labels:\n        - __meta_kubernetes_pod_node_name\n        target_label: node_name\n      - action: replace\n        source_labels:\n        - __meta_kubernetes_namespace\n        target_label: namespace\n      - action: replace\n        replacement: $1\n        separator: /\n        source_labels:\n        - namespace\n        - app\n        target_label: job\n      - action: replace\n        source_labels:\n        - __meta_kubernetes_pod_name\n        target_label: pod\n      - action: replace\n        source_labels:\n        - __meta_kubernetes_pod_container_name\n        target_label: container\n      - action: replace\n        replacement: /var/log/pods/*$1/*.log\n        separator: /\n        source_labels:\n        - __meta_kubernetes_pod_uid\n        - __meta_kubernetes_pod_container_name\n        target_label: __path__\n  # Pods with a label 'app'\n  - job_name: kubernetes-pods-app\n    pipeline_stages:\n      - cri: {}\n    kubernetes_sd_configs:\n      - role: pod\n    relabel_configs:\n      - action: drop\n        regex: tekton-pipelines\n        source_labels:\n        - __meta_kubernetes_pod_label_app_kubernetes_io_managed_by\n      - action: drop\n        regex: slave\n        source_labels:\n        - __meta_kubernetes_pod_label_jenkins\n      # Drop pods with label 'app.kubernetes.io/name'. They are already considered above\n      - action: drop\n        regex: .+\n        source_labels:\n          - __meta_kubernetes_pod_label_app_kubernetes_io_name\n      - action: replace\n        source_labels:\n          - __meta_kubernetes_pod_label_app\n        target_label: app\n      - action: drop\n        regex: ''\n        source_labels:\n          - app\n      - action: replace\n        source_labels:\n          - __meta_kubernetes_pod_label_instance\n        target_label: instance\n      - action: replace\n        source_labels:\n          - __meta_kubernetes_pod_label_component\n        target_label: component\n      - action: replace\n        source_labels:\n        - __meta_kubernetes_pod_node_name\n        target_label: node_name\n      - action: replace\n        source_labels:\n        - __meta_kubernetes_namespace\n        target_label: namespace\n      - action: replace\n        replacement: $1\n        separator: /\n        source_labels:\n        - namespace\n        - app\n        target_label: job\n      - action: replace\n        source_labels:\n        - __meta_kubernetes_pod_name\n        target_label: pod\n      - action: replace\n        source_labels:\n        - __meta_kubernetes_pod_container_name\n        target_label: container\n      - action: replace\n        replacement: /var/log/pods/*$1/*.log\n        separator: /\n        source_labels:\n        - __meta_kubernetes_pod_uid\n        - __meta_kubernetes_pod_container_name\n        target_label: __path__\n  # Pods with direct controllers, such as StatefulSet\n  - job_name: kubernetes-pods-direct-controllers\n    pipeline_stages:\n      - cri: {}\n    kubernetes_sd_configs:\n      - role: pod\n    relabel_configs:\n      - action: drop\n        regex: tekton-pipelines\n        source_labels:\n        - __meta_kubernetes_pod_label_app_kubernetes_io_managed_by\n      - action: drop\n        regex: slave\n        source_labels:\n        - __meta_kubernetes_pod_label_jenkins\n      # Drop pods with label 'app.kubernetes.io/name' or 'app'. They are already considered above\n      - action: drop\n        regex: .+\n        separator: ''\n        source_labels:\n          - __meta_kubernetes_pod_label_app_kubernetes_io_name\n          - __meta_kubernetes_pod_label_app\n      - action: drop\n        regex: '[0-9a-z-.]+-[0-9a-f]{8,10}'\n        source_labels:\n          - __meta_kubernetes_pod_controller_name\n      - action: replace\n        source_labels:\n          - __meta_kubernetes_pod_controller_name\n        target_label: app\n      - action: replace\n        source_labels:\n        - __meta_kubernetes_pod_node_name\n        target_label: node_name\n      - action: replace\n        source_labels:\n        - __meta_kubernetes_namespace\n        target_label: namespace\n      - action: replace\n        replacement: $1\n        separator: /\n        source_labels:\n        - namespace\n        - app\n        target_label: job\n      - action: replace\n        source_labels:\n        - __meta_kubernetes_pod_name\n        target_label: pod\n      - action: replace\n        source_labels:\n        - __meta_kubernetes_pod_container_name\n        target_label: container\n      - action: replace\n        replacement: /var/log/pods/*$1/*.log\n        separator: /\n        source_labels:\n        - __meta_kubernetes_pod_uid\n        - __meta_kubernetes_pod_container_name\n        target_label: __path__\n  # Pods with indirect controllers, such as Deployment\n  - job_name: kubernetes-pods-indirect-controller\n    pipeline_stages:\n      - cri: {}\n    kubernetes_sd_configs:\n      - role: pod\n    relabel_configs:\n      - action: drop\n        regex: tekton-pipelines\n        source_labels:\n        - __meta_kubernetes_pod_label_app_kubernetes_io_managed_by\n      - action: drop\n        regex: slave\n        source_labels:\n        - __meta_kubernetes_pod_label_jenkins\n      # Drop pods with label 'app.kubernetes.io/name' or 'app'. They are already considered above\n      - action: drop\n        regex: .+\n        separator: ''\n        source_labels:\n          - __meta_kubernetes_pod_label_app_kubernetes_io_name\n          - __meta_kubernetes_pod_label_app\n      - action: keep\n        regex: '[0-9a-z-.]+-[0-9a-f]{8,10}'\n        source_labels:\n          - __meta_kubernetes_pod_controller_name\n      - action: replace\n        regex: '([0-9a-z-.]+)-[0-9a-f]{8,10}'\n        source_labels:\n          - __meta_kubernetes_pod_controller_name\n        target_label: app\n      - action: replace\n        source_labels:\n        - __meta_kubernetes_pod_node_name\n        target_label: node_name\n      - action: replace\n        source_labels:\n        - __meta_kubernetes_namespace\n        target_label: namespace\n      - action: replace\n        replacement: $1\n        separator: /\n        source_labels:\n        - namespace\n        - app\n        target_label: job\n      - action: replace\n        source_labels:\n        - __meta_kubernetes_pod_name\n        target_label: pod\n      - action: replace\n        source_labels:\n        - __meta_kubernetes_pod_container_name\n        target_label: container\n      - action: replace\n        replacement: /var/log/pods/*$1/*.log\n        separator: /\n        source_labels:\n        - __meta_kubernetes_pod_uid\n        - __meta_kubernetes_pod_container_name\n        target_label: __path__\n  # All remaining pods not yet covered\n  - job_name: kubernetes-other\n    pipeline_stages:\n      - cri: {}\n    kubernetes_sd_configs:\n      - role: pod\n    relabel_configs:\n      - action: drop\n        regex: tekton-pipelines\n        source_labels:\n        - __meta_kubernetes_pod_label_app_kubernetes_io_managed_by\n      - action: drop\n        regex: slave\n        source_labels:\n        - __meta_kubernetes_pod_label_jenkins\n      # Drop what has already been covered\n      - action: drop\n        regex: .+\n        separator: ''\n        source_labels:\n          - __meta_kubernetes_pod_label_app_kubernetes_io_name\n          - __meta_kubernetes_pod_label_app\n      - action: drop\n        regex: .+\n        source_labels:\n          - __meta_kubernetes_pod_controller_name\n      - action: replace\n        source_labels:\n          - __meta_kubernetes_pod_name\n        target_label: app\n      - action: replace\n        source_labels:\n          - __meta_kubernetes_pod_label_instance\n        target_label: instance\n      - action: replace\n        source_labels:\n          - __meta_kubernetes_pod_label_component\n        target_label: component\n      - action: replace\n        source_labels:\n        - __meta_kubernetes_pod_node_name\n        target_label: node_name\n      - action: replace\n        source_labels:\n        - __meta_kubernetes_namespace\n        target_label: namespace\n      - action: replace\n        replacement: $1\n        separator: /\n        source_labels:\n        - namespace\n        - app\n        target_label: job\n      - action: replace\n        source_labels:\n        - __meta_kubernetes_pod_name\n        target_label: pod\n      - action: replace\n        source_labels:\n        - __meta_kubernetes_pod_container_name\n        target_label: container\n      - action: replace\n        replacement: /var/log/pods/*$1/*.log\n        separator: /\n        source_labels:\n        - __meta_kubernetes_pod_uid\n        - __meta_kubernetes_pod_container_name\n        target_label: __path__\n"
