Unverified Commit f8fea90d authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #62852 from serathius/prometheus-statefulset

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. [Prometheus addon] Use StatefulSet This PR changes prometheus server manifest from deployment to statefulset. Version label is removed from pods because statefulset disallows updating selectors. ```release-note NONE ``` /cc @branch @kawych
parents a4d2a3a4 c0bc700c
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: prometheus
namespace: kube-system
labels:
kubernetes.io/cluster-service: "true"
addonmanager.kubernetes.io/mode: Reconcile
spec:
storageClassName: standard
accessModes:
- ReadWriteOnce
resources:
requests:
storage: "16Gi"
apiVersion: extensions/v1beta1
kind: Deployment
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: prometheus
namespace: kube-system
......@@ -9,16 +9,18 @@ metadata:
addonmanager.kubernetes.io/mode: Reconcile
version: v2.2.1
spec:
serviceName: "prometheus"
replicas: 1
podManagementPolicy: "Parallel"
updateStrategy:
type: "RollingUpdate"
selector:
matchLabels:
k8s-app: prometheus
version: v2.2.1
template:
metadata:
labels:
k8s-app: prometheus
version: v2.2.1
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ''
spec:
......@@ -30,7 +32,7 @@ spec:
imagePullPolicy: "IfNotPresent"
command: ["chown", "-R", "65534:65534", "/data"]
volumeMounts:
- name: storage-volume
- name: prometheus-data
mountPath: /data
subPath: ""
containers:
......@@ -87,7 +89,7 @@ spec:
volumeMounts:
- name: config-volume
mountPath: /etc/config
- name: storage-volume
- name: prometheus-data
mountPath: /data
subPath: ""
terminationGracePeriodSeconds: 300
......@@ -95,6 +97,13 @@ spec:
- name: config-volume
configMap:
name: prometheus-config
- name: storage-volume
persistentVolumeClaim:
claimName: prometheus
volumeClaimTemplates:
- metadata:
name: prometheus-data
spec:
storageClassName: standard
accessModes:
- ReadWriteOnce
resources:
requests:
storage: "16Gi"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment