diff --git a/charts/eks/templates/service-monitor.yaml b/charts/eks/templates/service-monitor.yaml new file mode 100644 index 000000000..683506ab5 --- /dev/null +++ b/charts/eks/templates/service-monitor.yaml @@ -0,0 +1,31 @@ +{{- if .Values.monitoring.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ .Release.Name }} + namespace: {{ .Release.Namespace }} +spec: + selector: + matchLabels: + app: vcluster + release: "{{ .Release.Name }}" + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + heritage: "{{ .Release.Service }}" + endpoints: + - interval: 30s + port: https + path: /metrics + scheme: https + tlsConfig: + ca: + secret: + name: vc-{{ .Release.Name }} + key: certificate-authority + cert: + secret: + name: vc-{{ .Release.Name }} + key: client-certificate + keySecret: + name: vc-{{ .Release.Name }} + key: client-key +{{- end }} diff --git a/charts/eks/values.yaml b/charts/eks/values.yaml index cd8912c2f..5e9099aaf 100644 --- a/charts/eks/values.yaml +++ b/charts/eks/values.yaml @@ -12,6 +12,10 @@ pro: false # or statefulset is created. headless: false +monitoring: + serviceMonitor: + enabled: false + # If the control plane is deployed in high availability mode # Make sure to scale up the syncer.replicas, etcd.replicas, api.replicas & controller.replicas enableHA: false diff --git a/charts/k0s/templates/service-monitor.yaml b/charts/k0s/templates/service-monitor.yaml new file mode 100644 index 000000000..683506ab5 --- /dev/null +++ b/charts/k0s/templates/service-monitor.yaml @@ -0,0 +1,31 @@ +{{- if .Values.monitoring.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ .Release.Name }} + namespace: {{ .Release.Namespace }} +spec: + selector: + matchLabels: + app: vcluster + release: "{{ .Release.Name }}" + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + heritage: "{{ .Release.Service }}" + endpoints: + - interval: 30s + port: https + path: /metrics + scheme: https + tlsConfig: + ca: + secret: + name: vc-{{ .Release.Name }} + key: certificate-authority + cert: + secret: + name: vc-{{ .Release.Name }} + key: client-certificate + keySecret: + name: vc-{{ .Release.Name }} + key: client-key +{{- end }} diff --git a/charts/k0s/values.yaml b/charts/k0s/values.yaml index ea39d7312..8eae8382c 100644 --- a/charts/k0s/values.yaml +++ b/charts/k0s/values.yaml @@ -12,6 +12,10 @@ pro: false # or statefulset is created. headless: false +monitoring: + serviceMonitor: + enabled: false + # Plugins that should get loaded. Usually you want to apply those via 'vcluster create ... -f https://.../plugin.yaml' plugin: {} # Manually configure a plugin called test diff --git a/charts/k3s/templates/service-monitor.yaml b/charts/k3s/templates/service-monitor.yaml new file mode 100644 index 000000000..683506ab5 --- /dev/null +++ b/charts/k3s/templates/service-monitor.yaml @@ -0,0 +1,31 @@ +{{- if .Values.monitoring.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ .Release.Name }} + namespace: {{ .Release.Namespace }} +spec: + selector: + matchLabels: + app: vcluster + release: "{{ .Release.Name }}" + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + heritage: "{{ .Release.Service }}" + endpoints: + - interval: 30s + port: https + path: /metrics + scheme: https + tlsConfig: + ca: + secret: + name: vc-{{ .Release.Name }} + key: certificate-authority + cert: + secret: + name: vc-{{ .Release.Name }} + key: client-certificate + keySecret: + name: vc-{{ .Release.Name }} + key: client-key +{{- end }} diff --git a/charts/k3s/values.yaml b/charts/k3s/values.yaml index 99556e2b7..e914f8161 100644 --- a/charts/k3s/values.yaml +++ b/charts/k3s/values.yaml @@ -8,6 +8,10 @@ pro: false # or statefulset is created. headless: false +monitoring: + serviceMonitor: + enabled: false + # DefaultImageRegistry will be prepended to all deployed vcluster images, such as the vcluster pod, coredns etc.. Deployed # images within the vcluster will not be rewritten. defaultImageRegistry: "" diff --git a/charts/k8s/templates/service-monitor.yaml b/charts/k8s/templates/service-monitor.yaml new file mode 100644 index 000000000..683506ab5 --- /dev/null +++ b/charts/k8s/templates/service-monitor.yaml @@ -0,0 +1,31 @@ +{{- if .Values.monitoring.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ .Release.Name }} + namespace: {{ .Release.Namespace }} +spec: + selector: + matchLabels: + app: vcluster + release: "{{ .Release.Name }}" + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + heritage: "{{ .Release.Service }}" + endpoints: + - interval: 30s + port: https + path: /metrics + scheme: https + tlsConfig: + ca: + secret: + name: vc-{{ .Release.Name }} + key: certificate-authority + cert: + secret: + name: vc-{{ .Release.Name }} + key: client-certificate + keySecret: + name: vc-{{ .Release.Name }} + key: client-key +{{- end }} diff --git a/charts/k8s/values.yaml b/charts/k8s/values.yaml index 84629a817..7f5f25eca 100644 --- a/charts/k8s/values.yaml +++ b/charts/k8s/values.yaml @@ -12,6 +12,10 @@ pro: false # or statefulset is created. headless: false +monitoring: + serviceMonitor: + enabled: false + # If the control plane is deployed in high availability mode # Make sure to scale up the syncer.replicas, etcd.replicas, api.replicas & controller.replicas enableHA: false