github.com/spotahome/redis-operator@v1.2.4/example/operator/all-redis-operator-resources.yaml (about) 1 apiVersion: apps/v1 2 kind: Deployment 3 metadata: 4 labels: 5 app: redisoperator 6 name: redisoperator 7 spec: 8 replicas: 1 9 selector: 10 matchLabels: 11 app: redisoperator 12 strategy: 13 type: RollingUpdate 14 template: 15 metadata: 16 labels: 17 app: redisoperator 18 spec: 19 serviceAccountName: redisoperator 20 containers: 21 - image: quay.io/spotahome/redis-operator:latest 22 imagePullPolicy: IfNotPresent 23 name: app 24 securityContext: 25 readOnlyRootFilesystem: true 26 runAsNonRoot: true 27 runAsUser: 1000 28 resources: 29 limits: 30 cpu: 100m 31 memory: 50Mi 32 requests: 33 cpu: 10m 34 memory: 50Mi 35 restartPolicy: Always 36 --- 37 apiVersion: rbac.authorization.k8s.io/v1 38 kind: ClusterRoleBinding 39 metadata: 40 name: redisoperator 41 roleRef: 42 apiGroup: rbac.authorization.k8s.io 43 kind: ClusterRole 44 name: redisoperator 45 subjects: 46 - kind: ServiceAccount 47 name: redisoperator 48 namespace: default 49 --- 50 apiVersion: rbac.authorization.k8s.io/v1 51 kind: ClusterRole 52 metadata: 53 name: redisoperator 54 rules: 55 - apiGroups: 56 - databases.spotahome.com 57 resources: 58 - redisfailovers 59 - redisfailovers/finalizers 60 verbs: 61 - "*" 62 - apiGroups: 63 - apiextensions.k8s.io 64 resources: 65 - customresourcedefinitions 66 verbs: 67 - "*" 68 - apiGroups: 69 - "" 70 resources: 71 - pods 72 - services 73 - endpoints 74 - events 75 - configmaps 76 - persistentvolumeclaims 77 - persistentvolumeclaims/finalizers 78 verbs: 79 - "*" 80 - apiGroups: 81 - "" 82 resources: 83 - secrets 84 verbs: 85 - "get" 86 - apiGroups: 87 - apps 88 resources: 89 - deployments 90 - statefulsets 91 verbs: 92 - "*" 93 - apiGroups: 94 - policy 95 resources: 96 - poddisruptionbudgets 97 verbs: 98 - "*" 99 - apiGroups: 100 - coordination.k8s.io 101 resources: 102 - leases 103 verbs: 104 - "*" 105 106 --- 107 apiVersion: v1 108 kind: ServiceAccount 109 metadata: 110 name: redisoperator 111 --- 112 113 apiVersion: v1 114 kind: Service 115 metadata: 116 annotations: 117 prometheus.io/path: /metrics 118 prometheus.io/port: http 119 prometheus.io/scrape: "true" 120 name: redisoperator 121 labels: 122 app: redisoperator 123 spec: 124 type: ClusterIP 125 ports: 126 - name: metrics 127 port: 9710 128 protocol: TCP 129 targetPort: metrics 130 selector: 131 app: redisoperator 132 --- 133 134 apiVersion: monitoring.coreos.com/v1 135 kind: ServiceMonitor 136 metadata: 137 name: redis-operator-metrics 138 labels: 139 app: redisoperator 140 release: prometheus 141 spec: 142 selector: 143 matchLabels: 144 app: redisoperator 145 endpoints: 146 - port: metrics 147 namespaceSelector: 148 matchNames: 149 - default 150 --- 151 152 153 apiVersion: monitoring.coreos.com/v1 154 kind: PodMonitor 155 metadata: 156 name: redisoperator 157 labels: 158 app: redisoperator 159 release: prometheus 160 spec: 161 selector: 162 matchLabels: 163 app: redisoperator 164 podMetricsEndpoints: 165 - port: metrics