diff --git a/catalog.json b/catalog.json index 336a2519b3..7f552efd29 100644 --- a/catalog.json +++ b/catalog.json @@ -49,7 +49,7 @@ "latest_version": "1.0.1", "latest_app_version": "8.7.0", "latest_human_version": "8.7.0_1.0.1", - "last_update": "2023-04-11 15:33:26", + "last_update": "2023-04-12 13:31:20", "name": "elastic-search", "recommended": false, "title": "Elastic Search", @@ -149,6 +149,25 @@ "title": "Pi-hole", "icon_url": "https://github.com/pi-hole/graphics/raw/master/Vortex/Vortex_Vertical_wordmark_lightmode.png?raw=true)" }, + "prometheus": { + "app_readme": "
Prometheus - Monitoring system and time series database.
\n\n\nWhen application is installed, a container will be launched with root privileges.\nThis is required in order to apply the correct permissions to the
\nprometheusdirectories.\nAfterward, theprometheuscontainer will run as a non-root user (Default:568).\nAlso an empty configuration file will be created.
The configuration file is located at /config/prometheus.yml inside the container.\nData is stored at /data inside the container.
WG-Easy (WireGuard Easy) is the easiest way to install & manage WireGuard!
", "categories": [ diff --git a/charts/prometheus/1.0.0/Chart.lock b/charts/prometheus/1.0.0/Chart.lock new file mode 100644 index 0000000000..110c830406 --- /dev/null +++ b/charts/prometheus/1.0.0/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: common + repository: file://../../../common + version: 1.0.3 +digest: sha256:1a090020cfa582aff29906320874ffe9b543fcc6c2423c281f434514f2653e02 +generated: "2023-04-06T18:56:51.017765304+03:00" diff --git a/charts/prometheus/1.0.0/Chart.yaml b/charts/prometheus/1.0.0/Chart.yaml new file mode 100644 index 0000000000..f751a581d9 --- /dev/null +++ b/charts/prometheus/1.0.0/Chart.yaml @@ -0,0 +1,25 @@ +name: prometheus +description: The Prometheus monitoring system and time series database. +annotations: + title: Prometheus +type: application +version: 1.0.0 +apiVersion: v2 +appVersion: v2.43.0 +kubeVersion: '>=1.16.0-0' +maintainers: + - name: truenas + url: https://www.truenas.com/ +dependencies: + - name: common + repository: file://../../../common + version: 1.0.3 +home: https://prometheus.io +icon: https://avatars.githubusercontent.com/u/3380462 +sources: + - https://github.com/prometheus/prometheus + - https://github.com/truenas/charts/tree/master/charts/prometheus + - https://prometheus.io +keywords: + - metrics + - prometheus diff --git a/charts/prometheus/1.0.0/README.md b/charts/prometheus/1.0.0/README.md new file mode 100644 index 0000000000..a3d6b46393 --- /dev/null +++ b/charts/prometheus/1.0.0/README.md @@ -0,0 +1,11 @@ +# Prometheus + +[Prometheus](https://prometheus.io/) - Monitoring system and time series database. + +> When application is installed, a container will be launched with **root** privileges. +> This is required in order to apply the correct permissions to the `prometheus` directories. +> Afterward, the `prometheus` container will run as a **non**-root user (Default: `568`). +> Also an empty configuration file will be created. + +The configuration file is located at `/config/prometheus.yml` inside the container. +Data is stored at `/data` inside the container. diff --git a/charts/prometheus/1.0.0/app-readme.md b/charts/prometheus/1.0.0/app-readme.md new file mode 100644 index 0000000000..a3d6b46393 --- /dev/null +++ b/charts/prometheus/1.0.0/app-readme.md @@ -0,0 +1,11 @@ +# Prometheus + +[Prometheus](https://prometheus.io/) - Monitoring system and time series database. + +> When application is installed, a container will be launched with **root** privileges. +> This is required in order to apply the correct permissions to the `prometheus` directories. +> Afterward, the `prometheus` container will run as a **non**-root user (Default: `568`). +> Also an empty configuration file will be created. + +The configuration file is located at `/config/prometheus.yml` inside the container. +Data is stored at `/data` inside the container. diff --git a/charts/prometheus/1.0.0/charts/common-1.0.3.tgz b/charts/prometheus/1.0.0/charts/common-1.0.3.tgz new file mode 100644 index 0000000000..f3940bf704 Binary files /dev/null and b/charts/prometheus/1.0.0/charts/common-1.0.3.tgz differ diff --git a/charts/prometheus/1.0.0/ci/basic-values.yaml b/charts/prometheus/1.0.0/ci/basic-values.yaml new file mode 100644 index 0000000000..aa49ea1c01 --- /dev/null +++ b/charts/prometheus/1.0.0/ci/basic-values.yaml @@ -0,0 +1,7 @@ +prometheusStorage: + data: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/data + config: + type: hostPath + hostPath: /mnt/{{ .Release.Name }}/config diff --git a/charts/prometheus/1.0.0/ix_values.yaml b/charts/prometheus/1.0.0/ix_values.yaml new file mode 100644 index 0000000000..0020db1d0c --- /dev/null +++ b/charts/prometheus/1.0.0/ix_values.yaml @@ -0,0 +1,34 @@ +image: + repository: prom/prometheus + pullPolicy: IfNotPresent + tag: v2.43.0 + +resources: + limits: + cpu: 4000m + memory: 8Gi + +prometheusConfig: + retentionTime: 15d + retentionSize: "" + walCompression: true + additionalEnvs: [] + additionalArgs: [] + +prometheusNetwork: + apiPort: 30000 + hostNetwork: false + +prometheusRunAs: + user: 568 + group: 568 + +prometheusStorage: + data: + type: ixVolume + hostPath: '' + datasetName: data + config: + type: ixVolume + hostPath: '' + datasetName: config diff --git a/charts/prometheus/1.0.0/questions.yaml b/charts/prometheus/1.0.0/questions.yaml new file mode 100644 index 0000000000..e9c300bdb2 --- /dev/null +++ b/charts/prometheus/1.0.0/questions.yaml @@ -0,0 +1,239 @@ +groups: + - name: Prometheus Configuration + description: Configure Prometheus + - name: User and Group Configuration + description: Configure User and Group for Prometheus + - name: Network Configuration + description: Configure Network for Prometheus + - name: Storage Configuration + description: Configure Storage for Prometheus + - name: Resources Configuration + description: Configure Resources for Prometheus + +portals: + web_portal: + protocols: + - "$kubernetes-resource_configmap_portal_protocol" + host: + - "$kubernetes-resource_configmap_portal_host" + ports: + - "$kubernetes-resource_configmap_portal_port" + path: "$kubernetes-resource_configmap_portal_path" + +questions: + + - variable: prometheusConfig + label: "" + group: Prometheus Configuration + schema: + type: dict + attrs: + - variable: retentionTime + label: Retention Time + description: The time to retain data for. Use the format 15d, 6w, 10y, etc. + schema: + type: string + default: "15d" + required: true + - variable: retentionSize + label: Retention Size + description: The size to retain data for. Use the format 100MB, 10GB, etc. + schema: + type: string + default: "" + - variable: walCompression + label: WAL Compression + description: Compress the time series database write-ahead log. + schema: + type: boolean + default: true + - variable: additionalArgs + label: Additional Arguments + description: Configure additional arguments for Prometheus. + schema: + type: list + default: [] + items: + - variable: arg + label: Argument + schema: + type: string + required: true + default: "" + - variable: additionalEnvs + label: Additional Environment Variables + description: Configure additional environment variables for Prometheus. + schema: + type: list + default: [] + items: + - variable: env + label: Environment Variable + schema: + type: dict + attrs: + - variable: name + label: Name + schema: + type: string + required: true + - variable: value + label: Value + schema: + type: string + required: true + + - variable: prometheusRunAs + label: "" + group: User and Group Configuration + schema: + type: dict + attrs: + - variable: user + label: User ID + description: The user id that Prometheus will run as. + schema: + type: int + min: 1 + default: 568 + required: true + - variable: group + label: Group ID + description: The group id that Prometheus will run as. + schema: + type: int + min: 1 + default: 568 + required: true + + - variable: prometheusNetwork + label: "" + group: Network Configuration + schema: + type: dict + attrs: + - variable: apiPort + label: API Port + description: The port for the Prometheus API (And WebUI). + schema: + type: int + default: 30000 + min: 9000 + max: 65535 + required: true + - variable: hostNetwork + label: Host Network + description: | + Bind to the host network. It's recommended to keep this disabled. + schema: + type: boolean + default: false + + - variable: prometheusStorage + label: "" + group: Storage Configuration + schema: + type: dict + attrs: + - variable: data + label: Prometheus Data Storage + description: The path to store Prometheus data/metrics. + schema: + type: dict + attrs: + - variable: type + label: Type + description: | + ixVolume: Is dataset created automatically by the system. + Host Path: Is a path that already exists on the system. + schema: + type: string + required: true + default: ixVolume + enum: + - value: hostPath + description: Host Path (Path that already exists on the system) + - value: ixVolume + description: ixVolume (Dataset created automatically by the system) + - variable: datasetName + label: Dataset Name + schema: + type: string + show_if: [["type", "=", "ixVolume"]] + required: true + hidden: true + immutable: true + default: data + $ref: + - "normalize/ixVolume" + - variable: hostPath + label: Host Path + schema: + type: hostpath + show_if: [["type", "=", "hostPath"]] + immutable: true + required: true + - variable: config + label: Prometheus Config Storage + description: The path to store Prometheus config storage. + schema: + type: dict + attrs: + - variable: type + label: Type + description: | + ixVolume: Is dataset created automatically by the system. + Host Path: Is a path that already exists on the system. + schema: + type: string + required: true + default: ixVolume + enum: + - value: hostPath + description: Host Path (Path that already exists on the system) + - value: ixVolume + description: ixVolume (Dataset created automatically by the system) + - variable: datasetName + label: Dataset Name + schema: + type: string + show_if: [["type", "=", "ixVolume"]] + required: true + hidden: true + immutable: true + default: config + $ref: + - "normalize/ixVolume" + - variable: hostPath + label: Host Path + schema: + type: hostpath + show_if: [["type", "=", "hostPath"]] + immutable: true + required: true + + - variable: resources + label: "" + group: Resources Configuration + schema: + type: dict + attrs: + - variable: limits + label: Limits + schema: + type: dict + attrs: + - variable: cpu + label: CPU + description: CPU limit for Prometheus. + schema: + type: string + default: 4000m + required: true + - variable: memory + label: Memory + description: Memory limit for Prometheus. + schema: + type: string + default: 8Gi + required: true diff --git a/charts/prometheus/1.0.0/templates/NOTES.txt b/charts/prometheus/1.0.0/templates/NOTES.txt new file mode 100644 index 0000000000..ba4e01146c --- /dev/null +++ b/charts/prometheus/1.0.0/templates/NOTES.txt @@ -0,0 +1 @@ +{{ include "ix.v1.common.lib.chart.notes" $ }} diff --git a/charts/prometheus/1.0.0/templates/_portal.tpl b/charts/prometheus/1.0.0/templates/_portal.tpl new file mode 100644 index 0000000000..bd6661fd7f --- /dev/null +++ b/charts/prometheus/1.0.0/templates/_portal.tpl @@ -0,0 +1,12 @@ +{{- define "prometheus.portal" -}} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: portal +data: + path: / + port: {{ .Values.prometheusNetwork.apiPort | quote }} + protocol: http + host: $node_ip +{{- end -}} diff --git a/charts/prometheus/1.0.0/templates/_prometheus.tpl b/charts/prometheus/1.0.0/templates/_prometheus.tpl new file mode 100644 index 0000000000..a5cb217c71 --- /dev/null +++ b/charts/prometheus/1.0.0/templates/_prometheus.tpl @@ -0,0 +1,120 @@ +{{- define "prometheus.workload" -}} +workload: + prometheus: + enabled: true + primary: true + type: Deployment + podSpec: + hostNetwork: {{ .Values.prometheusNetwork.hostNetwork }} + containers: + prometheus: + enabled: true + primary: true + imageSelector: image + securityContext: + runAsUser: {{ .Values.prometheusRunAs.user }} + runAsGroup: {{ .Values.prometheusRunAs.group }} + args: + - --web.listen-address=0.0.0.0:{{ .Values.prometheusNetwork.apiPort }} + - --storage.tsdb.path=/data + - --config.file=/config/prometheus.yml + - --storage.tsdb.retention.time={{ .Values.prometheusConfig.retentionTime }} + {{ with .Values.prometheusConfig.retentionSize }} + - --storage.tsdb.retention.size={{ . }} + {{ end }} + {{ if .Values.prometheusConfig.walCompression }} + - --storage.tsdb.wal-compression + {{ end }} + {{ with .Values.prometheusConfig.additionalArgs }} + extraArgs: + {{ range $arg := . }} + - {{ $arg | quote }} + {{ end }} + {{ end }} + {{ with .Values.prometheusConfig.additionalEnvs }} + env: + {{ range $env := . }} + {{ $env.name }}: {{ $env.value }} + {{ end }} + {{ end }} + probes: + liveness: + enabled: true + type: http + port: {{ .Values.prometheusNetwork.apiPort }} + path: /-/healthy + readiness: + enabled: true + type: http + port: {{ .Values.prometheusNetwork.apiPort }} + path: /-/ready + startup: + enabled: true + type: http + port: {{ .Values.prometheusNetwork.apiPort }} + path: /-/ready + initContainers: + {{- include "ix.v1.common.app.permissions" (dict "containerName" "01-permissions" + "UID" .Values.prometheusRunAs.user + "GID" .Values.prometheusRunAs.group + "type" "install") | nindent 8 }} + init-config: + enabled: true + type: init + imageSelector: image + resources: + limits: + cpu: 500m + memory: 256Mi + securityContext: + runAsUser: {{ .Values.prometheusRunAs.user }} + runAsGroup: {{ .Values.prometheusRunAs.group }} + command: sh + args: + - -c + - | + if [ ! -f /config/prometheus.yml ]; then + touch /config/prometheus.yml + fi +{{/* Service */}} +service: + prometheus: + enabled: true + primary: true + type: NodePort + targetSelector: prometheus + ports: + prometheus: + enabled: true + primary: true + port: {{ .Values.prometheusNetwork.apiPort }} + nodePort: {{ .Values.prometheusNetwork.apiPort }} + targetSelector: prometheus + +{{/* Persistence */}} +persistence: + data: + enabled: true + type: {{ .Values.prometheusStorage.data.type }} + datasetName: {{ .Values.prometheusStorage.data.datasetName | default "" }} + hostPath: {{ .Values.prometheusStorage.data.hostPath | default "" }} + targetSelector: + prometheus: + prometheus: + mountPath: /data + 01-permissions: + mountPath: /mnt/directories/data + config: + enabled: true + type: {{ .Values.prometheusStorage.config.type }} + datasetName: {{ .Values.prometheusStorage.config.datasetName | default "" }} + hostPath: {{ .Values.prometheusStorage.config.hostPath | default "" }} + targetSelector: + prometheus: + prometheus: + mountPath: /config + 01-permissions: + mountPath: /mnt/directories/export + init-config: + mountPath: /config +{{- end -}} diff --git a/charts/prometheus/1.0.0/templates/common.yaml b/charts/prometheus/1.0.0/templates/common.yaml new file mode 100644 index 0000000000..a9ecc78312 --- /dev/null +++ b/charts/prometheus/1.0.0/templates/common.yaml @@ -0,0 +1,9 @@ +{{- include "ix.v1.common.loader.init" . -}} + +{{/* Merge the templates with Values */}} +{{- $_ := mustMergeOverwrite .Values (include "prometheus.workload" $ | fromYaml) -}} + +{{/* Create the configmap for portal manually*/}} +{{- include "prometheus.portal" $ -}} + +{{- include "ix.v1.common.loader.apply" . -}} diff --git a/charts/prometheus/item.yaml b/charts/prometheus/item.yaml new file mode 100644 index 0000000000..fd8f9c90f1 --- /dev/null +++ b/charts/prometheus/item.yaml @@ -0,0 +1,4 @@ +icon_url: https://avatars.githubusercontent.com/u/3380462 +categories: + - metrics + - prometheus