The current example-app setup in the kube-prometheus project is able to discover scraping targets in the default namespace. It is not able to discover the configured Alertmanager in the monitoring namespace. This patch adds an alertmanager-discovery rbac role, to permit the above described action. In addition it does the following cleanups: - Remove kubeconfig configuration in deploy and teardown script. kubectl chooses .kube/config whenever KUBECONFIG is not set by default - Remove namespace specification option via NAMESPACE env var. In most of the manifests the metadata/namespace was hardcoded anyways, in addition in the promtheus frontend role binding the service account namespace is hardcoded to default as well. - Instead of `kubectl {apply,delete}` individual manifests, the deploy and teardown shell scripts {apply,delete} on the entire folder.
37 lines
636 B
YAML
37 lines
636 B
YAML
kind: Service
|
|
apiVersion: v1
|
|
metadata:
|
|
name: example-app
|
|
labels:
|
|
tier: frontend
|
|
namespace: default
|
|
spec:
|
|
selector:
|
|
app: example-app
|
|
ports:
|
|
- name: web
|
|
protocol: TCP
|
|
port: 8080
|
|
targetPort: web
|
|
---
|
|
apiVersion: extensions/v1beta1
|
|
kind: Deployment
|
|
metadata:
|
|
name: example-app
|
|
namespace: default
|
|
spec:
|
|
replicas: 4
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: example-app
|
|
version: 1.1.3
|
|
spec:
|
|
containers:
|
|
- name: example-app
|
|
image: quay.io/fabxc/prometheus_demo_service
|
|
ports:
|
|
- name: web
|
|
containerPort: 8080
|
|
protocol: TCP
|