Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1866930: Clean up stranded bundles #413

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Bug Clean up stranded bundles
Currently, it is possible in opm to strand one or more bundles if a new
bundle is added to a channel without replaces set. When this happens,
`registry/index rm` can have unexpected behavior, because of the loss of
the channel entry table rows linking the bundle to a package.

To resolve this problem for, this commit introduces a new command
`prune-stranded` which explicity removes all stranded bundles from
the database. In addition, it updates `rm` to remove all stranded
bundles whenever a package is being removed.

Additionally, this commit fixes a bug whereby the bundlepath field was
not being set on the properties table specifically for olm.gvk
properties. A migration has also been provided to pull that data over
when it was provided (which is the case for every bundle image added
via opm)
  • Loading branch information
kevinrizza committed Aug 7, 2020
commit e144a5769a022a36f03130f8d2c1a7196a56a794
1 change: 1 addition & 0 deletions cmd/opm/index/cmd.go
Original file line number Diff line number Diff line change
@@ -26,4 +26,5 @@ func AddCommand(parent *cobra.Command) {
cmd.AddCommand(newIndexExportCmd())
cmd.AddCommand(newIndexPruneCmd())
cmd.AddCommand(newIndexDeprecateTruncateCmd())
cmd.AddCommand(newIndexPruneStrandedCmd())
}
103 changes: 103 additions & 0 deletions cmd/opm/index/prunestranded.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
package index

import (
"fmt"

"github.com/sirupsen/logrus"
"github.com/spf13/cobra"

"github.com/operator-framework/operator-registry/pkg/containertools"
"github.com/operator-framework/operator-registry/pkg/lib/indexer"
)

func newIndexPruneStrandedCmd() *cobra.Command {
indexCmd := &cobra.Command{
Use: "prune-stranded",
Short: "prune an index of stranded bundles",
Long: `prune an index of stranded bundles - bundles that are not associated with a particular package`,

PreRunE: func(cmd *cobra.Command, args []string) error {
if debug, _ := cmd.Flags().GetBool("debug"); debug {
logrus.SetLevel(logrus.DebugLevel)
}
return nil
},

RunE: runIndexPruneStrandedCmdFunc,
}

indexCmd.Flags().Bool("debug", false, "enable debug logging")
indexCmd.Flags().Bool("generate", false, "if enabled, just creates the dockerfile and saves it to local disk")
indexCmd.Flags().StringP("out-dockerfile", "d", "", "if generating the dockerfile, this flag is used to (optionally) specify a dockerfile name")
indexCmd.Flags().StringP("from-index", "f", "", "index to prune")
if err := indexCmd.MarkFlagRequired("from-index"); err != nil {
logrus.Panic("Failed to set required `from-index` flag for `index prune-stranded`")
}
indexCmd.Flags().StringP("binary-image", "i", "", "container image for on-image `opm` command")
indexCmd.Flags().StringP("container-tool", "c", "podman", "tool to interact with container images (save, build, etc.). One of: [docker, podman]")
indexCmd.Flags().StringP("tag", "t", "", "custom tag for container image being built")

if err := indexCmd.Flags().MarkHidden("debug"); err != nil {
logrus.Panic(err.Error())
}

return indexCmd

}

func runIndexPruneStrandedCmdFunc(cmd *cobra.Command, args []string) error {
generate, err := cmd.Flags().GetBool("generate")
if err != nil {
return err
}

outDockerfile, err := cmd.Flags().GetString("out-dockerfile")
if err != nil {
return err
}

fromIndex, err := cmd.Flags().GetString("from-index")
if err != nil {
return err
}

binaryImage, err := cmd.Flags().GetString("binary-image")
if err != nil {
return err
}

containerTool, err := cmd.Flags().GetString("container-tool")
if err != nil {
return err
}

if containerTool == "none" {
return fmt.Errorf("none is not a valid container-tool for index prune")
}

tag, err := cmd.Flags().GetString("tag")
if err != nil {
return err
}

logger := logrus.WithFields(logrus.Fields{})

logger.Info("pruning stranded bundles from the index")

indexPruner := indexer.NewIndexStrandedPruner(containertools.NewContainerTool(containerTool, containertools.PodmanTool), logger)

request := indexer.PruneStrandedFromIndexRequest{
Generate: generate,
FromIndex: fromIndex,
BinarySourceImage: binaryImage,
OutDockerfile: outDockerfile,
Tag: tag,
}

err = indexPruner.PruneStrandedFromIndex(request)
if err != nil {
return err
}

return nil
}
1 change: 1 addition & 0 deletions cmd/opm/registry/cmd.go
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@ func NewOpmRegistryCmd() *cobra.Command {
rootCmd.AddCommand(newRegistryAddCmd())
rootCmd.AddCommand(newRegistryRmCmd())
rootCmd.AddCommand(newRegistryPruneCmd())
rootCmd.AddCommand(newRegistryPruneStrandedCmd())

return rootCmd
}
54 changes: 54 additions & 0 deletions cmd/opm/registry/prunestranded.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package registry

import (
"github.com/operator-framework/operator-registry/pkg/lib/registry"

"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)

func newRegistryPruneStrandedCmd() *cobra.Command {
rootCmd := &cobra.Command{
Use: "prune-stranded",
Short: "prune an operator registry DB of stranded bundles",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I believe docker uses the word dangling for this, which might help users understand the issue. But doesn't need to change.

Long: `prune an operator registry DB of stranded bundles - bundles that are not associated with a particular package`,

PreRunE: func(cmd *cobra.Command, args []string) error {
if debug, _ := cmd.Flags().GetBool("debug"); debug {
logrus.SetLevel(logrus.DebugLevel)
}
return nil
},

RunE: runRegistryPruneStrandedCmdFunc,
}

rootCmd.Flags().Bool("debug", false, "enable debug logging")
rootCmd.Flags().StringP("database", "d", "bundles.db", "relative path to database file")

return rootCmd
}

func runRegistryPruneStrandedCmdFunc(cmd *cobra.Command, args []string) error {
fromFilename, err := cmd.Flags().GetString("database")
if err != nil {
return err
}

request := registry.PruneStrandedFromRegistryRequest{
InputDatabase: fromFilename,
}

logger := logrus.WithFields(logrus.Fields{})

logger.Info("pruning from the registry")

registryStrandedPruner := registry.NewRegistryStrandedPruner(logger)

err = registryStrandedPruner.PruneStrandedFromRegistry(request)
if err != nil {
return err
}

return nil
}
74 changes: 64 additions & 10 deletions pkg/lib/indexer/indexer.go
Original file line number Diff line number Diff line change
@@ -35,16 +35,17 @@ const (

// ImageIndexer is a struct implementation of the Indexer interface
type ImageIndexer struct {
DockerfileGenerator containertools.DockerfileGenerator
CommandRunner containertools.CommandRunner
LabelReader containertools.LabelReader
RegistryAdder registry.RegistryAdder
RegistryDeleter registry.RegistryDeleter
RegistryPruner registry.RegistryPruner
RegistryDeprecator registry.RegistryDeprecator
BuildTool containertools.ContainerTool
PullTool containertools.ContainerTool
Logger *logrus.Entry
DockerfileGenerator containertools.DockerfileGenerator
CommandRunner containertools.CommandRunner
LabelReader containertools.LabelReader
RegistryAdder registry.RegistryAdder
RegistryDeleter registry.RegistryDeleter
RegistryPruner registry.RegistryPruner
RegistryStrandedPruner registry.RegistryStrandedPruner
RegistryDeprecator registry.RegistryDeprecator
BuildTool containertools.ContainerTool
PullTool containertools.ContainerTool
Logger *logrus.Entry
}

// AddToIndexRequest defines the parameters to send to the AddToIndex API
@@ -168,6 +169,59 @@ func (i ImageIndexer) DeleteFromIndex(request DeleteFromIndexRequest) error {
return nil
}

// PruneStrandedFromIndexRequest defines the parameters to send to the PruneStrandedFromIndex API
type PruneStrandedFromIndexRequest struct {
Generate bool
BinarySourceImage string
FromIndex string
OutDockerfile string
Tag string
}

// PruneStrandedFromIndex is an aggregate API used to generate a registry index image
// that has removed stranded bundles from the index
func (i ImageIndexer) PruneStrandedFromIndex(request PruneStrandedFromIndexRequest) error {
buildDir, outDockerfile, cleanup, err := buildContext(request.Generate, request.OutDockerfile)
defer cleanup()
if err != nil {
return err
}

databasePath, err := i.extractDatabase(buildDir, request.FromIndex)
if err != nil {
return err
}

// Run opm registry prune-stranded on the database
pruneStrandedFromRegistryReq := registry.PruneStrandedFromRegistryRequest{
InputDatabase: databasePath,
}

// Delete the stranded bundles from the registry
err = i.RegistryStrandedPruner.PruneStrandedFromRegistry(pruneStrandedFromRegistryReq)
if err != nil {
return err
}

// generate the dockerfile
dockerfile := i.DockerfileGenerator.GenerateIndexDockerfile(request.BinarySourceImage, databasePath)
err = write(dockerfile, outDockerfile, i.Logger)
if err != nil {
return err
}

if request.Generate {
return nil
}

// build the dockerfile
err = build(outDockerfile, request.Tag, i.CommandRunner, i.Logger)
if err != nil {
return err
}
return nil
}

// PruneFromIndexRequest defines the parameters to send to the PruneFromIndex API
type PruneFromIndexRequest struct {
Generate bool
17 changes: 17 additions & 0 deletions pkg/lib/indexer/interfaces.go
Original file line number Diff line number Diff line change
@@ -64,6 +64,23 @@ func NewIndexExporter(containerTool containertools.ContainerTool, logger *logrus
}
}

// IndexStrandedPruner prunes operators out of an index
type IndexStrandedPruner interface {
PruneStrandedFromIndex(PruneStrandedFromIndexRequest) error
}

func NewIndexStrandedPruner(containerTool containertools.ContainerTool, logger *logrus.Entry) IndexStrandedPruner {
return ImageIndexer{
DockerfileGenerator: containertools.NewDockerfileGenerator(logger),
CommandRunner: containertools.NewCommandRunner(containerTool, logger),
LabelReader: containertools.NewLabelReader(containerTool, logger),
RegistryStrandedPruner: registry.NewRegistryStrandedPruner(logger),
BuildTool: containerTool,
PullTool: containerTool,
Logger: logger,
}
}

// IndexPruner prunes operators out of an index
type IndexPruner interface {
PruneFromIndex(PruneFromIndexRequest) error
10 changes: 10 additions & 0 deletions pkg/lib/registry/interfaces.go
Original file line number Diff line number Diff line change
@@ -27,6 +27,16 @@ func NewRegistryDeleter(logger *logrus.Entry) RegistryDeleter {
}
}

type RegistryStrandedPruner interface {
PruneStrandedFromRegistry(PruneStrandedFromRegistryRequest) error
}

func NewRegistryStrandedPruner(logger *logrus.Entry) RegistryStrandedPruner {
return RegistryUpdater{
Logger: logger,
}
}

type RegistryPruner interface {
PruneFromRegistry(PruneFromRegistryRequest) error
}
34 changes: 34 additions & 0 deletions pkg/lib/registry/registry.go
Original file line number Diff line number Diff line change
@@ -174,6 +174,40 @@ func (r RegistryUpdater) DeleteFromRegistry(request DeleteFromRegistryRequest) e
}
}

// remove any stranded bundles from the database
// TODO: This is unnecessary if the db schema can prevent this orphaned data from existing
remover := sqlite.NewSQLStrandedBundleRemover(dbLoader)
if err := remover.Remove(); err != nil {
return fmt.Errorf("error removing stranded packages from database: %s", err)
}

return nil
}

type PruneStrandedFromRegistryRequest struct {
InputDatabase string
}

func (r RegistryUpdater) PruneStrandedFromRegistry(request PruneStrandedFromRegistryRequest) error {
db, err := sql.Open("sqlite3", request.InputDatabase)
if err != nil {
return err
}
defer db.Close()

dbLoader, err := sqlite.NewSQLLiteLoader(db)
if err != nil {
return err
}
if err := dbLoader.Migrate(context.TODO()); err != nil {
return err
}

remover := sqlite.NewSQLStrandedBundleRemover(dbLoader)
if err := remover.Remove(); err != nil {
return fmt.Errorf("error removing stranded packages from database: %s", err)
}

return nil
}

1 change: 1 addition & 0 deletions pkg/registry/interface.go
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ type Load interface {
AddPackageChannels(manifest PackageManifest) error
AddBundlePackageChannels(manifest PackageManifest, bundle *Bundle) error
RemovePackage(packageName string) error
RemoveStrandedBundles() ([]string, error)
DeprecateBundle(path string) error
ClearNonHeadBundles() error
}
99 changes: 96 additions & 3 deletions pkg/sqlite/load.go
Original file line number Diff line number Diff line change
@@ -360,7 +360,14 @@ func (s *sqlLoader) addPackageChannels(tx *sql.Tx, manifest registry.PackageMani
break
}

if err := s.addPackageProperty(tx, channelEntryCSVName, manifest.PackageName, version); err != nil {
bundlePath, err := s.getBundlePathIfExists(tx, channelEntryCSVName)
if err != nil {
// this should only happen on an SQL error, bundlepath just not being set is for backwards compatibility reasons
errs = append(errs, err)
break
}

if err := s.addPackageProperty(tx, channelEntryCSVName, manifest.PackageName, version, bundlePath); err != nil {
errs = append(errs, err)
break
}
@@ -510,6 +517,38 @@ func (s *sqlLoader) getBundleSkipsReplacesVersion(tx *sql.Tx, bundleName string)
return
}

func (s *sqlLoader) getBundlePathIfExists(tx *sql.Tx, bundleName string) (bundlePath string, err error) {
getBundlePath, err := tx.Prepare(`
SELECT bundlepath
FROM operatorbundle
WHERE operatorbundle.name=? LIMIT 1`)
if err != nil {
return
}
defer getBundlePath.Close()

rows, rerr := getBundlePath.Query(bundleName)
if err != nil {
err = rerr
return
}
if !rows.Next() {
// no bundlepath set
return
}

var bundlePathSQL sql.NullString
if err = rows.Scan(&bundlePathSQL); err != nil {
return
}

if bundlePathSQL.Valid {
bundlePath = bundlePathSQL.String
}

return
}

func (s *sqlLoader) addAPIs(tx *sql.Tx, bundle *registry.Bundle) error {
if bundle.Name == "" {
return fmt.Errorf("cannot add apis for bundle with no name: %#v", bundle)
@@ -756,7 +795,7 @@ func (s *sqlLoader) addProperty(tx *sql.Tx, propType, value, bundleName, version
return nil
}

func (s *sqlLoader) addPackageProperty(tx *sql.Tx, bundleName, pkg, version string) error {
func (s *sqlLoader) addPackageProperty(tx *sql.Tx, bundleName, pkg, version, bundlePath string) error {
// Add the package property
prop := registry.PackageProperty{
PackageName: pkg,
@@ -767,7 +806,7 @@ func (s *sqlLoader) addPackageProperty(tx *sql.Tx, bundleName, pkg, version stri
return err
}

return s.addProperty(tx, registry.PackageType, string(value), bundleName, version, "")
return s.addProperty(tx, registry.PackageType, string(value), bundleName, version, bundlePath)
}

func (s *sqlLoader) addBundleProperties(tx *sql.Tx, bundle *registry.Bundle) error {
@@ -1001,3 +1040,57 @@ func (s *sqlLoader) DeprecateBundle(path string) error {

return tx.Commit()
}

func (s *sqlLoader) RemoveStrandedBundles() ([]string, error) {
tx, err := s.db.Begin()
if err != nil {
return nil, err
}
defer func() {
tx.Rollback()
}()

bundles, err := s.rmStrandedBundles(tx)
if err != nil {
return nil, err
}

return bundles, tx.Commit()
}

func (s *sqlLoader) rmStrandedBundles(tx *sql.Tx) ([]string, error) {
strandedBundles := make([]string, 0)

strandedBundleQuery := `SELECT name FROM operatorbundle WHERE name NOT IN (select operatorbundle_name from channel_entry)`
rows, err := tx.QueryContext(context.TODO(), strandedBundleQuery)
if err != nil {
return nil, err
}

var name sql.NullString
for rows.Next() {
if err := rows.Scan(&name); err != nil {
return nil, err
}
if name.Valid {
strandedBundles = append(strandedBundles, fmt.Sprintf(`"%s"`, name.String))
}
}
rows.Close()

if len(strandedBundles) == 0 {
return nil, nil
}

rmStmt, err := tx.Prepare(fmt.Sprintf("DELETE FROM operatorbundle WHERE name IN(%s)", strings.Join(strandedBundles, ",")))
if err != nil {
return nil, err
}
defer rmStmt.Close()

if _, err := rmStmt.Exec(); err != nil {
return strandedBundles, err
}

return strandedBundles, nil
}
42 changes: 42 additions & 0 deletions pkg/sqlite/migrations/010_set_bundlepath_pkg_property.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package migrations

import (
"context"
"database/sql"
)

const BundlePathPkgMigrationKey = 10

// Register this migration
func init() {
registerMigration(BundlePathPkgMigrationKey, bundlePathPkgPropertyMigration)
}

var bundlePathPkgPropertyMigration = &Migration{
Id: BundlePathPkgMigrationKey,
Up: func(ctx context.Context, tx *sql.Tx) error {
updatePropertiesSql := `
UPDATE properties
SET operatorbundle_path = (SELECT bundlepath
FROM operatorbundle
WHERE operatorbundle_name = operatorbundle.name AND operatorbundle_version = operatorbundle.version)`
_, err := tx.ExecContext(ctx, updatePropertiesSql)
if err != nil {
return err
}

return nil
},
Down: func(ctx context.Context, tx *sql.Tx) error {
updatePropertiesSql := `
UPDATE properties
SET operatorbundle_path = null
WHERE type = "olm.package"`
_, err := tx.ExecContext(ctx, updatePropertiesSql)
if err != nil {
return err
}

return err
},
}
79 changes: 79 additions & 0 deletions pkg/sqlite/migrations/010_set_bundlepath_pkg_property_test.go

Large diffs are not rendered by default.

41 changes: 41 additions & 0 deletions pkg/sqlite/stranded.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package sqlite

import (
"github.com/sirupsen/logrus"

"github.com/operator-framework/operator-registry/pkg/registry"
)

type SQLStrandedBundleRemover interface {
Remove() error
}

// StrandedBundleRemover removes stranded bundles from the database
type StrandedBundleRemover struct {
store registry.Load
}

var _ SQLStrandedBundleRemover = &StrandedBundleRemover{}

func NewSQLStrandedBundleRemover(store registry.Load) *StrandedBundleRemover {
return &StrandedBundleRemover{
store: store,
}
}

func (d *StrandedBundleRemover) Remove() error {
log := logrus.New()

bundles, err := d.store.RemoveStrandedBundles()
if err != nil {
return err
}

if len(bundles) > 0 {
log.Info("removing stranded bundles ", bundles)
} else {
log.Info("no stranded bundles found")
}

return nil
}
89 changes: 89 additions & 0 deletions pkg/sqlite/stranded_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
package sqlite

import (
"context"
"database/sql"
"testing"

"github.com/operator-framework/operator-registry/pkg/image"
"github.com/operator-framework/operator-registry/pkg/registry"

"github.com/sirupsen/logrus"
"github.com/stretchr/testify/require"
)

func TestStrandedBundleRemover(t *testing.T) {
logrus.SetLevel(logrus.DebugLevel)
db, cleanup := CreateTestDb(t)
defer cleanup()
store, err := NewSQLLiteLoader(db)
require.NoError(t, err)
require.NoError(t, store.Migrate(context.TODO()))

query := NewSQLLiteQuerierFromDb(db)

graphLoader, err := NewSQLGraphLoaderFromDB(db)
require.NoError(t, err)

populate := func(name string) error {
return registry.NewDirectoryPopulator(
store,
graphLoader,
query,
map[image.Reference]string{
image.SimpleReference("quay.io/test/" + name): "./testdata/strandedbundles/" + name,
}).Populate(registry.ReplacesMode)
}
for _, name := range []string{"prometheus.0.14.0", "prometheus.0.15.0", "prometheus.0.22.2"} {
require.NoError(t, populate(name))
}

// check that the bundle is orphaned
querier := NewSQLLiteQuerierFromDb(db)
packageBundles, err := querier.GetBundlesForPackage(context.TODO(), "prometheus")
require.NoError(t, err)
require.Equal(t, 1, len(packageBundles))

rows, err := db.QueryContext(context.TODO(), "select * from operatorbundle")
require.NoError(t, err)
require.Equal(t, 3, rowCount(rows))
require.NoError(t, rows.Close())

// check that properties are set
rows, err = db.QueryContext(context.TODO(), `select * from properties where operatorbundle_name="prometheusoperator.0.14.0"`)
require.NoError(t, err)
require.True(t, rows.Next())
require.NoError(t, rows.Close())

// prune the orphaned bundle
removedBundles, err := store.RemoveStrandedBundles()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should test the case where multiple bundles are stranded since that's a big part of the pruning

require.NoError(t, err)
require.Equal(t, 2, len(removedBundles))
require.EqualValues(t, []string{`"prometheusoperator.0.14.0"`, `"prometheusoperator.0.15.0"`}, removedBundles)

// other bundles in the package still exist, but the bundle is removed
packageBundles, err = querier.GetBundlesForPackage(context.TODO(), "prometheus")
require.NoError(t, err)
require.Equal(t, 1, len(packageBundles))

rows, err = db.QueryContext(context.TODO(), "select * from operatorbundle")
require.NoError(t, err)
require.Equal(t, 1, rowCount(rows))
require.NoError(t, rows.Close())

// check that properties are removed
rows, err = db.QueryContext(context.TODO(), `select * from properties where operatorbundle_name="prometheusoperator.0.14.0" OR operatorbundle_name="prometheusoperator.0.15.0"`)
require.NoError(t, err)
require.False(t, rows.Next())
require.NoError(t, rows.Close())

}

func rowCount(rows *sql.Rows) int {
count := 0
for rows.Next() {
count++
}

return count
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,240 @@
#! parse-kind: ClusterServiceVersion
apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
metadata:
name: prometheusoperator.0.14.0
namespace: placeholder
spec:
displayName: Prometheus
description: |
An open-source monitoring system with a dimensional data model, flexible query language, efficient time series database and modern alerting approach.
_The Prometheus Open Cloud Service is Public Alpha. The goal before Beta is for additional user testing and minor bug fixes._
### Monitoring applications
Prometheus scrapes your application metrics based on targets maintained in a ServiceMonitor object. When alerts need to be sent, they are processsed by an AlertManager.
[Read the complete guide to monitoring applications with the Prometheus Open Cloud Service](https://coreos.com/tectonic/docs/latest/alm/prometheus-ocs.html)
## 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']

maintainers:
- name: CoreOS, Inc
email: support@coreos.com

provider:
name: CoreOS, Inc

links:
- name: Prometheus
url: https://www.prometheus.io/
- name: Documentation
url: https://coreos.com/operators/prometheus/docs/latest/
- name: Prometheus Operator Source Code
url: https://github.com/coreos/prometheus-operator

labels:
alm-status-descriptors: prometheusoperator.0.14.0
alm-owner-prometheus: prometheusoperator

selector:
matchLabels:
alm-owner-prometheus: prometheusoperator

icon:
- base64data: PHN2ZyB3aWR0aD0iMjQ5MCIgaGVpZ2h0PSIyNTAwIiB2aWV3Qm94PSIwIDAgMjU2IDI1NyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCI+PHBhdGggZD0iTTEyOC4wMDEuNjY3QzU3LjMxMS42NjcgMCA1Ny45NzEgMCAxMjguNjY0YzAgNzAuNjkgNTcuMzExIDEyNy45OTggMTI4LjAwMSAxMjcuOTk4UzI1NiAxOTkuMzU0IDI1NiAxMjguNjY0QzI1NiA1Ny45NyAxOTguNjg5LjY2NyAxMjguMDAxLjY2N3ptMCAyMzkuNTZjLTIwLjExMiAwLTM2LjQxOS0xMy40MzUtMzYuNDE5LTMwLjAwNGg3Mi44MzhjMCAxNi41NjYtMTYuMzA2IDMwLjAwNC0zNi40MTkgMzAuMDA0em02MC4xNTMtMzkuOTRINjcuODQyVjE3OC40N2gxMjAuMzE0djIxLjgxNmgtLjAwMnptLS40MzItMzMuMDQ1SDY4LjE4NWMtLjM5OC0uNDU4LS44MDQtLjkxLTEuMTg4LTEuMzc1LTEyLjMxNS0xNC45NTQtMTUuMjE2LTIyLjc2LTE4LjAzMi0zMC43MTYtLjA0OC0uMjYyIDE0LjkzMyAzLjA2IDI1LjU1NiA1LjQ1IDAgMCA1LjQ2NiAxLjI2NSAxMy40NTggMi43MjItNy42NzMtOC45OTQtMTIuMjMtMjAuNDI4LTEyLjIzLTMyLjExNiAwLTI1LjY1OCAxOS42OC00OC4wNzkgMTIuNTgtNjYuMjAxIDYuOTEuNTYyIDE0LjMgMTQuNTgzIDE0LjggMzYuNTA1IDcuMzQ2LTEwLjE1MiAxMC40Mi0yOC42OSAxMC40Mi00MC4wNTYgMC0xMS43NjkgNy43NTUtMjUuNDQgMTUuNTEyLTI1LjkwNy02LjkxNSAxMS4zOTYgMS43OSAyMS4xNjUgOS41MyA0NS40IDIuOTAyIDkuMTAzIDIuNTMyIDI0LjQyMyA0Ljc3MiAzNC4xMzguNzQ0LTIwLjE3OCA0LjIxMy00OS42MiAxNy4wMTQtNTkuNzg0LTUuNjQ3IDEyLjguODM2IDI4LjgxOCA1LjI3IDM2LjUxOCA3LjE1NCAxMi40MjQgMTEuNDkgMjEuODM2IDExLjQ5IDM5LjYzOCAwIDExLjkzNi00LjQwNyAyMy4xNzMtMTEuODQgMzEuOTU4IDguNDUyLTEuNTg2IDE0LjI4OS0zLjAxNiAxNC4yODktMy4wMTZsMjcuNDUtNS4zNTVjLjAwMi0uMDAyLTMuOTg3IDE2LjQwMS0xOS4zMTQgMzIuMTk3eiIgZmlsbD0iI0RBNEUzMSIvPjwvc3ZnPg==
mediatype: image/svg+xml

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-14-0
rules:
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs: ["get", "list"]
- apiGroups:
- monitoring.coreos.com
resources:
- alertmanagers
- prometheuses
- servicemonitors
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: ['list']
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-14-0
containers:
- name: prometheus-operator
image: quay.io/coreos/prometheus-operator@sha256:5037b4e90dbb03ebdefaa547ddf6a1f748c8eeebeedf6b9d9f0913ad662b5731
command:
- sh
- -c
- >
/bin/operator --namespace=$K8S_NAMESPACE --crd-apigroup monitoring.coreos.com
--labels alm-status-descriptors=prometheusoperator.0.14.0,alm-owner-prometheus=prometheusoperator
--kubelet-service=kube-system/kubelet
--config-reloader-image=quay.io/coreos/configmap-reload:v0.0.1
env:
- name: K8S_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
ports:
- containerPort: 8080
name: http
resources:
limits:
cpu: 200m
memory: 100Mi
requests:
cpu: 100m
memory: 50Mi
maturity: alpha
version: 0.14.0
customresourcedefinitions:
owned:
- name: prometheuses.monitoring.coreos.com
version: v1
kind: Prometheus
displayName: Prometheus
description: A running Prometheus instance
resources:
- kind: Pod
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: Define resources requests and limits for single Pods
displayName: Resource Request
path: resources.requests
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:resourceRequirements'
statusDescriptors:
- description: The current number of Pods for the cluster
displayName: Cluster Size
path: replicas
- path: prometheusSelector
displayName: Prometheus Service Selector
description: Label selector to find the service that routes to this prometheus
x-descriptors:
- 'urn:alm:descriptor:label:selector'
- 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: Selector to select which namespaces the Endpoints objects are discovered from
displayName: Monitoring Namespaces
path: namespaceSelector
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:namespaceSelector'
- 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: Alert Manager
description: Configures an Alert Manager for the namespace
resources:
- kind: Pod
version: v1
specDescriptors:
- description: Desired number of Pods for the cluster
displayName: Size
path: replicas
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:podCount'
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: prometheusrules.monitoring.coreos.com
spec:
group: monitoring.coreos.com
names:
kind: PrometheusRule
plural: prometheusrules
scope: Namespaced
validation:
openAPIV3Schema:
properties:
spec:
description: PrometheusRuleSpec contains specification parameters for a
Rule.
properties:
groups:
description: Content of Prometheus rule file
items:
description: RuleGroup is a list of sequentially evaluated recording
and alerting rules.
properties:
interval:
type: string
name:
type: string
rules:
items:
description: Rule describes an alerting or recording rule.
properties:
alert:
type: string
annotations:
type: object
expr:
type: string
for:
type: string
labels:
type: object
record:
type: string
required:
- expr
type: array
required:
- name
- rules
type: array
version: v1
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: servicemonitors.monitoring.coreos.com
spec:
group: monitoring.coreos.com
names:
kind: ServiceMonitor
plural: servicemonitors
scope: Namespaced
validation:
openAPIV3Schema:
properties:
spec:
description: ServiceMonitorSpec contains specification parameters for a
ServiceMonitor.
properties:
endpoints:
description: A list of endpoints allowed as part of this ServiceMonitor.
items:
description: Endpoint defines a scrapeable endpoint serving Prometheus
metrics.
properties:
basicAuth:
description: 'BasicAuth allow an endpoint to authenticate over
basic authentication More info: https://prometheus.io/docs/operating/configuration/#endpoints'
properties:
password:
description: SecretKeySelector selects a key of a Secret.
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
optional:
description: Specify whether the Secret or it's key must
be defined
type: boolean
required:
- key
username:
description: SecretKeySelector selects a key of a Secret.
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
optional:
description: Specify whether the Secret or it's key must
be defined
type: boolean
required:
- key
bearerTokenFile:
description: File to read bearer token for scraping targets.
type: string
honorLabels:
description: HonorLabels chooses the metric's labels on collisions
with target labels.
type: boolean
interval:
description: Interval at which metrics should be scraped
type: string
metricRelabelings:
description: MetricRelabelConfigs to apply to samples before ingestion.
items:
description: 'RelabelConfig allows dynamic rewriting of the
label set, being applied to samples before ingestion. It defines
`<metric_relabel_configs>`-section of Prometheus configuration.
More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs'
properties:
action:
description: Action to perform based on regex matching.
Default is 'replace'
type: string
modulus:
description: Modulus to take of the hash of the source label
values.
format: int64
type: integer
regex:
description: Regular expression against which the extracted
value is matched. defailt is '(.*)'
type: string
replacement:
description: Replacement value against which a regex replace
is performed if the regular expression matches. Regex
capture groups are available. Default is '$1'
type: string
separator:
description: Separator placed between concatenated source
label values. default is ';'.
type: string
sourceLabels:
description: The source labels select values from existing
labels. Their content is concatenated using the configured
separator and matched against the configured regular expression
for the replace, keep, and drop actions.
items:
type: string
type: array
targetLabel:
description: Label to which the resulting value is written
in a replace action. It is mandatory for replace actions.
Regex capture groups are available.
type: string
type: array
params:
description: Optional HTTP URL parameters
type: object
path:
description: HTTP path to scrape for metrics.
type: string
port:
description: Name of the service port this endpoint refers to.
Mutually exclusive with targetPort.
type: string
proxyUrl:
description: ProxyURL eg http://proxyserver:2195 Directs scrapes
to proxy through this endpoint.
type: string
scheme:
description: HTTP scheme to use for scraping.
type: string
scrapeTimeout:
description: Timeout after which the scrape is ended
type: string
targetPort:
anyOf:
- type: string
- type: integer
tlsConfig:
description: TLSConfig specifies TLS configuration parameters.
properties:
caFile:
description: The CA cert to use for the targets.
type: string
certFile:
description: The client cert file for the targets.
type: string
insecureSkipVerify:
description: Disable target certificate validation.
type: boolean
keyFile:
description: The client key file for the targets.
type: string
serverName:
description: Used to verify the hostname for the targets.
type: string
type: array
jobLabel:
description: The label to use to retrieve the job name from.
type: string
namespaceSelector:
description: A selector for selecting namespaces either selecting all
namespaces or a list of namespaces.
properties:
any:
description: Boolean describing whether all namespaces are selected
in contrast to a list restricting them.
type: boolean
matchNames:
description: List of namespace names.
items:
type: string
type: array
selector:
description: A label selector is a label query over a set of resources.
The result of matchLabels and matchExpressions are ANDed. An empty
label selector matches all objects. A null label selector matches
no objects.
properties:
matchExpressions:
description: matchExpressions is a list of label selector requirements.
The requirements are ANDed.
items:
description: A label selector requirement is a selector that contains
values, a key, and an operator that relates the key and values.
properties:
key:
description: key is the label key that the selector applies
to.
type: string
operator:
description: operator represents a key's relationship to a
set of values. Valid operators are In, NotIn, Exists and
DoesNotExist.
type: string
values:
description: values is an array of string values. If the operator
is In or NotIn, the values array must be non-empty. If the
operator is Exists or DoesNotExist, the values array must
be empty. This array is replaced during a strategic merge
patch.
items:
type: string
type: array
required:
- key
- operator
type: array
matchLabels:
description: matchLabels is a map of {key,value} pairs. A single
{key,value} in the matchLabels map is equivalent to an element
of matchExpressions, whose key field is "key", the operator is
"In", and the values array contains only "value". The requirements
are ANDed.
type: object
targetLabels:
description: TargetLabels transfers labels on the Kubernetes Service
onto the target.
items:
type: string
type: array
required:
- endpoints
- selector
version: v1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
annotations:
operators.operatorframework.io.bundle.package.v1: "prometheus"
operators.operatorframework.io.bundle.channels.v1: "preview"
operators.operatorframework.io.bundle.channel.default.v1: "preview"

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@
#! parse-kind: ClusterServiceVersion
apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
metadata:
name: prometheusoperator.0.15.0
namespace: placeholder
annotations:
tectonic-visibility: ocs
alm-examples: '[{"apiVersion":"monitoring.coreos.com/v1","kind":"Prometheus","metadata":{"name":"example","labels":{"prometheus":"k8s"}},"spec":{"replicas":2,"version":"v1.7.0","serviceAccountName":"prometheus-k8s","serviceMonitorSelector":{"matchExpressions":[{"key":"k8s-app","operator":"Exists"}]},"ruleSelector":{"matchLabels":{"role":"prometheus-rulefiles","prometheus":"k8s"}},"resources":{"requests":{"memory":"400Mi"}},"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","prometheus":"k8s"}},"namespaceSelector":{"matchNames":["monitoring"]},"endpoints":[{"port":"web","interval":"30s"}]}},{"apiVersion":"monitoring.coreos.com/v1","kind":"Alertmanager","metadata":{"name":"alertmanager-main"},"spec":{"replicas":3}}]'
spec:
replaces: prometheusoperator.0.14.0
displayName: Prometheus
description: |
An open-source monitoring system with a dimensional data model, flexible query language, efficient time series database and modern alerting approach.
_The Prometheus Open Cloud Service is Public Alpha. The goal before Beta is for additional user testing and minor bug fixes._
### Monitoring applications
Prometheus scrapes your application metrics based on targets maintained in a ServiceMonitor object. When alerts need to be sent, they are processsed by an AlertManager.
[Read the complete guide to monitoring applications with the Prometheus Open Cloud Service](https://coreos.com/tectonic/docs/latest/alm/prometheus-ocs.html)
### 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']

maintainers:
- name: CoreOS, Inc
email: support@coreos.com

provider:
name: CoreOS, Inc

links:
- name: Prometheus
url: https://www.prometheus.io/
- name: Documentation
url: https://coreos.com/operators/prometheus/docs/latest/
- name: Prometheus Operator Source Code
url: https://github.com/coreos/prometheus-operator

labels:
alm-status-descriptors: prometheusoperator.0.15.0
alm-owner-prometheus: prometheusoperator

selector:
matchLabels:
alm-owner-prometheus: prometheusoperator

icon:
- base64data: PHN2ZyB3aWR0aD0iMjQ5MCIgaGVpZ2h0PSIyNTAwIiB2aWV3Qm94PSIwIDAgMjU2IDI1NyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCI+PHBhdGggZD0iTTEyOC4wMDEuNjY3QzU3LjMxMS42NjcgMCA1Ny45NzEgMCAxMjguNjY0YzAgNzAuNjkgNTcuMzExIDEyNy45OTggMTI4LjAwMSAxMjcuOTk4UzI1NiAxOTkuMzU0IDI1NiAxMjguNjY0QzI1NiA1Ny45NyAxOTguNjg5LjY2NyAxMjguMDAxLjY2N3ptMCAyMzkuNTZjLTIwLjExMiAwLTM2LjQxOS0xMy40MzUtMzYuNDE5LTMwLjAwNGg3Mi44MzhjMCAxNi41NjYtMTYuMzA2IDMwLjAwNC0zNi40MTkgMzAuMDA0em02MC4xNTMtMzkuOTRINjcuODQyVjE3OC40N2gxMjAuMzE0djIxLjgxNmgtLjAwMnptLS40MzItMzMuMDQ1SDY4LjE4NWMtLjM5OC0uNDU4LS44MDQtLjkxLTEuMTg4LTEuMzc1LTEyLjMxNS0xNC45NTQtMTUuMjE2LTIyLjc2LTE4LjAzMi0zMC43MTYtLjA0OC0uMjYyIDE0LjkzMyAzLjA2IDI1LjU1NiA1LjQ1IDAgMCA1LjQ2NiAxLjI2NSAxMy40NTggMi43MjItNy42NzMtOC45OTQtMTIuMjMtMjAuNDI4LTEyLjIzLTMyLjExNiAwLTI1LjY1OCAxOS42OC00OC4wNzkgMTIuNTgtNjYuMjAxIDYuOTEuNTYyIDE0LjMgMTQuNTgzIDE0LjggMzYuNTA1IDcuMzQ2LTEwLjE1MiAxMC40Mi0yOC42OSAxMC40Mi00MC4wNTYgMC0xMS43NjkgNy43NTUtMjUuNDQgMTUuNTEyLTI1LjkwNy02LjkxNSAxMS4zOTYgMS43OSAyMS4xNjUgOS41MyA0NS40IDIuOTAyIDkuMTAzIDIuNTMyIDI0LjQyMyA0Ljc3MiAzNC4xMzguNzQ0LTIwLjE3OCA0LjIxMy00OS42MiAxNy4wMTQtNTkuNzg0LTUuNjQ3IDEyLjguODM2IDI4LjgxOCA1LjI3IDM2LjUxOCA3LjE1NCAxMi40MjQgMTEuNDkgMjEuODM2IDExLjQ5IDM5LjYzOCAwIDExLjkzNi00LjQwNyAyMy4xNzMtMTEuODQgMzEuOTU4IDguNDUyLTEuNTg2IDE0LjI4OS0zLjAxNiAxNC4yODktMy4wMTZsMjcuNDUtNS4zNTVjLjAwMi0uMDAyLTMuOTg3IDE2LjQwMS0xOS4zMTQgMzIuMTk3eiIgZmlsbD0iI0RBNEUzMSIvPjwvc3ZnPg==
mediatype: image/svg+xml

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-14-0
rules:
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs: ["get", "list"]
- apiGroups:
- monitoring.coreos.com
resources:
- alertmanagers
- prometheuses
- servicemonitors
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: ['list']
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-14-0
containers:
- name: prometheus-operator
image: quay.io/coreos/prometheus-operator@sha256:0e92dd9b5789c4b13d53e1319d0a6375bcca4caaf0d698af61198061222a576d
command:
- sh
- -c
- >
/bin/operator --namespace=$K8S_NAMESPACE --crd-apigroup monitoring.coreos.com
--labels alm-status-descriptors=prometheusoperator.0.15.0,alm-owner-prometheus=prometheusoperator
--kubelet-service=kube-system/kubelet
--config-reloader-image=quay.io/coreos/configmap-reload:v0.0.1
env:
- name: K8S_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
ports:
- containerPort: 8080
name: http
resources:
limits:
cpu: 200m
memory: 100Mi
requests:
cpu: 100m
memory: 50Mi
maturity: alpha
version: 0.15.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
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'
statusDescriptors:
- description: The current number of Pods for the cluster
displayName: Cluster Size
path: replicas
- path: prometheusSelector
displayName: Prometheus Service Selector
description: Label selector to find the service that routes to this prometheus
x-descriptors:
- 'urn:alm:descriptor:label:selector'
- 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: Selector to select which namespaces the Endpoints objects are discovered from
displayName: Monitoring Namespaces
path: namespaceSelector
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:namespaceSelector'
- 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: Alert Manager
description: Configures an Alert Manager for the namespace
resources:
- kind: StatefulSet
version: v1beta2
- kind: Pod
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'
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: prometheusrules.monitoring.coreos.com
spec:
group: monitoring.coreos.com
names:
kind: PrometheusRule
plural: prometheusrules
scope: Namespaced
validation:
openAPIV3Schema:
properties:
spec:
description: PrometheusRuleSpec contains specification parameters for a
Rule.
properties:
groups:
description: Content of Prometheus rule file
items:
description: RuleGroup is a list of sequentially evaluated recording
and alerting rules.
properties:
interval:
type: string
name:
type: string
rules:
items:
description: Rule describes an alerting or recording rule.
properties:
alert:
type: string
annotations:
type: object
expr:
type: string
for:
type: string
labels:
type: object
record:
type: string
required:
- expr
type: array
required:
- name
- rules
type: array
version: v1
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: servicemonitors.monitoring.coreos.com
spec:
group: monitoring.coreos.com
names:
kind: ServiceMonitor
plural: servicemonitors
scope: Namespaced
validation:
openAPIV3Schema:
properties:
spec:
description: ServiceMonitorSpec contains specification parameters for a
ServiceMonitor.
properties:
endpoints:
description: A list of endpoints allowed as part of this ServiceMonitor.
items:
description: Endpoint defines a scrapeable endpoint serving Prometheus
metrics.
properties:
basicAuth:
description: 'BasicAuth allow an endpoint to authenticate over
basic authentication More info: https://prometheus.io/docs/operating/configuration/#endpoints'
properties:
password:
description: SecretKeySelector selects a key of a Secret.
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
optional:
description: Specify whether the Secret or it's key must
be defined
type: boolean
required:
- key
username:
description: SecretKeySelector selects a key of a Secret.
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
optional:
description: Specify whether the Secret or it's key must
be defined
type: boolean
required:
- key
bearerTokenFile:
description: File to read bearer token for scraping targets.
type: string
honorLabels:
description: HonorLabels chooses the metric's labels on collisions
with target labels.
type: boolean
interval:
description: Interval at which metrics should be scraped
type: string
metricRelabelings:
description: MetricRelabelConfigs to apply to samples before ingestion.
items:
description: 'RelabelConfig allows dynamic rewriting of the
label set, being applied to samples before ingestion. It defines
`<metric_relabel_configs>`-section of Prometheus configuration.
More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs'
properties:
action:
description: Action to perform based on regex matching.
Default is 'replace'
type: string
modulus:
description: Modulus to take of the hash of the source label
values.
format: int64
type: integer
regex:
description: Regular expression against which the extracted
value is matched. defailt is '(.*)'
type: string
replacement:
description: Replacement value against which a regex replace
is performed if the regular expression matches. Regex
capture groups are available. Default is '$1'
type: string
separator:
description: Separator placed between concatenated source
label values. default is ';'.
type: string
sourceLabels:
description: The source labels select values from existing
labels. Their content is concatenated using the configured
separator and matched against the configured regular expression
for the replace, keep, and drop actions.
items:
type: string
type: array
targetLabel:
description: Label to which the resulting value is written
in a replace action. It is mandatory for replace actions.
Regex capture groups are available.
type: string
type: array
params:
description: Optional HTTP URL parameters
type: object
path:
description: HTTP path to scrape for metrics.
type: string
port:
description: Name of the service port this endpoint refers to.
Mutually exclusive with targetPort.
type: string
proxyUrl:
description: ProxyURL eg http://proxyserver:2195 Directs scrapes
to proxy through this endpoint.
type: string
scheme:
description: HTTP scheme to use for scraping.
type: string
scrapeTimeout:
description: Timeout after which the scrape is ended
type: string
targetPort:
anyOf:
- type: string
- type: integer
tlsConfig:
description: TLSConfig specifies TLS configuration parameters.
properties:
caFile:
description: The CA cert to use for the targets.
type: string
certFile:
description: The client cert file for the targets.
type: string
insecureSkipVerify:
description: Disable target certificate validation.
type: boolean
keyFile:
description: The client key file for the targets.
type: string
serverName:
description: Used to verify the hostname for the targets.
type: string
type: array
jobLabel:
description: The label to use to retrieve the job name from.
type: string
namespaceSelector:
description: A selector for selecting namespaces either selecting all
namespaces or a list of namespaces.
properties:
any:
description: Boolean describing whether all namespaces are selected
in contrast to a list restricting them.
type: boolean
matchNames:
description: List of namespace names.
items:
type: string
type: array
selector:
description: A label selector is a label query over a set of resources.
The result of matchLabels and matchExpressions are ANDed. An empty
label selector matches all objects. A null label selector matches
no objects.
properties:
matchExpressions:
description: matchExpressions is a list of label selector requirements.
The requirements are ANDed.
items:
description: A label selector requirement is a selector that contains
values, a key, and an operator that relates the key and values.
properties:
key:
description: key is the label key that the selector applies
to.
type: string
operator:
description: operator represents a key's relationship to a
set of values. Valid operators are In, NotIn, Exists and
DoesNotExist.
type: string
values:
description: values is an array of string values. If the operator
is In or NotIn, the values array must be non-empty. If the
operator is Exists or DoesNotExist, the values array must
be empty. This array is replaced during a strategic merge
patch.
items:
type: string
type: array
required:
- key
- operator
type: array
matchLabels:
description: matchLabels is a map of {key,value} pairs. A single
{key,value} in the matchLabels map is equivalent to an element
of matchExpressions, whose key field is "key", the operator is
"In", and the values array contains only "value". The requirements
are ANDed.
type: object
targetLabels:
description: TargetLabels transfers labels on the Kubernetes Service
onto the target.
items:
type: string
type: array
required:
- endpoints
- selector
version: v1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
annotations:
operators.operatorframework.io.bundle.package.v1: "prometheus"
operators.operatorframework.io.bundle.channels.v1: "preview,stable"
operators.operatorframework.io.bundle.channel.default.v1: "preview"

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,270 @@
#! parse-kind: ClusterServiceVersion
apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
metadata:
name: prometheusoperator.0.22.2
namespace: placeholder
annotations:
alm-examples: '[{"apiVersion":"monitoring.coreos.com/v1","kind":"Prometheus","metadata":{"name":"example","labels":{"prometheus":"k8s"}},"spec":{"replicas":2,"version":"v2.3.2","serviceAccountName":"prometheus-k8s","securityContext": {}, "serviceMonitorSelector":{"matchExpressions":[{"key":"k8s-app","operator":"Exists"}]},"ruleSelector":{"matchLabels":{"role":"prometheus-rulefiles","prometheus":"k8s"}},"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": {}}}]'
spec:
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']

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://coreos.com/operators/prometheus/docs/latest/
- name: Prometheus Operator
url: https://github.com/coreos/prometheus-operator

labels:
alm-status-descriptors: prometheusoperator.0.22.2
alm-owner-prometheus: prometheusoperator

selector:
matchLabels:
alm-owner-prometheus: prometheusoperator

icon:
- base64data: PHN2ZyB3aWR0aD0iMjQ5MCIgaGVpZ2h0PSIyNTAwIiB2aWV3Qm94PSIwIDAgMjU2IDI1NyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCI+PHBhdGggZD0iTTEyOC4wMDEuNjY3QzU3LjMxMS42NjcgMCA1Ny45NzEgMCAxMjguNjY0YzAgNzAuNjkgNTcuMzExIDEyNy45OTggMTI4LjAwMSAxMjcuOTk4UzI1NiAxOTkuMzU0IDI1NiAxMjguNjY0QzI1NiA1Ny45NyAxOTguNjg5LjY2NyAxMjguMDAxLjY2N3ptMCAyMzkuNTZjLTIwLjExMiAwLTM2LjQxOS0xMy40MzUtMzYuNDE5LTMwLjAwNGg3Mi44MzhjMCAxNi41NjYtMTYuMzA2IDMwLjAwNC0zNi40MTkgMzAuMDA0em02MC4xNTMtMzkuOTRINjcuODQyVjE3OC40N2gxMjAuMzE0djIxLjgxNmgtLjAwMnptLS40MzItMzMuMDQ1SDY4LjE4NWMtLjM5OC0uNDU4LS44MDQtLjkxLTEuMTg4LTEuMzc1LTEyLjMxNS0xNC45NTQtMTUuMjE2LTIyLjc2LTE4LjAzMi0zMC43MTYtLjA0OC0uMjYyIDE0LjkzMyAzLjA2IDI1LjU1NiA1LjQ1IDAgMCA1LjQ2NiAxLjI2NSAxMy40NTggMi43MjItNy42NzMtOC45OTQtMTIuMjMtMjAuNDI4LTEyLjIzLTMyLjExNiAwLTI1LjY1OCAxOS42OC00OC4wNzkgMTIuNTgtNjYuMjAxIDYuOTEuNTYyIDE0LjMgMTQuNTgzIDE0LjggMzYuNTA1IDcuMzQ2LTEwLjE1MiAxMC40Mi0yOC42OSAxMC40Mi00MC4wNTYgMC0xMS43NjkgNy43NTUtMjUuNDQgMTUuNTEyLTI1LjkwNy02LjkxNSAxMS4zOTYgMS43OSAyMS4xNjUgOS41MyA0NS40IDIuOTAyIDkuMTAzIDIuNTMyIDI0LjQyMyA0Ljc3MiAzNC4xMzguNzQ0LTIwLjE3OCA0LjIxMy00OS42MiAxNy4wMTQtNTkuNzg0LTUuNjQ3IDEyLjguODM2IDI4LjgxOCA1LjI3IDM2LjUxOCA3LjE1NCAxMi40MjQgMTEuNDkgMjEuODM2IDExLjQ5IDM5LjYzOCAwIDExLjkzNi00LjQwNyAyMy4xNzMtMTEuODQgMzEuOTU4IDguNDUyLTEuNTg2IDE0LjI4OS0zLjAxNiAxNC4yODktMy4wMTZsMjcuNDUtNS4zNTVjLjAwMi0uMDAyLTMuOTg3IDE2LjQwMS0xOS4zMTQgMzIuMTk3eiIgZmlsbD0iI0RBNEUzMSIvPjwvc3ZnPg==
mediatype: image/svg+xml

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-22-2
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:
- 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-22-2
containers:
- name: prometheus-operator
image: quay.io/coreos/prometheus-operator@sha256:3daa69a8c6c2f1d35dcf1fe48a7cd8b230e55f5229a1ded438f687debade5bcf
args:
- -namespace=$(K8S_NAMESPACE)
- -manage-crds=false
- -logtostderr=true
- --config-reloader-image=quay.io/coreos/configmap-reload:v0.0.1
- --prometheus-config-reloader=quay.io/coreos/prometheus-config-reloader:v0.22.2
env:
- name: K8S_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
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.22.2
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
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
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'
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: prometheusrules.monitoring.coreos.com
spec:
group: monitoring.coreos.com
names:
kind: PrometheusRule
plural: prometheusrules
scope: Namespaced
validation:
openAPIV3Schema:
properties:
spec:
description: PrometheusRuleSpec contains specification parameters for a
Rule.
properties:
groups:
description: Content of Prometheus rule file
items:
description: RuleGroup is a list of sequentially evaluated recording
and alerting rules.
properties:
interval:
type: string
name:
type: string
rules:
items:
description: Rule describes an alerting or recording rule.
properties:
alert:
type: string
annotations:
type: object
expr:
type: string
for:
type: string
labels:
type: object
record:
type: string
required:
- expr
type: array
required:
- name
- rules
type: array
version: v1
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: servicemonitors.monitoring.coreos.com
spec:
group: monitoring.coreos.com
names:
kind: ServiceMonitor
plural: servicemonitors
scope: Namespaced
validation:
openAPIV3Schema:
properties:
spec:
description: ServiceMonitorSpec contains specification parameters for a
ServiceMonitor.
properties:
endpoints:
description: A list of endpoints allowed as part of this ServiceMonitor.
items:
description: Endpoint defines a scrapeable endpoint serving Prometheus
metrics.
properties:
basicAuth:
description: 'BasicAuth allow an endpoint to authenticate over
basic authentication More info: https://prometheus.io/docs/operating/configuration/#endpoints'
properties:
password:
description: SecretKeySelector selects a key of a Secret.
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
optional:
description: Specify whether the Secret or it's key must
be defined
type: boolean
required:
- key
username:
description: SecretKeySelector selects a key of a Secret.
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
type: string
optional:
description: Specify whether the Secret or it's key must
be defined
type: boolean
required:
- key
bearerTokenFile:
description: File to read bearer token for scraping targets.
type: string
honorLabels:
description: HonorLabels chooses the metric's labels on collisions
with target labels.
type: boolean
interval:
description: Interval at which metrics should be scraped
type: string
metricRelabelings:
description: MetricRelabelConfigs to apply to samples before ingestion.
items:
description: 'RelabelConfig allows dynamic rewriting of the
label set, being applied to samples before ingestion. It defines
`<metric_relabel_configs>`-section of Prometheus configuration.
More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs'
properties:
action:
description: Action to perform based on regex matching.
Default is 'replace'
type: string
modulus:
description: Modulus to take of the hash of the source label
values.
format: int64
type: integer
regex:
description: Regular expression against which the extracted
value is matched. defailt is '(.*)'
type: string
replacement:
description: Replacement value against which a regex replace
is performed if the regular expression matches. Regex
capture groups are available. Default is '$1'
type: string
separator:
description: Separator placed between concatenated source
label values. default is ';'.
type: string
sourceLabels:
description: The source labels select values from existing
labels. Their content is concatenated using the configured
separator and matched against the configured regular expression
for the replace, keep, and drop actions.
items:
type: string
type: array
targetLabel:
description: Label to which the resulting value is written
in a replace action. It is mandatory for replace actions.
Regex capture groups are available.
type: string
type: array
params:
description: Optional HTTP URL parameters
type: object
path:
description: HTTP path to scrape for metrics.
type: string
port:
description: Name of the service port this endpoint refers to.
Mutually exclusive with targetPort.
type: string
proxyUrl:
description: ProxyURL eg http://proxyserver:2195 Directs scrapes
to proxy through this endpoint.
type: string
scheme:
description: HTTP scheme to use for scraping.
type: string
scrapeTimeout:
description: Timeout after which the scrape is ended
type: string
targetPort:
anyOf:
- type: string
- type: integer
tlsConfig:
description: TLSConfig specifies TLS configuration parameters.
properties:
caFile:
description: The CA cert to use for the targets.
type: string
certFile:
description: The client cert file for the targets.
type: string
insecureSkipVerify:
description: Disable target certificate validation.
type: boolean
keyFile:
description: The client key file for the targets.
type: string
serverName:
description: Used to verify the hostname for the targets.
type: string
type: array
jobLabel:
description: The label to use to retrieve the job name from.
type: string
namespaceSelector:
description: A selector for selecting namespaces either selecting all
namespaces or a list of namespaces.
properties:
any:
description: Boolean describing whether all namespaces are selected
in contrast to a list restricting them.
type: boolean
matchNames:
description: List of namespace names.
items:
type: string
type: array
selector:
description: A label selector is a label query over a set of resources.
The result of matchLabels and matchExpressions are ANDed. An empty
label selector matches all objects. A null label selector matches
no objects.
properties:
matchExpressions:
description: matchExpressions is a list of label selector requirements.
The requirements are ANDed.
items:
description: A label selector requirement is a selector that contains
values, a key, and an operator that relates the key and values.
properties:
key:
description: key is the label key that the selector applies
to.
type: string
operator:
description: operator represents a key's relationship to a
set of values. Valid operators are In, NotIn, Exists and
DoesNotExist.
type: string
values:
description: values is an array of string values. If the operator
is In or NotIn, the values array must be non-empty. If the
operator is Exists or DoesNotExist, the values array must
be empty. This array is replaced during a strategic merge
patch.
items:
type: string
type: array
required:
- key
- operator
type: array
matchLabels:
description: matchLabels is a map of {key,value} pairs. A single
{key,value} in the matchLabels map is equivalent to an element
of matchExpressions, whose key field is "key", the operator is
"In", and the values array contains only "value". The requirements
are ANDed.
type: object
targetLabels:
description: TargetLabels transfers labels on the Kubernetes Service
onto the target.
items:
type: string
type: array
required:
- endpoints
- selector
version: v1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
annotations:
operators.operatorframework.io.bundle.package.v1: "prometheus"
operators.operatorframework.io.bundle.channels.v1: "preview,stable"
operators.operatorframework.io.bundle.channel.default.v1: "stable"
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
dependencies:
- type: olm.package
value:
packageName: testoperator
version: "> 0.2.0"
- type: olm.gvk
value:
group: testprometheus.coreos.com
kind: testtestprometheus
version: v1