From 51717c19f76b71846780d0eb2ba90aa126f78045 Mon Sep 17 00:00:00 2001 From: bitnami-bot Date: Mon, 8 Jul 2019 11:35:01 +0000 Subject: [PATCH] Synchronize upstreamed folder to 567501aec --- upstreamed/wordpress/Chart.yaml | 2 +- upstreamed/wordpress/README.md | 9 +++++ .../wordpress/templates/servicemonitor.yaml | 36 +++++++++++++++++++ upstreamed/wordpress/templates/svc.yaml | 10 ++++++ upstreamed/wordpress/values-production.yaml | 24 +++++++++++++ upstreamed/wordpress/values.yaml | 24 +++++++++++++ 6 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 upstreamed/wordpress/templates/servicemonitor.yaml diff --git a/upstreamed/wordpress/Chart.yaml b/upstreamed/wordpress/Chart.yaml index 5b8cce92e..226007e91 100644 --- a/upstreamed/wordpress/Chart.yaml +++ b/upstreamed/wordpress/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: wordpress -version: 5.12.6 +version: 5.13.0 appVersion: 5.2.2 description: Web publishing platform for building blogs and websites. icon: https://bitnami.com/assets/stacks/wordpress/img/wordpress-stack-220x234.png diff --git a/upstreamed/wordpress/README.md b/upstreamed/wordpress/README.md index bd41ac3a3..3148a2ab6 100644 --- a/upstreamed/wordpress/README.md +++ b/upstreamed/wordpress/README.md @@ -88,9 +88,11 @@ The following table lists the configurable parameters of the WordPress chart and | `service.type` | Kubernetes Service type | `LoadBalancer` | | `service.port` | Service HTTP port | `80` | | `service.httpsPort` | Service HTTPS port | `443` | +| `service.metricsPort` | Service Metrics port | `9117` | | `service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` | | `service.nodePorts.http` | Kubernetes http node port | `""` | | `service.nodePorts.https` | Kubernetes https node port | `""` | +| `service.nodePorts.metrics` | Kubernetes metrics node port | `""` | | `service.extraPorts` | Extra ports to expose in the service (normally used with the `sidecar` value) | `nil` | | `healthcheckHttps` | Use https for liveliness and readiness | `false` | | `livenessProbeHeaders` | Headers to use for livenessProbe | `nil` | @@ -123,6 +125,13 @@ The following table lists the configurable parameters of the WordPress chart and | `metrics.image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) | | `metrics.podAnnotations` | Additional annotations for Metrics exporter pod | `{prometheus.io/scrape: "true", prometheus.io/port: "9117"}` | | `metrics.resources` | Exporter resource requests/limit | `{}` | +| `metrics.serviceMonitor.enabled` | Create ServiceMonitor Resource for scraping metrics using PrometheusOperator | `false` | +| `metrics.serviceMonitor.namespace` | Namespace where servicemonitor resource should be created | `nil` | +| `metrics.serviceMonitor.interval` | Specify the interval at which metrics should be scraped | `30s` | +| `metrics.serviceMonitor.scrapeTimeout`| Specify the timeout after which the scrape is ended | `nil` | +| `metrics.serviceMonitor.relabellings`| Specify Metric Relabellings to add to the scrape endpoint | `nil` | +| `metrics.serviceMonitor.honorLabels` | honorLabels chooses the metric's labels on collisions with target labels. | `false` | +| `metrics.serviceMonitor.additionalLabels`| Used to pass Labels that are required by the Installed Prometheus Operator | `{}` | | `sidecars` | Attach additional containers to the pod | `nil` | | `updateStrategy` | Set up update strategy | `RollingUpdate` | diff --git a/upstreamed/wordpress/templates/servicemonitor.yaml b/upstreamed/wordpress/templates/servicemonitor.yaml new file mode 100644 index 000000000..9b56c21d4 --- /dev/null +++ b/upstreamed/wordpress/templates/servicemonitor.yaml @@ -0,0 +1,36 @@ +{{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ template "wordpress.fullname" . }} + {{- if .Values.metrics.serviceMonitor.namespace }} + namespace: {{ .Values.metrics.serviceMonitor.namespace }} + {{- end }} + labels: + app: "{{ template "wordpress.fullname" . }}" + chart: {{ template "wordpress.chart" . }} + heritage: "{{ .Release.Service }}" + release: "{{ .Release.Name }}" + {{- if .Values.metrics.serviceMonitor.additionalLabels }} +{{ toYaml .Values.metrics.serviceMonitor.additionalLabels | indent 4 }} + {{- end }} +spec: + endpoints: + - port: metrics + interval: {{ .Values.metrics.serviceMonitor.interval }} + {{- if .Values.metrics.serviceMonitor.scrapeTimeout }} + scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }} + {{- end }} + honorLabels: {{ .Values.metrics.serviceMonitor.honorLabels }} + {{- if .Values.metrics.serviceMonitor.relabellings }} + metricRelabelings: +{{ toYaml .Values.metrics.serviceMonitor.relabellings | indent 6 }} + {{- end }} + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} + selector: + matchLabels: + app: "{{ template "wordpress.fullname" . }}" + release: "{{ .Release.Name }}" +{{- end }} diff --git a/upstreamed/wordpress/templates/svc.yaml b/upstreamed/wordpress/templates/svc.yaml index 609a35089..0c3e31c73 100644 --- a/upstreamed/wordpress/templates/svc.yaml +++ b/upstreamed/wordpress/templates/svc.yaml @@ -33,6 +33,16 @@ spec: {{- else if eq .Values.service.type "ClusterIP" }} nodePort: null {{- end }} + {{- if .Values.metrics.enabled }} + - name: metrics + port: {{ .Values.service.metricsPort }} + targetPort: metrics + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.metrics)))}} + nodePort: {{ .Values.service.nodePorts.metrics }} + {{- else if eq .Values.service.type "ClusterIP" }} + nodePort: null + {{- end }} + {{- end }} {{- if .Values.service.extraPorts }} {{ toYaml .Values.service.extraPorts | indent 4 }} {{- end }} diff --git a/upstreamed/wordpress/values-production.yaml b/upstreamed/wordpress/values-production.yaml index 5682dcc33..316632cec 100644 --- a/upstreamed/wordpress/values-production.yaml +++ b/upstreamed/wordpress/values-production.yaml @@ -179,13 +179,17 @@ service: port: 80 # HTTPS Port httpsPort: 443 + # metrics Port + metricsPort: 9117 ## ## nodePorts: ## http: ## https: + ## metrics: nodePorts: http: "" https: "" + metrics: "" ## Enable client source IP preservation ## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip ## @@ -345,6 +349,26 @@ metrics: ## # resources: {} + ## Prometheus Service Monitor + ## ref: https://github.com/coreos/prometheus-operator + ## https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint + serviceMonitor: + ## If the operator is installed in your cluster, set to true to create a Service Monitor Entry + enabled: false + ## Specify the namespace in which the serviceMonitor resource will be created + # namespace: "" + ## Specify the interval at which metrics should be scraped + interval: 30s + ## Specify the timeout after which the scrape is ended + # scrapeTimeout: 30s + ## Specify Metric Relabellings to add to the scrape endpoint + # relabellings: + ## Specify honorLabels parameter to add the scrape endpoint + honorLabels: false + ## Used to pass Labels that are used by the Prometheus installed in your cluster to select Service Monitors to work with + ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#prometheusspec + additionalLabels: {} + sidecars: ## Add sidecars to the pod. ## e.g. diff --git a/upstreamed/wordpress/values.yaml b/upstreamed/wordpress/values.yaml index dd782d658..0c192f86b 100644 --- a/upstreamed/wordpress/values.yaml +++ b/upstreamed/wordpress/values.yaml @@ -179,13 +179,17 @@ service: port: 80 # HTTPS Port httpsPort: 443 + # metrics Port + metricsPort: 9117 ## ## nodePorts: ## http: ## https: + ## metrics: nodePorts: http: "" https: "" + metrics: "" ## Enable client source IP preservation ## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip ## @@ -340,6 +344,26 @@ metrics: ## # resources: {} + ## Prometheus Service Monitor + ## ref: https://github.com/coreos/prometheus-operator + ## https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint + serviceMonitor: + ## If the operator is installed in your cluster, set to true to create a Service Monitor Entry + enabled: false + ## Specify the namespace in which the serviceMonitor resource will be created + # namespace: "" + ## Specify the interval at which metrics should be scraped + interval: 30s + ## Specify the timeout after which the scrape is ended + # scrapeTimeout: 30s + ## Specify Metric Relabellings to add to the scrape endpoint + # relabellings: + ## Specify honorLabels parameter to add the scrape endpoint + honorLabels: false + ## Used to pass Labels that are used by the Prometheus installed in your cluster to select Service Monitors to work with + ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#prometheusspec + additionalLabels: {} + sidecars: ## Add sidecars to the pod. ## e.g.