%define COMPONENT infra-charts
%define RPM_NAME caas-%{COMPONENT}
%define RPM_MAJOR_VERSION 1.0.0
-%define RPM_MINOR_VERSION 27
+%define RPM_MINOR_VERSION 28
Name: %{RPM_NAME}
Version: %{RPM_MAJOR_VERSION}
Release: %{RPM_MINOR_VERSION}%{?dist}
Summary: Containers as a Service helm charts
License: %{_platform_license}
-BuildArch: x86_64
+BuildArch: noarch
Vendor: %{_platform_vendor}
Source0: %{name}-%{version}.tar.gz
%define COMPONENT instantiate
%define RPM_NAME caas-%{COMPONENT}
%define RPM_MAJOR_VERSION 1.0.0
-%define RPM_MINOR_VERSION 16
+%define RPM_MINOR_VERSION 17
Name: %{RPM_NAME}
Version: %{RPM_MAJOR_VERSION}
Release: %{RPM_MINOR_VERSION}%{?dist}
Summary: Containers as a Service instantiate playbooks
License: %{_platform_license}
-BuildArch: x86_64
+BuildArch: noarch
Vendor: %{_platform_vendor}
Source0: %{name}-%{version}.tar.gz
%define COMPONENT utils
%define RPM_NAME caas-%{COMPONENT}
%define RPM_MAJOR_VERSION 1.0.0
-%define RPM_MINOR_VERSION 5
+%define RPM_MINOR_VERSION 6
%define KUBELET_PLUGINS_LOGDIR /var/log/kubelet-plugins/
Name: %{RPM_NAME}
Release: %{RPM_MINOR_VERSION}%{?dist}
Summary: Containers as a Service supplementary utils
License: %{_platform_license}
-BuildArch: x86_64
+BuildArch: noarch
Vendor: %{_platform_vendor}
Source0: %{name}-%{version}.tar.gz
prometheus_port: 9090
prometheus_url: prometheus.kube-system.svc.{{ dns_domain }}
prometheus: https://{{ prometheus_url }}:{{ prometheus_port }}
+prometheus_storage_size: "1Gi"
+prometheus_data_retention_hours: 6
custom_metrics_api_port: 6443
custom_metrics_api_serviceport: 443
metrics_server_port: 443
evaluation_interval: 1m
scrape_configs:
- - job_name: 'kubernetes-apiservers'
-
- kubernetes_sd_configs:
- - role: endpoints
-
- # Default to scraping over https. If required, just disable this or change to
- # `http`.
- scheme: https
-
- # This TLS & bearer token file config is used to connect to the actual scrape
- # endpoints for cluster components. This is separate to discovery auth
- # configuration because discovery & scraping are two separate concerns in
- # Prometheus. The discovery auth config is automatic if Prometheus runs inside
- # the cluster. Otherwise, more config options have to be provided within the
- # <kubernetes_sd_config>.
- tls_config:
- ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
- # If your node certificates are self-signed or use a different CA to the
- # master CA, then disable certificate verification below. Note that
- # certificate verification is an integral part of a secure infrastructure
- # so this should only be disabled in a controlled environment. You can
- # disable certificate verification by uncommenting the line below.
- #
- insecure_skip_verify: true
- bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
-
- # Keep only the default/kubernetes service endpoints for the https port. This
- # will add targets for each API server which Kubernetes adds an endpoint to
- # the default/kubernetes service.
- relabel_configs:
- - source_labels: [__meta_kubernetes_namespace, __meta_kubernetes_service_name, __meta_kubernetes_endpoint_port_name]
- action: keep
- regex: default;kubernetes;https
-
# Scrape config for service endpoints.
#
# The relabeling allows the actual service scrape endpoint to be configured
kubernetes_sd_configs:
- role: endpoints
+ tls_config:
+ ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
+ insecure_skip_verify: false
+ bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
+
relabel_configs:
- source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scrape]
action: keep
http {
server {
listen {{ .Values.prometheus.port }} ssl;
+ access_log /dev/stdout;
ssl_certificate /var/run/serving-cert/prometheus.crt;
ssl_certificate_key /var/run/serving-cert/prometheus.key;
ssl_client_certificate /etc/openssl/ca.pem;
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[program:prometheus]
- command=/bin/prometheus --config.file=/etc/prometheus/prometheus.yml --storage.tsdb.retention=1h --web.listen-address=127.0.0.1:19090
+ command=/bin/prometheus
+ --config.file=/etc/prometheus/prometheus.yml
+ --storage.tsdb.path=/data
+ --storage.tsdb.retention.time={{ .Values.prometheus.data_retention }}h
+ --storage.tsdb.retention.size={{ .Values.prometheus.data_retension_size }}
+ --web.listen-address=127.0.0.1:19090
+ --storage.tsdb.wal-compression
startsecs=3
startretries=1
stopwaitsecs = 3
readOnly: true
- mountPath: /etc/prometheus
name: prometheus-config
+ - mountPath: /data
+ name: prometheus-data
livenessProbe:
httpGet:
path: /api/v1/status/config
- key: supervisord.conf
path: supervisord.conf
mode: 0644
+ - name: prometheus-data
+ persistentVolumeClaim:
+ claimName: prometheus-pvc
{{ end }}
--- /dev/null
+kind: PersistentVolumeClaim
+apiVersion: v1
+metadata:
+ name: prometheus-pvc
+ namespace: kube-system
+spec:
+ accessModes:
+ - ReadWriteOnce
+ resources:
+ requests:
+ storage: {{ .Values.prometheus.storage_size }}
+#jinja2: lstrip_blocks: True
{#
Copyright 2019 Nokia
prometheus_url: {{ caas.prometheus }}
server_cert: {{ prometheus_cert_b64 }}
server_key: {{ prometheus_cert_key_b64 }}
+ storage_size: {{ caas.prometheus_storage_size }}
+ data_retention: {{ caas.prometheus_data_retention_hours }}
+{# human_to_bytes handles decimal prefix as binary prefix #}
+ {% set prometheus_storage_size_in_mbi = (caas.prometheus_storage_size | replace('i','') | human_to_bytes) %}
+ {% set prometheus_wal_size = (3 * 128) | human_to_bytes('MB') %}
+ {% set prometheus_db_size = ((prometheus_storage_size_in_mbi | int) * 0.8) - (prometheus_wal_size | int) %}
+ data_retension_size: {{ ((prometheus_db_size | int) / (1024 | pow(2))) | int }}MB
custom_metrics_api:
required: true