diff --git a/charts/cluster-addons/values.yaml b/charts/cluster-addons/values.yaml index 1a0eb01..26ddc19 100644 --- a/charts/cluster-addons/values.yaml +++ b/charts/cluster-addons/values.yaml @@ -257,19 +257,19 @@ monitoring: # Indicates if the cluster monitoring should be enabled enabled: false prometheusOperatorCrds: - - https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.53.1/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagerconfigs.yaml - - https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.53.1/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagers.yaml - - https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.53.1/example/prometheus-operator-crd/monitoring.coreos.com_podmonitors.yaml - - https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.53.1/example/prometheus-operator-crd/monitoring.coreos.com_probes.yaml - - https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.53.1/example/prometheus-operator-crd/monitoring.coreos.com_prometheuses.yaml - - https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.53.1/example/prometheus-operator-crd/monitoring.coreos.com_prometheusrules.yaml - - https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.53.1/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml - - https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.53.1/example/prometheus-operator-crd/monitoring.coreos.com_thanosrulers.yaml + - https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.54.0/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagerconfigs.yaml + - https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.54.0/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagers.yaml + - https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.54.0/example/prometheus-operator-crd/monitoring.coreos.com_podmonitors.yaml + - https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.54.0/example/prometheus-operator-crd/monitoring.coreos.com_probes.yaml + - https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.54.0/example/prometheus-operator-crd/monitoring.coreos.com_prometheuses.yaml + - https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.54.0/example/prometheus-operator-crd/monitoring.coreos.com_prometheusrules.yaml + - https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.54.0/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml + - https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.54.0/example/prometheus-operator-crd/monitoring.coreos.com_thanosrulers.yaml kubePrometheusStack: chart: repo: https://prometheus-community.github.io/helm-charts name: kube-prometheus-stack - version: 30.2.0 + version: 32.2.1 release: namespace: monitoring-system values: {} diff --git a/charts/openstack-cluster/templates/control-plane/kubeadm-control-plane.yaml b/charts/openstack-cluster/templates/control-plane/kubeadm-control-plane.yaml index 247c3ad..231eee5 100644 --- a/charts/openstack-cluster/templates/control-plane/kubeadm-control-plane.yaml +++ b/charts/openstack-cluster/templates/control-plane/kubeadm-control-plane.yaml @@ -1,3 +1,37 @@ +{{/* +Produces the spec for the controlplane kubeadmconfig object, with support for KubeProxyConfiguration. +*/}} +{{- define "openstack-cluster.controlplane.kubeadmConfigSpec" -}} +{{- $kubeadmConfigSpec := omit . "kubeProxyConfiguration" "files" "preKubeadmCommands" }} +{{- $kubeProxyConfiguration := dig "kubeProxyConfiguration" dict . }} +{{- $files := dig "files" list . }} +{{- $preKubeadmCommands := dig "preKubeadmCommands" list . }} +{{- with $kubeadmConfigSpec }} +{{- toYaml . }} +{{- end }} +files: + {{- range $files }} + - {{ toYaml . | nindent 4 }} + {{- end }} + {{- with $kubeProxyConfiguration }} + - path: /run/kubeadm/kube-proxy-configuration.yaml + content: | + --- + apiVersion: kubeproxy.config.k8s.io/v1alpha1 + kind: KubeProxyConfiguration + {{- toYaml . | nindent 6 }} + owner: root:root + permissions: "0644" + {{- end }} +preKubeadmCommands: + {{- range $preKubeadmCommands }} + - {{ . }} + {{- end }} + {{- if $kubeProxyConfiguration }} + - cat /run/kubeadm/kube-proxy-configuration.yaml >> /run/kubeadm/kubeadm.yaml + {{- end }} +{{- end }} + --- apiVersion: controlplane.cluster.x-k8s.io/v1beta1 kind: KubeadmControlPlane @@ -18,4 +52,4 @@ spec: {{- with .Values.controlPlane.nodeDrainTimeout }} nodeDrainTimeout: {{ . }} {{- end }} - kubeadmConfigSpec: {{ toYaml .Values.controlPlane.kubeadmConfigSpec | nindent 4 }} + kubeadmConfigSpec: {{ include "openstack-cluster.controlplane.kubeadmConfigSpec" .Values.controlPlane.kubeadmConfigSpec | nindent 4 }} diff --git a/charts/openstack-cluster/values.yaml b/charts/openstack-cluster/values.yaml index 318f6ae..2581859 100644 --- a/charts/openstack-cluster/values.yaml +++ b/charts/openstack-cluster/values.yaml @@ -116,18 +116,31 @@ controlPlane: name: '{{ local_hostname }}' kubeletExtraArgs: cloud-provider: external + # As well as enabling an external cloud provider, we set the bind addresses for the + # etcd metrics, controller-manager, scheduler and kube-proxy to 0.0.0.0 so that Prometheus + # can reach them to collect metrics clusterConfiguration: + etcd: + local: + extraArgs: + listen-metrics-urls: http://0.0.0.0:2381 apiServer: extraArgs: cloud-provider: external controllerManager: extraArgs: cloud-provider: external + bind-address: 0.0.0.0 + scheduler: + extraArgs: + bind-address: 0.0.0.0 joinConfiguration: nodeRegistration: name: '{{ local_hostname }}' kubeletExtraArgs: cloud-provider: external + kubeProxyConfiguration: + metricsBindAddress: 0.0.0.0:10249 # The machine health check for auto-healing of the control plane # See https://cluster-api.sigs.k8s.io/tasks/healthcheck.html healthCheck: @@ -237,3 +250,21 @@ addons: openstack: enabled: true cloudCredentialsSecretName: "{{ include \"openstack-cluster.cloudCredentialsSecretName\" . }}" + monitoring: + kubePrometheusStack: + release: + values: + # Use the metrics port rather than the client as it does not require certificate auth + kubeEtcd: + service: + port: 2381 + targetPort: 2381 + # Use the correct port for kube-scheduler + kubeScheduler: + service: + port: 10259 + targetPort: 10259 + serviceMonitor: + https: true + # The certificate is valid for 127.0.0.1 + insecureSkipVerify: true