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

feat: Add a minimal prometheus server manifest #4687

Merged
merged 5 commits into from
Dec 16, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ LOG_LEVEL := debug
UPPERIO_DB_DEBUG := 0
NAMESPACED := true

ifeq ($(PROFILE),prometheus)
RUN_MODE := kubernetes
simster7 marked this conversation as resolved.
Show resolved Hide resolved
endif
alexec marked this conversation as resolved.
Show resolved Hide resolved

ALWAYS_OFFLOAD_NODE_STATUS := false
ifeq ($(PROFILE),mysql)
ALWAYS_OFFLOAD_NODE_STATUS := true
Expand Down Expand Up @@ -429,6 +433,9 @@ ifeq ($(RUN_MODE),kubernetes)
$(MAKE) controller-image cli-image
kubectl -n $(KUBE_NAMESPACE) scale deploy/workflow-controller --replicas 1
kubectl -n $(KUBE_NAMESPACE) scale deploy/argo-server --replicas 1
endif
ifeq ($(PROFILE),prometheus)
kubectl -n $(KUBE_NAMESPACE) scale deploy/prometheus --replicas 1
endif
kubectl -n $(KUBE_NAMESPACE) wait --for=condition=Ready pod --all -l app --timeout 2m
./hack/port-forward.sh
Expand All @@ -439,6 +446,9 @@ endif
grep '127.0.0.1[[:blank:]]*minio' /etc/hosts
grep '127.0.0.1[[:blank:]]*postgres' /etc/hosts
grep '127.0.0.1[[:blank:]]*mysql' /etc/hosts
ifeq ($(PROFILE),prometheus)
$(GOPATH)/bin/goreman -set-ports=false -logtime=false -f ./hack/procfiles/Procfile-prometheus start
endif
ifeq ($(RUN_MODE),local)
env SECURE=$(SECURE) ALWAYS_OFFLOAD_NODE_STATUS=$(ALWAYS_OFFLOAD_NODE_STATUS) LOG_LEVEL=$(LOG_LEVEL) UPPERIO_DB_DEBUG=$(UPPERIO_DB_DEBUG) VERSION=$(VERSION) AUTH_MODE=$(AUTH_MODE) NAMESPACED=$(NAMESPACED) NAMESPACE=$(KUBE_NAMESPACE) $(GOPATH)/bin/goreman -set-ports=false -logtime=false start
endif
Expand Down
1 change: 1 addition & 0 deletions hack/procfiles/Procfile-prometheus
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
port-forward: kubectl port-forward svc/prometheus 9091:9091
simster7 marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 2 additions & 1 deletion manifests/quick-start/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ resources:
- ../../namespace-install
- minio
- webhooks
- prometheus
- argo-server-sso-secret.yaml
- workflow-role.yaml
- workflow-default-rolebinding.yaml
Expand All @@ -13,4 +14,4 @@ resources:

patchesStrategicMerge:
- overlays/workflow-controller-configmap.yaml
- overlays/argo-server-deployment.yaml
- overlays/argo-server-deployment.yaml
5 changes: 5 additions & 0 deletions manifests/quick-start/base/prometheus/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- prometheus.yaml
37 changes: 37 additions & 0 deletions manifests/quick-start/base/prometheus/base/prometheus.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This manifests creates a minimal Prometheus server to scrape and display the metrics emitted by the workflow
simster7 marked this conversation as resolved.
Show resolved Hide resolved
# controller. To open this server, create an external IP for the prometheus service or use kubectl port-forward,
# then open:
#
# localhost:9091/graph
#
# Note: this assumes the workflow-controller is emitting metrics in the default port (9090). This will need to
# be modified if the default is overriden.
apiVersion: apps/v1
kind: Deployment
metadata:
name: prometheus
spec:
replicas: 1
selector:
matchLabels:
app: prometheus
template:
metadata:
labels:
app: prometheus
name: prometheus
spec:
containers:
- name: prometheus
image: prom/prometheus
args:
- --config.file=/config/prometheus.yaml
volumeMounts:
- name: config
mountPath: /config
volumes:
- name: config
configMap:
name: prometheus-config


Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../base
- prometheus-config-cluster.yaml
- prometheus-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: prometheus-config
data:
prometheus.yaml: |
global:
scrape_interval: 15s
scrape_configs:
- job_name: 'argo'
static_configs:
- targets: ['workflow-controller-metrics:9090']
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
labels:
name: prometheus
name: prometheus
spec:
ports:
- name: prometheus
port: 9091
protocol: TCP
targetPort: 9090
selector:
app: prometheus
5 changes: 5 additions & 0 deletions manifests/quick-start/base/prometheus/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
simster7 marked this conversation as resolved.
Show resolved Hide resolved
- ./cluster
1 change: 1 addition & 0 deletions test/e2e/manifests/minimal/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ patchesStrategicMerge:
- ../mixins/workflow-controller-configmap.yaml
- ../mixins/workflow-controller-deployment.yaml
- ../mixins/cluster-workflow-template-rbac.yaml
- ../mixins/prometheus-deployment.yaml

commonLabels:
"app.kubernetes.io/part-of": "argo"
6 changes: 6 additions & 0 deletions test/e2e/manifests/mixins/prometheus-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: prometheus
spec:
replicas: 0
simster7 marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions test/e2e/manifests/mysql/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ patchesStrategicMerge:
- ../mixins/workflow-controller-configmap.yaml
- ../mixins/workflow-controller-deployment.yaml
- ../mixins/cluster-workflow-template-rbac.yaml
- ../mixins/prometheus-deployment.yaml

commonLabels:
"app.kubernetes.io/part-of": "argo"
1 change: 1 addition & 0 deletions test/e2e/manifests/postgres/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ patchesStrategicMerge:
- ../mixins/workflow-controller-configmap.yaml
- ../mixins/workflow-controller-deployment.yaml
- ../mixins/cluster-workflow-template-rbac.yaml
- ../mixins/prometheus-deployment.yaml

commonLabels:
"app.kubernetes.io/part-of": "argo"
15 changes: 15 additions & 0 deletions test/e2e/manifests/prometheus/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../../../../manifests/quick-start/minimal

patchesStrategicMerge:
- ../mixins/argo-server-deployment.yaml
- ../mixins/workflow-controller-configmap.yaml
- ../mixins/workflow-controller-deployment.yaml
- ../mixins/cluster-workflow-template-rbac.yaml
- ../mixins/prometheus-deployment.yaml

commonLabels:
"app.kubernetes.io/part-of": "argo"
1 change: 1 addition & 0 deletions test/e2e/manifests/sso/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ patchesStrategicMerge:
- ../mixins/workflow-controller-configmap.yaml
- ../mixins/workflow-controller-deployment.yaml
- ../mixins/cluster-workflow-template-rbac.yaml
- ../mixins/prometheus-deployment.yaml

commonLabels:
"app.kubernetes.io/part-of": "argo"