Skip to content
This repository has been archived by the owner on Aug 25, 2023. It is now read-only.

basisai/terraform-helm-prometheus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prometheus

Deploys Prometheus and some supporting services on a Kubernetes cluster running in GCP.

This module makes use of following charts:

Requirements

Name Version
terraform >= 0.14
helm >= 2.1

Providers

Name Version
helm >= 2.1

Modules

No modules.

Resources

Name Type
helm_release.alertmanager resource
helm_release.kube_state_metrics resource
helm_release.node_exporter resource
helm_release.prometheus resource

Inputs

Name Description Type Default Required
alertmanager_affinity Affinity for alertmanager pods map {} no
alertmanager_annotations Annotations for Alertmanager pods map {} no
alertmanager_chart_name Helm Alertmanager chart name to provision string "alertmanager" no
alertmanager_chart_namespace Namespace to install the Alertmanager chart into string "default" no
alertmanager_chart_repository Helm repository for the Alertmanager chart string "https://prometheus-community.github.io/helm-charts" no
alertmanager_chart_version Version of Alertmanager chart to install. Set to empty to install the latest version string "" no
alertmanager_config Additional ConfigMap entries for Alertmanager in YAML string string "global: {}\n # slack_api_url: ''\n\ntemplates:\n - '/etc/alertmanager/*.tmpl'\n\nreceivers:\n - name: default-receiver\n # slack_configs:\n # - channel: '@you'\n # send_resolved: true\n\nroute:\n group_wait: 10s\n group_interval: 5m\n receiver: default-receiver\n repeat_interval: 3h\n" no
alertmanager_container_security_context Security context for alertmanager containers defined as a map which will be serialized to JSON. map
{
"allowPrivilegeEscalation": false,
"runAsGroup": 65534,
"runAsNonRoot": true,
"runAsUser": 65534
}
no
alertmanager_enable Enable Alertmanager string "true" no
alertmanager_extra_args Extra arguments for Alertmanager container map {} no
alertmanager_ingress_annotations Annotations for Alertmanager ingress map {} no
alertmanager_ingress_enabled Enable ingress for Alertmanager string "false" no
alertmanager_ingress_hosts List of Hosts for Alertmanager ingress list [] no
alertmanager_ingress_tls TLS configurationf or Alertmanager ingress list [] no
alertmanager_node_selector Node selector for alertmanager pods map {} no
alertmanager_pdb PDB for Alertmanager map
{
"maxUnavailable": 1
}
no
alertmanager_pull_policy Image pull policy for Alertmanager string "IfNotPresent" no
alertmanager_pv_access_modes alertmanager data Persistent Volume access modes list
[
"ReadWriteOnce"
]
no
alertmanager_pv_enabled Enable persistent volume on Alertmanager string "true" no
alertmanager_pv_size alertmanager data Persistent Volume size string "2Gi" no
alertmanager_release_name Helm release name for Alertmanager string "alertmanager" no
alertmanager_replica Number of replicas for AlertManager number 1 no
alertmanager_repository Docker repository for Alert Manager string "quay.io/prometheus/alertmanager" no
alertmanager_resources Resources for alertmanager map {} no
alertmanager_security_context Security context for alertmanager pods defined as a map which will be serialized to JSON. map
{
"fsGroup": 65534,
"seccompProfile": {
"type": "RuntimeDefault"
}
}
no
alertmanager_service_account Name of the service account for AlertManager. Defaults to component's fully qualified name. string "" no
alertmanager_service_account_annotations Annotations for the service account map {} no
alertmanager_service_annotations Annotations for Alertmanager service map {} no
alertmanager_service_port Service port for Alertmanager number 80 no
alertmanager_service_type Type of service for Alertmanager string "ClusterIP" no
alertmanager_statefulset_annotations Annotations for Alertmanager statefulSet map {} no
alertmanager_storage_class Storage class for alertmanager PV. If set to "-", storageClassName: "", which disables dynamic provisioning string "" no
alertmanager_tag Tag for Alertmanager Docker Image string "v0.22.2" no
alertmanager_tolerations Tolerations for Alertmanager list [] no
chart_name Helm chart name to provision string "prometheus" no
chart_namespace Namespace to install the chart into string "default" no
chart_repository Helm repository for the chart string "https://prometheus-community.github.io/helm-charts" no
chart_version Version of Chart to install. Set to empty to install the latest version string "" no
configmap_extra_args Extra arguments for ConfigMap Reload map {} no
configmap_extra_volumes Extra volumes for ConfigMap Extra Volumes list [] no
configmap_image_repo Docker Image repo for ConfigMap Reload string "jimmidyson/configmap-reload" no
configmap_image_tag Docker image tag for ConfigMap Reload string "v0.5.0" no
configmap_name Name of the ConfigMap Reload container string "configmap-reload" no
configmap_pull_policy Image pull policy for ConfigMap reload string "IfNotPresent" no
configmap_resources Resources for ConfigMap Reload pod map {} no
enable_network_policy Create a NetworkPolicy resource string "false" no
extra_scrape_configs YAML String for extra scrape configs string "" no
image_pull_secrets Image pull secrets, if any map {} no
kube_state_metrics_affinity Affinity for Kube State Metrics map {} no
kube_state_metrics_annotations Annotations for Kube State Metrics pods map {} no
kube_state_metrics_autosharding If set to true, this will deploy kube-state-metrics as a StatefulSet and the data
will be automatically sharded across <.Values.replicas> pods using the built-in
autodiscovery feature: https://github.com/kubernetes/kube-state-metrics#automated-sharding
This is an experimental feature and there are no stability guarantees.
bool false no
kube_state_metrics_chart_name Helm chart name to provision string "kube-state-metrics" no
kube_state_metrics_chart_namespace Namespace to install the chart into string "default" no
kube_state_metrics_chart_repository Helm repository for the chart string "https://prometheus-community.github.io/helm-charts" no
kube_state_metrics_chart_version Version of Chart to install. Set to empty to install the latest version string "" no
kube_state_metrics_collection_namespace Specific namespaces to collect metrics for string "" no
kube_state_metrics_collectors Collectors for Kube state metrics list
[
"certificatesigningrequests",
"configmaps",
"cronjobs",
"daemonsets",
"deployments",
"endpoints",
"horizontalpodautoscalers",
"ingresses",
"jobs",
"limitranges",
"mutatingwebhookconfigurations",
"namespaces",
"networkpolicies",
"nodes",
"persistentvolumeclaims",
"persistentvolumes",
"poddisruptionbudgets",
"pods",
"replicasets",
"replicationcontrollers",
"resourcequotas",
"secrets",
"services",
"statefulsets",
"storageclasses",
"validatingwebhookconfigurations",
"verticalpodautoscalers",
"volumeattachments"
]
no
kube_state_metrics_container_security_context Security context for kube_state_metrics containers defined as a map which will be serialized to JSON. map {} no
kube_state_metrics_enable Enable Kube State Metrics string "true" no
kube_state_metrics_extra_args Extra arguments for Kube State Metrics container map {} no
kube_state_metrics_extra_env Extra environment variables for Kube State Metrics container map {} no
kube_state_metrics_host_network Use host network for KSM bool false no
kube_state_metrics_labels Labels for Kube State Metrics map {} no
kube_state_metrics_metric_allow_list This list of metrics to be exposed for KSM list [] no
kube_state_metrics_metric_deny_list This list of metrics not to be enabled for KSM list [] no
kube_state_metrics_metric_label_allow_list This list of additional Kubernetes label keys that will be used in the resource's lables metric list [] no
kube_state_metrics_node_selector Node selector for Kube State Metrics pods map {} no
kube_state_metrics_pdb PDB for Kubestatemetrics map
{
"maxUnavailable": 1
}
no
kube_state_metrics_pod_security_policy_additional_volumes PodSecurityPolicy additional volumes for Kube State Metrics list [] no
kube_state_metrics_pod_security_policy_annotations PodSecurityPolicy annotations for Kube State Metrics map
{
"apparmor.security.beta.kubernetes.io/allowedProfileNames": "runtime/default",
"apparmor.security.beta.kubernetes.io/defaultProfileName": "runtime/default"
}
no
kube_state_metrics_priority_class_name Priority Class Name for Kube State Metrics pods string "" no
kube_state_metrics_pull_policy Image pull policy for Kube State Metrics string "IfNotPresent" no
kube_state_metrics_release_name Helm release name for Kube State Metrics string "kube-state-metrics" no
kube_state_metrics_replica Number of replicas for Kube State Metrics number 1 no
kube_state_metrics_repository Docker repository for Kube State Metrics string "registry.k8s.io/kube-state-metrics/kube-state-metrics" no
kube_state_metrics_resources Resources for Kube State Metrics map {} no
kube_state_metrics_security_context Security context for kube_state_metrics pods defined as a map which will be serialized to JSON. map
{
"enabled": true,
"fsGroup": 65534,
"runAsGroup": 65534,
"runAsUser": 65534,
"seccompProfile": {
"type": "RuntimeDefault"
}
}
no
kube_state_metrics_service_account Name of the service account for kubeStateMetrics. Defaults to component's fully qualified name. string "" no
kube_state_metrics_service_account_annotations Annotations for the service account map {} no
kube_state_metrics_service_annotations Annotations for Kube State Metrics service map
{
"prometheus.io/scrape": "true"
}
no
kube_state_metrics_service_cluster_ip Cluster IP for Kube State Metrics Service string "None" no
kube_state_metrics_service_lb_ip Load Balancer IP for Kube State Metrics service string "" no
kube_state_metrics_service_port Service port for Kube State Metrics number 80 no
kube_state_metrics_service_type Type of service for Kube State Metrics string "ClusterIP" no
kube_state_metrics_tag Tag for Kube State Metrics Docker Image string "v2.1.0" no
kube_state_metrics_tolerations Tolerations for Kube State Metrics list [] no
max_history Max History for Helm number 20 no
node_exporter_affinity Affinity for node_exporter pods map {} no
node_exporter_annotations Annotations for Node Exporter pods map {} no
node_exporter_chart_name Helm chart name to provision for Node Exporter string "prometheus-node-exporter" no
node_exporter_chart_namespace Namespace to install the chart into string "default" no
node_exporter_chart_repository Helm repository for the Node Exporter chart string "https://prometheus-community.github.io/helm-charts" no
node_exporter_chart_version Version of Node Exporter Chart to install. Set to empty to install the latest version string "" no
node_exporter_config_map_mounts ConfigMap Mounts for Node Exporter list [] no
node_exporter_enable Enable Node Exporter string "true" no
node_exporter_enable_pod_security_policy Create PodSecurityPolicy for Node Exporter string "false" no
node_exporter_extra_args Extra arguments for Node Exporter container map {} no
node_exporter_host_network Use the Host network namespace for Node Exporter string "true" no
node_exporter_host_path_mounts Host Path Mounts for Node Exporter list [] no
node_exporter_labels Labels for Node Exporter map {} no
node_exporter_node_selector Node selector for node_exporter pods map {} no
node_exporter_pod_security_policy_annotations PodSecurityPolicy annotations for Node exporter map
{
"apparmor.security.beta.kubernetes.io/allowedProfileNames": "runtime/default",
"apparmor.security.beta.kubernetes.io/defaultProfileName": "runtime/default",
"seccomp.security.alpha.kubernetes.io/allowedProfileNames": "docker/default,runtime/default",
"seccomp.security.alpha.kubernetes.io/defaultProfileName": "runtime/default"
}
no
node_exporter_priority_class_name Priority Class Name for Node Exporter pods string "" no
node_exporter_pull_policy Image pull policy for Node Exporter string "IfNotPresent" no
node_exporter_release_name Helm release name for Node Exporter string "prometheus-node-exporter" no
node_exporter_repository Docker repository for Node Exporter string "quay.io/prometheus/node-exporter" no
node_exporter_resources Resources for node_exporter map {} no
node_exporter_security_context Security context for node_exporter pods defined as a map which will be serialized to JSON. map
{
"fsGroup": 65534,
"runAsGroup": 65534,
"runAsNonRoot": true,
"runAsUser": 65534,
"seccompProfile": {
"type": "RuntimeDefault"
},
"supplementalGroups": [
0
]
}
no
node_exporter_service_account Name of the service account for nodeExporter. Defaults to component's fully qualified name. string "" no
node_exporter_service_account_annotations Annotations for the service account map {} no
node_exporter_service_annotations Annotations for Node Exporter service map
{
"prometheus.io/scrape": "true"
}
no
node_exporter_service_port Service port for Node Exporter number 9100 no
node_exporter_service_type Type of service for Node Exporter string "ClusterIP" no
node_exporter_tag Tag for Node Exporter Docker Image string "v1.2.0" no
node_exporter_tolerations Tolerations for Node Exporter list [] no
pod_security_policy_enable Create PodSecurityPolicy Resources bool true no
prometheus_enable Enable Prometheus stack. Disable to use independent components like KSM and Node Exporter. bool true no
prometheus_remote_read_api_url Prometheus remote read URL string null no
prometheus_remote_write_api_url Prometheus remote write URL string null no
pushgateway_annotations Annotations for Pushgateway pods map {} no
pushgateway_deployment_annotations Annotations to be added to Pushgateway deployment map {} no
pushgateway_enable Enable Pushgateway string "true" no
pushgateway_extra_args Extra arguments for Pushgateway container map {} no
pushgateway_extra_env Extra environment variables for Pushgateway container map {} no
pushgateway_extra_init_containers Additional InitContainers to initialize the Pushgateway pod list [] no
pushgateway_ingress_annotations Annotations for Pushgateway ingress map {} no
pushgateway_ingress_enabled Enable ingress for Pushgateway string "false" no
pushgateway_ingress_extra_labels Additional labels for Pushgateway ingress map {} no
pushgateway_ingress_extra_paths Extra paths to prepend to every host configuration for Pushgateway ingress list [] no
pushgateway_ingress_hosts List of Hosts for Pushgateway ingress list [] no
pushgateway_ingress_path Path of Pushgateway ingress string "/" no
pushgateway_ingress_tls TLS configurationf or Pushgateway ingress list [] no
pushgateway_node_selector Node selector for pushgateway pods map {} no
pushgateway_pdb_enable Enable PDB bool true no
pushgateway_pdb_max_unavailable Max unavailable pods number 1 no
pushgateway_pod_security_policy_annotations PodSecurityPolicy annotations for Pushgateway map
{
"apparmor.security.beta.kubernetes.io/allowedProfileNames": "runtime/default",
"apparmor.security.beta.kubernetes.io/defaultProfileName": "runtime/default"
}
no
pushgateway_priority_class_name Priority Class Name for Pushgateway pods string "" no
pushgateway_pull_policy Image pull policy for Pushgateway string "IfNotPresent" no
pushgateway_pv_access_modes pushgateway data Persistent Volume access modes list
[
"ReadWriteOnce"
]
no
pushgateway_pv_annotations Annotations for Pushgateway PV map {} no
pushgateway_pv_enabled Enable persistent volume on Pushgateway string "true" no
pushgateway_pv_existing_claim Use an existing PV claim for pushgateway string "" no
pushgateway_pv_size pushgateway data Persistent Volume size string "2Gi" no
pushgateway_replica Number of replicas for pushgateway number 1 no
pushgateway_repository Docker repository for Pushgateway string "quay.io/prometheus/pushgateway" no
pushgateway_resources Resources for pushgateway map {} no
pushgateway_security_context Security context for pushgateway pods defined as a map which will be serialized to JSON map
{
"runAsNonRoot": true,
"runAsUser": 65534,
"seccompProfile": {
"type": "RuntimeDefault"
}
}
no
pushgateway_service_account Name of the service account for pushgateway. Defaults to component's fully qualified name. string "" no
pushgateway_service_account_annotations Annotations for the service account map {} no
pushgateway_service_annotations Annotations for Pushgateway service map
{
"prometheus.io/probe": "pushgateway"
}
no
pushgateway_service_cluster_ip Cluster IP for Pushgateway Service string "" no
pushgateway_service_external_ips External IPs for Pushgateway service list [] no
pushgateway_service_labels Labels for Pushgateway service map {} no
pushgateway_service_lb_ip Load Balancer IP for Pushgateway service string "" no
pushgateway_service_lb_source_ranges List of source CIDRs allowed to access the Pushgateway LB list [] no
pushgateway_service_port Service port for Pushgateway number 9091 no
pushgateway_service_type Type of service for Pushgateway string "ClusterIP" no
pushgateway_tag Tag for Pushgateway Docker Image string "v1.4.1" no
pushgateway_tolerations Tolerations for Pushgateway list [] no
release_name Helm release name for Prometheus string "prometheus" no
scrape_drop_pod_containers_without_port For pod targets, Prometheus generates a target per pod per container per port. For containers without a port, it leave the target in without any port. Configure to drop these targets bool false no
scrape_drop_service_pod_containers_without_port For service targets, Prometheus generates a target per service per pod per container per port. For containers without a port, it leave the target in without any port. Configure to drop these targets bool false no
scrape_skip_apiserver_tls_verify Skip verifying TLS Certificate for Kubernetes Master Server Scrape target. Warning: This is insecure bool false no
scrape_skip_nodes_tls_verify Skip verifying TLS Certificate for Kubernetes Nodes Scrape target. Warning: This is insecure bool false no
server_additional_global YAML string for additional global configuration for Prometheus Server string "" no
server_affinity Affinity for server pods map {} no
server_alert_managers_configs Prometheus AlertManager configuration list [] no
server_alerts Prometheus server alerts entries in YAML. Ref: https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/ string "[]\n# - name: Instances\n# rules:\n# - alert: InstanceDown\n# expr: up == 0\n# for: 5m\n# labels:\n# severity: page\n# annotations:\n# description: '{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 5 minutes.'\n# summary: 'Instance {{ $labels.instance }} down'\n" no
server_annotations Annotations to be added to Prometheus server pods map {} no
server_base_url External URL which can access alertmanager string "" no
server_config_override Overriding the Prometheus server config file in YAML string "" no
server_data_retention Prometheus data retention period (i.e 360h) string "" no
server_deployment_annotations Annotations to be added to server deployment map {} no
server_emptydir_size_limit Prometheus server emptyDir volume size limit string "" no
server_enable Deploy Prometheus Server string "true" no
server_enable_service_links EnableServiceLinks indicates whether information about services should be injected into pod's environment variables, matching the syntax of Docker links. bool true no
server_evaluation_interval How frequently to evaluate rules string "1m" no
server_extra_args Extra arguments for server container map {} no
server_extra_configmap_mounts Additional Prometheus server ConfigMap mounts list [] no
server_extra_env Extra environment variables for server container map {} no
server_extra_flags Additional flags to control Prometheus server behaviour. list [] no
server_extra_host_path_mounts Additional Prometheus server hostPath mounts list [] no
server_extra_init_containers Additional InitContainers to initialize the pod list [] no
server_extra_secret_mounts Extra secret mounts for server list [] no
server_extra_volume_mounts Additional Prometheus server Volume mounts list [] no
server_extra_volumes Additional Prometheus server Volumes list [] no
server_headless_annotations Annotations for server StatefulSet headless service map {} no
server_headless_grpc_enabled Enable gRPC port on service to allow auto discovery with thanos-querier bool false no
server_headless_grpc_port gRPC servicePort for server headless service number 10901 no
server_headless_labels Labels for server StatefulSet headless service map {} no
server_host_aliases hostAliases allows adding entries to /etc/hosts inside the containers list [] no
server_host_network_enabled Required for use in managed kubernetes clusters (such as AWS EKS) with custom CNI (such as calico), because control-plane managed by AWS cannot communicate with pods' IP CIDR and admission webhooks are not working bool false no
server_ingress_annotations Annotations for server ingress map {} no
server_ingress_enabled Enable ingress for server string "false" no
server_ingress_extra_labels Additional labels for server ingress map {} no
server_ingress_extra_paths Extra paths to prepend to every host configuration for server ingress list [] no
server_ingress_hosts List of Hosts for server ingress list [] no
server_ingress_path Path of server ingress string "/" no
server_ingress_tls TLS configurationf or server ingress list [] no
server_node_selector Node labels for Prometheus server pod assignment map {} no
server_pdb_enable Enable PDB bool true no
server_pdb_max_unavailable Max unavailable pods number 1 no
server_pod_labels Labels to be added to Prometheus server pods map {} no
server_pod_probes Prometheus server readiness and liveness probe initial delay and timeout map
{
"livenessProbeFailureThreshold": 3,
"livenessProbeInitialDelay": 30,
"livenessProbePeriodSeconds": 15,
"livenessProbeSuccessThreshold": 1,
"livenessProbeTimeout": 10,
"readinessProbeFailureThreshold": 3,
"readinessProbeInitialDelay": 30,
"readinessProbePeriodSeconds": 5,
"readinessProbeSuccessThreshold": 1,
"readinessProbeTimeout": 10
}
no
server_pod_security_policy_annotations PodSecurityPolicy annotations for server map
{
"apparmor.security.beta.kubernetes.io/allowedProfileNames": "runtime/default",
"apparmor.security.beta.kubernetes.io/defaultProfileName": "runtime/default"
}
no
server_prefix_url The URL prefix at which the container can be accessed. Useful in the case the '-web.external-url' includes a slug so that the various internal URLs are still able to access as they are in the default case. string "" no
server_priority_class_name Priority Class Name for server pods string "" no
server_pull_policy Image pull policy for server string "IfNotPresent" no
server_pv_access_modes server data Persistent Volume access modes list
[
"ReadWriteOnce"
]
no
server_pv_annotations Annotations for server PV map {} no
server_pv_enabled Enable persistent volume on server string "true" no
server_pv_existing_claim Use an existing PV claim for server string "" no
server_pv_size server data Persistent Volume size string "8Gi" no
server_replica Number of replicas for server number 1 no
server_repository Docker repository for server string "quay.io/prometheus/prometheus" no
server_resources Resources for server map {} no
server_rules Prometheus server rules entries in YAML string "[]\n# - name: k8s_health\n# rules:\n# - record: k8s_container_oom\n# expr: increase(kube_pod_container_status_last_terminated_reason{reason=\"OOMKilled\"}[2m]) and on(pod) increase(kube_pod_container_status_restarts_total[2m])\n" no
server_scrape_interval How frequently to scrape targets by default string "1m" no
server_scrape_timeout How long until a scrape request times out string "10s" no
server_security_context Security context for server pods defined as a map which will be serialized to JSON map
{
"fsGroup": 65534,
"runAsGroup": 65534,
"runAsNonRoot": true,
"runAsUser": 65534,
"seccompProfile": {
"type": "RuntimeDefault"
}
}
no
server_service_account Name of the service account for server. Defaults to component's fully qualified name. string "" no
server_service_account_annotations Annotations for the service account map {} no
server_service_annotations Annotations for server service map
{
"prometheus.io/probe": "server"
}
no
server_service_cluster_ip Cluster IP for server Service string "" no
server_service_external_ips External IPs for server service list [] no
server_service_grpc_enabled Enable gRPC port on service to allow auto discovery with thanos-querier bool false no
server_service_grpc_port gRPC servicePort for server service string "10901" no
server_service_labels Labels for server service map {} no
server_service_lb_ip Load Balancer IP for server service string "" no
server_service_lb_source_ranges List of source CIDRs allowed to access the server LB list [] no
server_service_port Service port for Prometheus server number 9091 no
server_service_session_affinity Service sessionAffinity for Prometheus server string "None" no
server_service_type Type of service for Prometheus server string "ClusterIP" no
server_sidecar_containers Sidecar containers for server list [] no
server_statefulset_annotations Annotations to be added to server statefulSet map {} no
server_statefulset_labels Labels to be added to Prometheus server statefulSet map {} no
server_tag Tag for server Docker Image string "v2.28.1" no
server_termination_grace_seconds Prometheus server pod termination grace period string "300" no
server_tolerations Node tolerations for server scheduling to nodes with taints list [] no
server_vpa_container_policies server VPA containerPolicies map {} no
server_vpa_enabled If true a VPA object will be created for the controller (either StatefulSet or Deployemnt) bool false no
server_vpa_update_mode server VPA updateMode string "" no

Outputs

Name Description
prometheus_alerts_api_url Prometheus query API URL: https://prometheus.io/docs/prometheus/latest/querying/api/#expression-queries
prometheus_query_api_url Prometheus query API URL: https://prometheus.io/docs/prometheus/latest/querying/api/#expression-queries