mirror of
https://github.com/kubereboot/kured.git
synced 2026-08-23 21:36:33 +00:00
restructured and improved service
Signed-off-by: Christian Kotzbauer <christian.kotzbauer@gmail.com>
This commit is contained in:
+13
-10
@@ -61,12 +61,14 @@ The following changes have been made compared to the stable chart:
|
||||
| `serviceAccount.name` | Service account name to create (or use if `serviceAccount.create` is false) | (chart fullname) |
|
||||
| `podSecurityPolicy.create` | Create podSecurityPolicy | `false` |
|
||||
| `resources` | Resources requests and limits. | `{}` |
|
||||
| `metrics.create` | Create a Service for the metrics endpoint | `false` |
|
||||
| `metrics.serviceMonitor.create` | Create a ServiceMonitor for prometheus-operator | `true` |
|
||||
| `metrics.serviceMonitor.namespace` | The namespace to create the ServiceMonitor in | `""` |
|
||||
| `metrics.serviceMonitor.labels` | Additional labels for the ServiceMonitor | `{}` |
|
||||
| `metrics.serviceMonitor.interval` | Interval prometheus should scrape the endpoint | `60s` |
|
||||
| `metrics.serviceMonitor.scrapeTimeout` | A custom scrapeTimeout for prometheus | `""` |
|
||||
| `metrics.create` | Create a ServiceMonitor for prometheus-operator | `false` |
|
||||
| `metrics.namespace` | The namespace to create the ServiceMonitor in | `""` |
|
||||
| `metrics.labels` | Additional labels for the ServiceMonitor | `{}` |
|
||||
| `metrics.interval` | Interval prometheus should scrape the endpoint | `60s` |
|
||||
| `metrics.scrapeTimeout` | A custom scrapeTimeout for prometheus | `""` |
|
||||
| `service.create` | Create a Service for the metrics endpoint | `false` |
|
||||
| `service.port` | Port of the service to expose | `8080` |
|
||||
| `serviceAnnotations` | Annotations to apply to the service (eg to add Prometheus annotations) | `{}` |
|
||||
| `priorityClassName` | Priority Class to be used by the pods | `""` |
|
||||
| `tolerations` | Tolerations to apply to the daemonset (eg to allow running on master) | `[{"key": "node-role.kubernetes.io/master", "effect": "NoSchedule"}]`|
|
||||
| `affinity` | Affinity for the daemonset (ie, restrict which nodes kured runs on) | `{}` |
|
||||
@@ -95,8 +97,9 @@ metrics:
|
||||
#### Prometheus Annotations
|
||||
|
||||
```yaml
|
||||
podAnnotations:
|
||||
prometheus.io/scrape: "true"
|
||||
prometheus.io/path: "/metrics"
|
||||
prometheus.io/port: "8080"
|
||||
service:
|
||||
annotations:
|
||||
prometheus.io/scrape: "true"
|
||||
prometheus.io/path: "/metrics"
|
||||
prometheus.io/port: "8080"
|
||||
```
|
||||
|
||||
@@ -1,15 +1,22 @@
|
||||
{{- if .Values.metrics.create }}
|
||||
{{- if or .Values.service.create .Values.metrics.create }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ template "kured.fullname" . }}
|
||||
labels:
|
||||
{{- include "kured.labels" . | nindent 4 }}
|
||||
{{- if .Values.service.annotations }}
|
||||
annotations:
|
||||
{{- range $key, $value := .Values.service.annotations }}
|
||||
{{ $key }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- name: metrics
|
||||
port: 8080
|
||||
port: {{ .Values.service.port }}
|
||||
targetPort: 8080
|
||||
selector:
|
||||
{{- include "kured.labels" . | nindent 4 }}
|
||||
{{- end }}
|
||||
@@ -1,21 +1,21 @@
|
||||
{{- if and .Values.metrics.create .Values.metrics.serviceMonitor.create }}
|
||||
{{- if .Values.metrics.create }}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
name: {{ template "kured.fullname" . }}
|
||||
{{- if .Values.metrics.serviceMonitor.namespace }}
|
||||
namespace: {{ .Values.metrics.serviceMonitor.namespace }}
|
||||
{{- if .Values.metrics.namespace }}
|
||||
namespace: {{ .Values.metrics.namespace }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "kured.labels" . | nindent 4 }}
|
||||
{{- if .Values.metrics.serviceMonitor.labels }}
|
||||
{{- toYaml .Values.metrics.serviceMonitor.labels | nindent 4 }}
|
||||
{{- if .Values.metrics.labels }}
|
||||
{{- toYaml .Values.metrics.labels | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
endpoints:
|
||||
- interval: {{ .Values.metrics.serviceMonitor.interval }}
|
||||
{{- if .Values.metrics.serviceMonitor.scrapeTimeout }}
|
||||
scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }}
|
||||
- interval: {{ .Values.metrics.interval }}
|
||||
{{- if .Values.metrics.scrapeTimeout }}
|
||||
scrapeTimeout: {{ .Values.metrics.scrapeTimeout }}
|
||||
{{- end }}
|
||||
honorLabels: true
|
||||
targetPort: 8080
|
||||
|
||||
@@ -40,12 +40,15 @@ resources: {}
|
||||
|
||||
metrics:
|
||||
create: false
|
||||
serviceMonitor:
|
||||
create: true
|
||||
namespace: ""
|
||||
labels: {}
|
||||
interval: 60s
|
||||
scrapeTimeout: ""
|
||||
namespace: ""
|
||||
labels: {}
|
||||
interval: 60s
|
||||
scrapeTimeout: ""
|
||||
|
||||
service:
|
||||
create: false
|
||||
port: 8080
|
||||
annotations: {}
|
||||
|
||||
priorityClassName: ""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user