promtail

by 4ops

Helm chartv1.5.1App 2.2.1Verified publisher

Responsible for gathering logs and sending them to Loki

About this chart

promtail

Responsible for gathering logs and sending them to Loki

Installing the Chart

To install the chart with the release name my-release:

$ helm repo add kube-ops https://charts.kube-ops.io
$ helm repo update
$ helm upgrade my-release kube-ops/promtail --install --namespace my-namespace --create-namespace --wait

Uninstalling the Chart

To uninstall the chart:

$ helm uninstall my-release --namespace my-namespace

Values

KeyTypeDefaultDescription
affinityobject{}Affinity for pod assignment ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
annotationsobject{}
auditLog.pathstring"/var/log/audit/audit.log"Overrides default audit log path. Must be absolute path to log file or mask. Example: /var/log/audit/*.log
auditLog.pipelineStageslist[]Pipeline stages
auditLog.scrapeboolfalseSpecifies whether a audit log events should be collected
client.backoffConfig.maxPeriodstring"5m"Maximum backoff time between retries
client.backoffConfig.maxRetriesint10Maximum number of retries when sending batches, 0 means infinite retries
client.backoffConfig.minPeriodstring"500ms"Initial backoff time between retries
client.basicAuth.passwordstring""The password to use for basic auth
client.basicAuth.passwordFilestring""The file containing the password for basic auth
client.basicAuth.usernamestring""The username to use for basic auth
client.batchsizeint102400Maximum batch size (in bytes) of logs to accumulate before sending the batch to Loki.
client.batchwaitstring"3s"Maximum amount of time to wait before sending a batch, even if that batch isn't full.
client.bearerTokenstring""Bearer token to send to the server.
client.bearerTokenFilestring""File containing bearer token to send to the server.
client.insecureSkipVerifyboolfalseIf true, ignores the server certificate being signed by an unknown CA.
client.proxyUrlstring""HTTP proxy server to use to connect to the server.
client.timeoutstring"10s"Maximum time to wait for server to respond to a request
client.tls.caFilestring""The CA file to use to verify the server
client.tls.certFilestring""The cert file to send to the server for client auth
client.tls.keyFilestring""The key file to send to the server for client auth
client.tls.serverNamestring""Validates that the server name in the server's certificate is this value.
criAutoconfigDebugboolfalse
criAutoconfigImagestring"quay.io/kube-ops/promtail-cri-autoconfig:1.0.1"
dnsConfigobject{}
dnsPolicystring""
ephemeralContainerslist[]Specifies ephemeral containers
extraArgslist[]Additional CLI arguments for application
extraClientConfigslist[]Additional client configs
extraContainerslist[]Specifies additional containers
extraEnvVarslist[]Additional environment variables
extraScrapeConfigslist[]Custom scrape configs together with the default ones in the configmap
extraVolumeMountslist[]Additional mounts for application
extraVolumeslist[]Additional volumes for application
fullnameOverridestring""Overrides the full name
global.imagePullPolicystring"IfNotPresent"Image download policy
global.imagePullSecretslist[]List of the Docker registry credentials
hostAliaseslist[]
image.repositorystring"quay.io/kube-ops/promtail"Overrides the image repository
image.tagstring""Overrides the image tag whose default is the chart appVersion.
initContainerslist[]
labelsobject{}
logLevelstring"error"Log only messages with the given severity or above. Supported values [debug, info, warn, error]
lokiUrlstring"http://loki/loki/api/v1/push"
nameOverridestring""Overrides the chart name
networkPolicy.annotationsobject{}Annotations for NetworkPolicy
networkPolicy.egresslist[{}]Egress rules
networkPolicy.enabledboolfalseSpecifies whether a NetworkPolicy should be created
networkPolicy.ingresslist[{}]Ingress rules
networkPolicy.labelsobject{}Additional labels for NetworkPolicy
nodeSelectorobject{}
podAnnotationsobject{}
podLabelsobject{}
podSecurityContextobject{}Pod security settings
podSecurityPolicy.annotationsobjectSeccomp annotationsPod security policy annotations
podSecurityPolicy.createbooltrueSpecifies whether a pod security policy should be created
podSecurityPolicy.enabledbooltrueSpecifies whether a pod security policy should be enabled
podSecurityPolicy.namestringGenerated using the fullname templateThe name of the pod security policy to use
pods.annotationPrefixstring"logging.kube-ops.io"All annotations with given prefix will be converted to labels. Example: log events from Pod annotated as <prefix>/drop: "true" will be labeled with drop: true
pods.containersDirectorystring"/var/lib/docker/containers"
pods.cristring"auto"
pods.directorystring"/var/log/pods"Override default pods logs path
pods.dropDebugbooltrue
pods.dropDeprecatedbooltrue
pods.dropLabelbooltrue
pods.dropLabelslist["controller-uid","controller-revision-hash","pod-template-hash","pod-template-generation","job-name","statefulset.kubernetes.io/pod-name","chart","heritage","app.kubernetes.io/managed-by","helm.sh/chart","addonmanager.kubernetes.io/mode","io.cilium/app","security.banzaicloud.io/mutate","gcp-auth-skip-secret","queue-pod-name"]All labels with this names will be dropped
pods.dropReadinessProbesbooltrue
pods.excludeNamespaceslist[]Exclude pods logs from given namespaces list
pods.extraPipelineStageslist[]Append custom pipeline stages
pods.nginxOutputTemplatestring`"{{ if ne .user "-" }}{{ .user }}@{{ end }}{{ .ip }} {{ .method }} {{ .path }} {{ .size }} {{ if .referer }}{{ .referer }} {{ end }}{{ .useragent }}\n"`
pods.parseGolangbooltrue
pods.parseJavabooltrue
pods.parseKnownAppsbooltrue
pods.parseLevelsbooltrue
pods.parseNginxAccessLogbooltrue
pods.pipelineStageslist[]Override default pipeline stages
pods.scrapebooltrueSpecifies whether a kubernetes pods logs should be collected
positionsPathstring"/run/promtail/positions.yaml"
postStartHookobject{}This hook is executed immediately after a container is created. However, there is no guarantee that the hook will execute before the container ENTRYPOINT.
preStopHookobject{}This hook is called immediately before a container is terminated due to an API request or management event such as liveness probe failure, preemption, resource contention and others. ref: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks
priorityint0
priorityClassNamestring""Overrides default priority class ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
rbac.annotationsobject{}
rbac.createbooltrueSpecifies whether a cluster role should be created
rbac.namestring""The name of the cluster role to use. If not set and create is true, a name is generated using the fullname template
resources.limits.cpustring"100m"
resources.limits.memorystring"64Mi"
resources.requests.cpustring"25m"
resources.requests.memorystring"48Mi"
revisionHistoryLimitint10specifies the number of old ReplicaSets to retain to allow rollback ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#revision-history-limit
runtimeClassNamestring""Overrides default runtime class
schedulerNamestring""Overrides default scheduler
server.gracefulShutdownTimeoutstring"30s"Timeout for graceful shutdowns
server.grpcListenAddressstring"0.0.0.0"gRPC server listen host
server.grpcMaxConcurrentStreamsint100Limit on the number of concurrent streams for gRPC calls (0 = unlimited)
server.grpcMaxRecvMsgSizeint4194304Max gRPC message size that can be received
server.grpcMaxSendMsgSizeint4194304Max gRPC message size that can be sent
server.grpcPortint9095gRPC server listen port
server.healthCheckTargetbooltrueTarget managers check flag for promtail readiness, if set to false the check is ignored
server.httpIdleTimeoutstring"120s"Idle timeout for HTTP server
server.httpPathPrefixstring""Base path to serve all API routes from (e.g., /v1/).
server.httpPortint3101HTTP server listen host
server.httpReadTimeoutstring"30s"Read timeout for HTTP server
server.httpWriteTimeoutstring"30s"Write timeout for HTTP server
service.annotationsobject{}Annotations for Service resource
service.clusterIPstring""Exposes the Service on a cluster IP See: https://kubernetes.io/docs/concepts/services-networking/service/#choosing-your-own-ip-address
service.externalTrafficPolicystring"Cluster"If you set service.externalTrafficPolicy to the value Local, kube-proxy only proxies proxy requests to local endpoints, and does not forward traffic to other nodes. This approach preserves the original source IP address. If there are no local endpoints, packets sent to the node are dropped, so you can rely on the correct source-ip in any packet processing rules you might apply a packet that make it through to the endpoint. See: https://kubernetes.io/docs/tutorials/services/source-ip/#source-ip-for-services-with-type-nodeport
service.grpcNodePortint30095gRPC node port number
service.grpcPortint9095gRPC port number
service.httpNodePortint30080HTTP node port number
service.httpPortint80HTTP port number
service.labelsobject{}Additional labels for Service resource
service.loadBalancerIPstring""Only applies to Service Type: LoadBalancer LoadBalancer will get created with the IP specified in this field.
service.loadBalancerSourceRangeslist[]If specified and supported by the platform, this will restrict traffic through the cloud-provider load-balancer will be restricted to the specified client IPs. ref: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/
service.syslogNodePortint31514Syslog node port number
service.syslogPortint1514Syslog port number
service.topologyboolfalseenables a service to route traffic based upon the Node topology of the cluster ref: https://kubernetes.io/docs/concepts/services-networking/service-topology/#using-service-topology Kubernetes >= kubeVersion 1.18
service.topologyKeyslist[]A preference-order list of topology keys which implementations of services should use to preferentially sort endpoints when accessing this Service, it can not be used at the same time as externalTrafficPolicy=Local ref: https://kubernetes.io/docs/concepts/services-networking/service-topology/#using-service-topology
service.typestring"ClusterIP"Specify what kind of Kubernetes Service you want. See: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
serviceAccount.annotationsobject{}Annotations to add to the service account
serviceAccount.createbooltrueSpecifies whether a service account should be created
serviceAccount.labelsobject{}Labels to add to the service account
serviceAccount.namestring""The name of the service account to use. If not set and create is true, a name is generated using the fullname template
serviceMonitor.annotationsobject{}
serviceMonitor.enabledbooltrueSpecifies whether a ServiceMonitor should be created (prometheus operator CRDs required)
serviceMonitor.honorLabelsboolfalse
serviceMonitor.intervalstring"30s"
serviceMonitor.jobLabelstring"app.kubernetes.io/instance"
serviceMonitor.labelsobject{}
serviceMonitor.metricRelabelingslist[]
serviceMonitor.namespacestring"monitoring"
serviceMonitor.pathstring"/metrics"
serviceMonitor.scrapeTimeoutstring"30s"
syslog.labelsobject{}
syslog.listenboolfalse
syslog.pipelineStageslist[]
syslog.portint1514
systemJournal.directorystring"/var/log/journal"Override default journal path
systemJournal.jsonboolfalseWhen true, log messages from the journal are passed through the p

Deploy promtail with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has promtail on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartpromtail is pinned at v1.5.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply