Skip to content

Commit

Permalink
Merge pull request #4 from rh-mobb/fed-prom-update
Browse files Browse the repository at this point in the history
update fed-prom chart to use grafana dep
  • Loading branch information
paulczar authored Oct 27, 2021
2 parents 5ee6d7d + 40c6160 commit 9f5a867
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 173 deletions.
7 changes: 6 additions & 1 deletion charts/rosa-federated-prometheus/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@ description: A Helm chart for Kubernetes

type: application

version: 0.2.0
version: 0.3.0

appVersion: "0.1.0"

maintainers:
- name: paulczar

home: https://github.com/rh-mobb/helm-charts

dependencies:
- name: grafana-cr
version: "0.1.0"
repository: "https://rh-mobb.github.io/helm-charts/"
12 changes: 6 additions & 6 deletions charts/rosa-federated-prometheus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@ This Helm chart will deploy a Prometheus server on ROSA and configure it to slur
Set the following environment variables

```
export PROM_NAMESPACE=custom-prometheus
export NAMESPACE=custom-prometheus
```

## Install Operators

This relies on the Prometheus and Grafana operators, you can deploy them from the OpenShift Console, or via the script found in `./files/deploy-operators.sh`.
This relies on the Prometheus and Grafana operators, you can deploy them from the OpenShift Console, or via the script found in `./files/pre-install.sh`.

Run one of the following:

```bash
curl -sSL https://raw.githubusercontent.com/rh-mobb/helm-charts/main/charts/rosa-federated-prometheus/files/deploy-operators.sh | bash
curl -sSL https://raw.githubusercontent.com/rh-mobb/helm-charts/main/charts/rosa-federated-prometheus/files/pre-install.sh | bash
```

or if you've cloned down this repository

```bash
./files/deploy-operators.sh
./files/pre-install.sh
```

## Deploy the Helm Chart
Expand All @@ -42,13 +42,13 @@ Run one of the following:
1. Update your Repository

```bash
helm repo update
helm repo update && helm dependency update
```

1. Install a Chart

```bash
helm install -n my-prometheus mobb/rosa-federated-prometheus
helm install -n $NAMESPACE monitoring mobb/rosa-federated-prometheus
```

1. Find the Routes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
#!/bin/bash

if [[ -z $PROM_NAMESPACE ]]; then
echo "Please set PROM_NAMESPACE environment variable"
if [[ -z $NAMESPACE ]]; then
echo "Please set NAMESPACE environment variable"
exit 1
fi

echo "--> Creating Namespace - $PROM_NAMESPACE"
echo "--> Creating Namespace - $NAMESPACE"

cat << EOF | kubectl apply -f -
---
apiVersion: v1
kind: Namespace
metadata:
name: ${PROM_NAMESPACE}
name: ${NAMESPACE}
EOF

echo "--> Deploying Prometheus Operator to $PROM_NAMESPACE"
echo "--> Deploying Prometheus Operator to $NAMESPACE"

cat << EOF | kubectl apply -f -
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: federated-metrics
namespace: ${PROM_NAMESPACE}
namespace: ${NAMESPACE}
spec:
targetNamespaces:
- ${PROM_NAMESPACE}
- ${NAMESPACE}
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: prometheus
namespace: ${PROM_NAMESPACE}
namespace: ${NAMESPACE}
spec:
channel: beta
installPlanApproval: Automatic
Expand All @@ -41,14 +41,14 @@ spec:
sourceNamespace: openshift-marketplace
EOF

echo "--> Deploying Grafana Operator to $PROM_NAMESPACE"
echo "--> Deploying Grafana Operator to $NAMESPACE"

cat << EOF | kubectl apply -f -
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
name: operatorhubio-catalog
namespace: ${PROM_NAMESPACE}
namespace: ${NAMESPACE}
spec:
sourceType: grpc
image: quay.io/operator-framework/upstream-community-operators:latest
Expand All @@ -59,23 +59,23 @@ apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: grafana-operator
namespace: ${PROM_NAMESPACE}
namespace: ${NAMESPACE}
spec:
channel: v4
name: grafana-operator
installPlanApproval: Automatic
source: operatorhubio-catalog
sourceNamespace: ${PROM_NAMESPACE}
sourceNamespace: ${NAMESPACE}
EOF

echo "--> Waiting for Prometheus Operator to be ready"

while ! kubectl -n $PROM_NAMESPACE get sa prometheus-operator 2> /dev/null > /dev/null; do
while ! kubectl -n $NAMESPACE get sa prometheus-operator 2> /dev/null > /dev/null; do
sleep 1
done

echo "--> Waiting for Grafana Operator to be ready"

while ! kubectl -n $PROM_NAMESPACE get crd grafanadashboards.integreatly.org 2> /dev/null > /dev/null; do
while ! kubectl -n $NAMESPACE get crd grafanadashboards.integreatly.org 2> /dev/null > /dev/null; do
sleep 1
done
87 changes: 0 additions & 87 deletions charts/rosa-federated-prometheus/templates/grafana/grafana.yaml

This file was deleted.

31 changes: 0 additions & 31 deletions charts/rosa-federated-prometheus/templates/grafana/rbac.yaml

This file was deleted.

29 changes: 0 additions & 29 deletions charts/rosa-federated-prometheus/templates/grafana/secret.yaml

This file was deleted.

8 changes: 3 additions & 5 deletions charts/rosa-federated-prometheus/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@ prometheus:
basicAuthPassword: "KgX1EUO3eQOBr1u9Df5B6XEhfxWGKaBKMhEa1ALQvu6"

grafana:
basicAuthUsername: "internal"
basicAuthUsername: "admin"
# Change these two fields
sessionSecret: "112RXXaWl7wUQiSdXUMrUya7kN5gOZmHc0s202bKqAw"
basicAuthPassword: "KgX1EUO3eQOBr1u9Df5B6XEhfxWGKaBKMhEa1ALQvu6"
operator:
createSubscription: true
creteCatalogSource: true
basicAuthPassword: "password"


# Update this to suit your slack, or other notification methods
alertManager:
Expand Down

0 comments on commit 9f5a867

Please sign in to comment.