-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update promtail to latest version and some changes following the new …
…version Signed-off-by: Vandit Singh <[email protected]>
- Loading branch information
1 parent
07e6eb2
commit f0fb1b5
Showing
3 changed files
with
249 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
245 changes: 245 additions & 0 deletions
245
prombench/manifests/prombench/benchmark/3c_promtail-bench_deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,245 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: promtail-benchtest-config | ||
namespace: prombench-{{ .PR_NUMBER }} | ||
labels: | ||
app: promtail | ||
data: | ||
promtail.yaml: | | ||
client: | ||
batchwait: 1s # Maximum wait period before sending batch | ||
batchsize: 102400 # Maximum batch size to accrue before sending, unit is byte | ||
timeout: 10s # Maximum time to wait for server to respond to a request | ||
backoff_config: | ||
min_period: 100ms # Initial backoff time between retries | ||
max_period: 5s # Maximum backoff time between retries | ||
max_retries: 5 # Maximum number of retries when sending batches, 0 means infinite retries | ||
server: | ||
http_listen_port: 3101 | ||
positions: | ||
filename: /run/promtail/positions.yaml | ||
target_config: | ||
sync_period: 10s # Period to resync directories being watched and files being tailed | ||
scrape_configs: | ||
- job_name: kubernetes-pods | ||
kubernetes_sd_configs: | ||
- role: pod | ||
relabel_configs: | ||
- action: keep | ||
source_labels: [__meta_kubernetes_pod_label_app] | ||
regex: prometheus|promtail | ||
- source_labels: [__meta_kubernetes_pod_label_app] | ||
target_label: __service__ | ||
- source_labels: [__meta_kubernetes_pod_node_name] | ||
target_label: __host__ | ||
- action: replace | ||
replacement: $1 | ||
separator: / | ||
source_labels: [__meta_kubernetes_namespace, __service__] | ||
target_label: job | ||
- action: replace | ||
source_labels: [__meta_kubernetes_namespace] | ||
target_label: namespace | ||
- action: replace | ||
source_labels: [__meta_kubernetes_pod_name] | ||
target_label: instance | ||
- action: replace | ||
source_labels: [__meta_kubernetes_pod_container_name] | ||
target_label: container_name | ||
- action: replace | ||
source_labels: [__meta_kubernetes_pod_label_prometheus] | ||
target_label: prometheus | ||
- action: replace | ||
source_labels: [__meta_kubernetes_pod_label_promtail] | ||
target_label: promtail | ||
- replacement: /var/log/pods/*$1/*.log | ||
separator: / | ||
source_labels: [__meta_kubernetes_pod_uid, __meta_kubernetes_pod_container_name] | ||
target_label: __path__ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: promtail-pr-{{ .PR_NUMBER }} | ||
namespace: prombench-{{ .PR_NUMBER }} | ||
labels: | ||
app: promtail | ||
promtail: pr-{{ .PR_NUMBER }} | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: promtail | ||
promtail: pr-{{ .PR_NUMBER }} | ||
updateStrategy: | ||
type: RollingUpdate | ||
template: | ||
metadata: | ||
namespace: prombench-{{ .PR_NUMBER }} | ||
labels: | ||
app: promtail | ||
promtail: pr-{{ .PR_NUMBER }} | ||
spec: | ||
serviceAccountName: promtail | ||
affinity: | ||
podAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- topologyKey: kubernetes.io/hostname | ||
labelSelector: | ||
matchExpressions: | ||
- key: prometheus | ||
operator: In | ||
values: | ||
- test-pr-{{ .PR_NUMBER }} | ||
containers: | ||
- name: promtail | ||
image: grafana/promtail:3.2.0 | ||
imagePullPolicy: IfNotPresent | ||
args: | ||
- "-config.file=/etc/promtail/promtail.yaml" | ||
- "-client.url=http://loki.default.svc.cluster.local:3100/api/prom/push" | ||
volumeMounts: | ||
- name: config | ||
mountPath: /etc/promtail | ||
- name: run | ||
mountPath: /run/promtail | ||
- name: pods | ||
mountPath: /var/log/pods | ||
readOnly: true | ||
- name: docker | ||
mountPath: /var/lib/docker/containers | ||
readOnly: true | ||
env: | ||
- name: HOSTNAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: spec.nodeName | ||
ports: | ||
- containerPort: 3101 | ||
name: http-metrics | ||
securityContext: | ||
readOnlyRootFilesystem: true | ||
runAsGroup: 0 | ||
runAsUser: 0 | ||
readinessProbe: | ||
failureThreshold: 5 | ||
httpGet: | ||
path: /ready | ||
port: http-metrics | ||
initialDelaySeconds: 10 | ||
periodSeconds: 10 | ||
successThreshold: 1 | ||
timeoutSeconds: 1 | ||
nodeSelector: | ||
node-name: prometheus-{{ .PR_NUMBER }} | ||
isolation: prometheus | ||
tolerations: | ||
- key: node-role.kubernetes.io/master | ||
effect: NoSchedule | ||
volumes: | ||
- name: config | ||
configMap: | ||
name: promtail-benchtest-config | ||
- name: run | ||
hostPath: | ||
path: /run/promtail | ||
- name: docker | ||
hostPath: | ||
path: /var/lib/docker/containers | ||
- name: pods | ||
hostPath: | ||
path: /var/log/pods | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: promtail-{{ normalise .RELEASE }} | ||
namespace: prombench-{{ .PR_NUMBER }} | ||
labels: | ||
app: promtail | ||
promtail: {{ normalise .RELEASE }} | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: promtail | ||
promtail: {{ normalise .RELEASE }} | ||
updateStrategy: | ||
type: RollingUpdate | ||
template: | ||
metadata: | ||
namespace: prombench-{{ .PR_NUMBER }} | ||
labels: | ||
app: promtail | ||
promtail: {{ normalise .RELEASE }} | ||
spec: | ||
serviceAccountName: promtail | ||
affinity: | ||
podAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- topologyKey: kubernetes.io/hostname | ||
labelSelector: | ||
matchExpressions: | ||
- key: prometheus | ||
operator: In | ||
values: | ||
- test-{{ normalise .RELEASE }} | ||
containers: | ||
- name: promtail | ||
image: grafana/promtail:3.2.0 | ||
imagePullPolicy: IfNotPresent | ||
args: | ||
- "-config.file=/etc/promtail/promtail.yaml" | ||
- "-client.url=http://loki.default.svc.cluster.local:3100/api/prom/push" | ||
volumeMounts: | ||
- name: config | ||
mountPath: /etc/promtail | ||
- name: run | ||
mountPath: /run/promtail | ||
- name: pods | ||
mountPath: /var/log/pods | ||
readOnly: true | ||
- name: docker | ||
mountPath: /var/lib/docker/containers | ||
readOnly: true | ||
env: | ||
- name: HOSTNAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: spec.nodeName | ||
ports: | ||
- containerPort: 3101 | ||
name: http-metrics | ||
securityContext: | ||
readOnlyRootFilesystem: true | ||
runAsGroup: 0 | ||
runAsUser: 0 | ||
readinessProbe: | ||
failureThreshold: 5 | ||
httpGet: | ||
path: /ready | ||
port: http-metrics | ||
initialDelaySeconds: 10 | ||
periodSeconds: 10 | ||
successThreshold: 1 | ||
timeoutSeconds: 1 | ||
nodeSelector: | ||
node-name: prometheus-{{ .PR_NUMBER }} | ||
isolation: prometheus | ||
tolerations: | ||
- key: node-role.kubernetes.io/master | ||
effect: NoSchedule | ||
volumes: | ||
- name: config | ||
configMap: | ||
name: promtail-benchtest-config | ||
- name: run | ||
hostPath: | ||
path: /run/promtail | ||
- name: docker | ||
hostPath: | ||
path: /var/lib/docker/containers | ||
- name: pods | ||
hostPath: | ||
path: /var/log/pods |