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

Requirements for Prometheus #136

Merged
merged 1 commit into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions config/prometheus/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Adds namespace to all resources.
namespace: nnf-dm-system

resources:
- monitor.yaml
1 change: 1 addition & 0 deletions config/prometheus/monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ kind: ServiceMonitor
metadata:
labels:
control-plane: controller-manager
prometheus-app: rabbit-nnf
name: controller-manager-metrics-monitor
namespace: system
spec:
Expand Down
12 changes: 12 additions & 0 deletions config/rbac/auth_proxy_client_clusterrole_binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: metrics-reader-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: metrics-reader
subjects:
- kind: ServiceAccount
name: controller-manager
namespace: system
1 change: 1 addition & 0 deletions config/rbac/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ resources:
- auth_proxy_role.yaml
- auth_proxy_role_binding.yaml
- auth_proxy_client_clusterrole.yaml
- auth_proxy_client_clusterrole_binding.yaml

configurations:
- kustomizeconfig.yaml
7 changes: 7 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,15 @@ deploy)
$KUSTOMIZE build $OVERLAY_DIR | kubectl apply -f -
break
done

# Deploy the ServiceMonitor resource if its CRD is found. The CRD would
# have been installed by a metrics service such as Prometheus.
if kubectl get crd servicemonitors.monitoring.coreos.com > /dev/null 2>&1; then
$KUSTOMIZE build config/prometheus | kubectl apply -f-
fi
;;
undeploy)
$KUSTOMIZE build config/prometheus | kubectl delete --ignore-not-found -f-
# When the DataMovementManager CRD gets deleted all related resource are also
# removed, so the delete will always fail. We ignore all errors at our
# own risk.
Expand Down