Skip to content

Instantly share code, notes, and snippets.

@funkytaco
Last active November 5, 2019 21:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save funkytaco/6d725eccd9e6f8eb753c405475ee8452 to your computer and use it in GitHub Desktop.
Save funkytaco/6d725eccd9e6f8eb753c405475ee8452 to your computer and use it in GitHub Desktop.
prometheusoperator.0.27.0 YAML

So I found this by googling for prometheusoperator.0.27.0

Found it in Google's cache: https://webcache.googleusercontent.com/search?q=cache:u0dOwNTOWH0J:https://github.com/operator-framework/community-operators/blob/master/upstream-community-operators/prometheus/prometheusoperator.0.27.0.clusterserviceversion.yaml+&cd=1&hl=en&ct=clnk&gl=us

It looks like there was a 0.32.0 version added to OperatorHub 8 days ago, but maybe it's not published yet. https://github.com/operator-framework/community-operators/tree/master/upstream-community-operators/prometheus

So just create a new project my-prometheus, update metadata.namespace from 'placeholder' to 'my-prometheus'

Then in Openshift UI -> Catalog -> Installed Operators -> (top right) Add+ button, paste the YAML below.

Continue with the lab.

#! validate-crd: deploy/chart/templates/0000_30_02-clusterserviceversion.crd.yaml
#! parse-kind: ClusterServiceVersion
apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
metadata:
name: prometheusoperator.0.27.0
namespace: placeholder
annotations:
capabilities: Seamless Upgrades
categories: Monitoring
description: Manage the full lifecycle of configuring and managing Prometheus and Alertmanager servers.
containerImage: quay.io/coreos/prometheus-operator:v0.27.0
createdAt: 2019-01-08T16:12:00Z
repository: https://github.com/coreos/prometheus-operator
alm-examples: '[{"apiVersion":"monitoring.coreos.com/v1","kind":"Prometheus","metadata":{"name":"example","labels":{"prometheus":"k8s"}},"spec":{"replicas":2,"version":"v2.7.1","serviceAccountName":"prometheus-k8s","securityContext": {}, "serviceMonitorSelector":{},"ruleSelector":{},"alerting":{"alertmanagers":[{"namespace":"monitoring","name":"alertmanager-main","port":"web"}]}}},{"apiVersion":"monitoring.coreos.com/v1","kind":"ServiceMonitor","metadata":{"name":"example","labels":{"k8s-app":"prometheus"}},"spec":{"selector":{"matchLabels":{"k8s-app":"prometheus"}},"endpoints":[{"port":"web","interval":"30s"}]}},{"apiVersion":"monitoring.coreos.com/v1","kind":"Alertmanager","metadata":{"name":"alertmanager-main"},"spec":{"replicas":3, "securityContext": {}}},{"apiVersion":"monitoring.coreos.com/v1","kind":"PrometheusRule","metadata":{"creationTimestamp":null,"labels":{"prometheus":"example","role":"alert-rules"},"name":"prometheus-example-rules"},"spec":{"groups":[{"name":"./example.rules","rules":[{"alert":"ExampleAlert","expr":"vector(1)"}]}]}}]'
certified: "false"
support: Frederic Branczyk
spec:
replaces: prometheusoperator.0.22.2
displayName: Prometheus Operator
description: |
The Prometheus Operator for Kubernetes provides easy monitoring definitions for Kubernetes services and deployment and management of Prometheus instances.
Once installed, the Prometheus Operator provides the following features:
* **Create/Destroy**: Easily launch a Prometheus instance for your Kubernetes namespace, a specific application or team easily using the Operator.
* **Simple Configuration**: Configure the fundamentals of Prometheus like versions, persistence, retention policies, and replicas from a native Kubernetes resource.
* **Target Services via Labels**: Automatically generate monitoring target configurations based on familiar Kubernetes label queries; no need to learn a Prometheus specific configuration language.
### Other Supported Features
**High availability**
Multiple instances are run across failure zones and data is replicated. This keeps your monitoring available during an outage, when you need it most.
**Updates via automated operations**
New Prometheus versions are deployed using a rolling update with no downtime, making it easy to stay up to date.
**Handles the dynamic nature of containers**
Alerting rules are attached to groups of containers instead of individual instances, which is ideal for the highly dynamic nature of container deployment.
keywords: ['prometheus', 'monitoring', 'tsdb', 'alerting', 'observability']
maintainers:
- name: Red Hat
email: openshift-operators@redhat.com
provider:
name: Red Hat
links:
- name: Prometheus
url: https://www.prometheus.io/
- name: Documentation
url: https://github.com/coreos/prometheus-operator/tree/master/Documentation
- name: Prometheus Operator
url: https://github.com/coreos/prometheus-operator
labels:
alm-status-descriptors: prometheusoperator.0.27.0
alm-owner-prometheus: prometheusoperator
selector:
matchLabels:
alm-owner-prometheus: prometheusoperator
icon:
- base64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IDIuNTMyIDI0LjQyMyA0Ljc3MiAzNC4xMzguNzQ0LTIwLjE3OCA0LjIxMy00OS42MiAxNy4wMTQtNTkuNzg0LTUuNjQ3IDEyLjguODM2IDI4LjgxOCA1LjI3IDM2LjUxOCA3LjE1NCAxMi40MjQgMTEuNDkgMjEuODM2IDExLjQ5IDM5LjYzOCAwIDExLjkzNi00LjQwNyAyMy4xNzMtMTEuODQgMzEuOTU4IDguNDUyLTEuNTg2IDE0LjI4OS0zLjAxNiAxNC4yODktMy4wMTZsMjcuNDUtNS4zNTVjLjAwMi0uMDAyLTMuOTg3IDE2LjQwMS0xOS4zMTQgMzIuMTk3eiIgZmlsbD0iI0RBNEUzMSIvPjwvc3ZnPg==
mediatype: image/svg+xml
installModes:
- type: OwnNamespace
supported: true
- type: SingleNamespace
supported: true
- type: MultiNamespace
supported: true
- type: AllNamespaces
supported: false
install:
strategy: deployment
spec:
permissions:
- serviceAccountName: prometheus-k8s
rules:
- apiGroups: [""]
resources:
- nodes
- services
- endpoints
- pods
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources:
- configmaps
verbs: ["get"]
- serviceAccountName: prometheus-operator-0-27-0
rules:
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs:
- '*'
- apiGroups:
- monitoring.coreos.com
resources:
- alertmanagers
- prometheuses
- prometheuses/finalizers
- alertmanagers/finalizers
- servicemonitors
- prometheusrules
verbs:
- '*'
- apiGroups:
- apps
resources:
- statefulsets
verbs:
- '*'
- apiGroups:
- ""
resources:
- configmaps
- secrets
verbs:
- '*'
- apiGroups:
- ""
resources:
- pods
verbs:
- list
- delete
- apiGroups:
- ""
resources:
- services
- endpoints
verbs:
- get
- create
- update
- apiGroups:
- ""
resources:
- nodes
verbs:
- list
- watch
- apiGroups:
- ""
resources:
- namespaces
verbs:
- get
- list
- watch
deployments:
- name: prometheus-operator
spec:
replicas: 1
selector:
matchLabels:
k8s-app: prometheus-operator
template:
metadata:
labels:
k8s-app: prometheus-operator
spec:
serviceAccount: prometheus-operator-0-27-0
containers:
- name: prometheus-operator
image: quay.io/coreos/prometheus-operator@sha256:933cd5bf380cf7db330808ff54f75f26fda0b1501021d499a1766b7d16224188
args:
- -namespaces=$(NAMESPACES)
- -manage-crds=false
- -logtostderr=true
- --config-reloader-image=quay.io/coreos/configmap-reload@sha256:e2fd60ff0ae4500a75b80ebaa30e0e7deba9ad107833e8ca53f0047c42c5a057
- --prometheus-config-reloader=quay.io/coreos/prometheus-config-reloader@sha256:61b7969fd1336fd4bbac0622f9e4281f2a2b4ae02ad55748b6fdc65e2be69b73
env:
- name: NAMESPACES
valueFrom:
fieldRef:
fieldPath: metadata.annotations['olm.targetNamespaces']
ports:
- containerPort: 8080
name: http
resources:
limits:
cpu: 200m
memory: 100Mi
requests:
cpu: 100m
memory: 50Mi
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
nodeSelector:
beta.kubernetes.io/os: linux
maturity: beta
version: 0.27.0
customresourcedefinitions:
owned:
- name: prometheuses.monitoring.coreos.com
version: v1
kind: Prometheus
displayName: Prometheus
description: A running Prometheus instance
resources:
- kind: StatefulSet
version: v1beta2
- kind: Pod
version: v1
- kind: ConfigMap
version: v1
- kind: Service
version: v1
specDescriptors:
- description: Desired number of Pods for the cluster
displayName: Size
path: replicas
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:podCount'
- description: A selector for the ConfigMaps from which to load rule files
displayName: Rule Config Map Selector
path: ruleSelector
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:selector:core:v1:ConfigMap'
- description: ServiceMonitors to be selected for target discovery
displayName: Service Monitor Selector
path: serviceMonitorSelector
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:selector:monitoring.coreos.com:v1:ServiceMonitor'
- description: The ServiceAccount to use to run the Prometheus pods
displayName: Service Account
path: serviceAccountName
x-descriptors:
- 'urn:alm:descriptor:io.kubernetes:ServiceAccount'
- description: Limits describes the minimum/maximum amount of compute resources required/allowed
displayName: Resource Requirements
path: resources
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:resourceRequirements'
- name: prometheusrules.monitoring.coreos.com
version: v1
kind: PrometheusRule
displayName: Prometheus Rule
description: A Prometheus Rule configures groups of sequentially evaluated recording and alerting rules.
- name: servicemonitors.monitoring.coreos.com
version: v1
kind: ServiceMonitor
displayName: Service Monitor
description: Configures prometheus to monitor a particular k8s service
resources:
- kind: Pod
version: v1
specDescriptors:
- description: The label to use to retrieve the job name from
displayName: Job Label
path: jobLabel
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:label'
- description: A list of endpoints allowed as part of this ServiceMonitor
displayName: Endpoints
path: endpoints
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:endpointList'
- name: alertmanagers.monitoring.coreos.com
version: v1
kind: Alertmanager
displayName: Alertmanager
description: Configures an Alertmanager for the namespace
resources:
- kind: StatefulSet
version: v1beta2
- kind: Pod
version: v1
- kind: Service
version: v1
specDescriptors:
- description: Desired number of Pods for the cluster
displayName: Size
path: replicas
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:podCount'
- description: Limits describes the minimum/maximum amount of compute resources required/allowed
displayName: Resource Requirements
path: resources
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:resourceRequirements'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment