Skip to content

Commit

Permalink
Merge pull request #33 from prometheus-operator/docs/adding-analyze-o…
Browse files Browse the repository at this point in the history
…perator-command

[DOCS] adding analyze operator cmd docs
  • Loading branch information
nicolastakashi committed Sep 13, 2024
2 parents d089f11 + 0fbe9cd commit 540add3
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
18 changes: 18 additions & 0 deletions Documentation/commands/analyze/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,21 @@ The ServiceMonitor object must have a defined selector that selects at least one
### Port Matching

Each endpoint within the ServiceMonitor object must have a defined port, and this port should match the port of the service it monitors.

## Analyze Operator

The analyze command can also target the Prometheus Operator deployment within a Kubernetes cluster. Users can specify the namespace and name of the Prometheus Operator to assess its compliance with the predefined rules.

## Rules

The analyze command evaluates objects against a set of rules to determine compliance. These rules are defined in the `analyzer` package and are specifically implemented in the `internal/analyzer/operator.go` file.

### Operator Existence

The Prometheus Operator must be deployed in the Kubernetes cluster, which can be confirmed by checking for the presence of the prometheus-operator deployment in the specified namespace and under the given name.

### RBAC Rules

The Prometheus Operator deployment requires proper RBAC (Role-Based Access Control) rules to function correctly. This means the service account associated with the Prometheus Operator must have permissions aligned with the Prometheus Operator CRDs (Custom Resource Definitions) present in the cluster.

For instance, if the Prometheus Operator is managing only Prometheus instances, the service account should have the necessary permissions to create, update, and delete Prometheus resources, but it should not have permissions to manage other resources like Alertmanager.
4 changes: 2 additions & 2 deletions Documentation/commands/create/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Global Flags:
--kubeconfig string path to the kubeconfig file, defaults to $KUBECONFIG
--log-format string Log format (default "text")
--log-level string Log level (default "DEBUG")
--version string Prometheus Operator version (default "0.74.0")
--version string Prometheus Operator version (default "0.76.2")
```

# Create ServiceMonitor
Expand All @@ -46,5 +46,5 @@ Global Flags:
--kubeconfig string path to the kubeconfig file, defaults to $KUBECONFIG
--log-format string Log format (default "text")
--log-level string Log level (default "DEBUG")
--version string Prometheus Operator version (default "0.74.0")
--version string Prometheus Operator version (default "0.76.2")
```
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Global Flags:
--kubeconfig string path to the kubeconfig file, defaults to $KUBECONFIG
--log-format string Log format (default "text")
--log-level string Log level (default "DEBUG")
--version string Prometheus Operator version (default "0.74.0")
--version string Prometheus Operator version (default "0.76.2")
```

#### Service Monitor
Expand All @@ -80,7 +80,7 @@ Global Flags:
--kubeconfig string path to the kubeconfig file, defaults to $KUBECONFIG
--log-format string Log format (default "text")
--log-level string Log level (default "DEBUG")
--version string Prometheus Operator version (default "0.74.0")
--version string Prometheus Operator version (default "0.76.2")
```

### Analyze
Expand Down
2 changes: 1 addition & 1 deletion cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var createCmd = &cobra.Command{
// Run: func(cmd *cobra.Command, args []string) { },
}

const LatestVersion = "0.74.0"
const LatestVersion = "0.76.2"

func init() {
rootCmd.AddCommand(createCmd)
Expand Down

0 comments on commit 540add3

Please sign in to comment.