Load-test rig: k6 swarm script + in-cluster target drone
This commit is contained in:
65
manifests/monitoring/grafana.yaml
Normal file
65
manifests/monitoring/grafana.yaml
Normal file
@@ -0,0 +1,65 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: grafana-datasources
|
||||
namespace: monitoring
|
||||
data:
|
||||
datasources.yaml: |
|
||||
apiVersion: 1
|
||||
datasources:
|
||||
- name: Prometheus
|
||||
type: prometheus
|
||||
access: proxy
|
||||
url: http://prometheus.monitoring.svc:9090
|
||||
isDefault: true
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: grafana-admin
|
||||
namespace: monitoring
|
||||
stringData:
|
||||
admin-user: adamcarr
|
||||
admin-password: planck-lab-admin
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: grafana
|
||||
namespace: monitoring
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels: {app: grafana}
|
||||
template:
|
||||
metadata:
|
||||
labels: {app: grafana}
|
||||
spec:
|
||||
containers:
|
||||
- name: grafana
|
||||
image: grafana/grafana:12.0.2
|
||||
env:
|
||||
- {name: GF_SECURITY_ADMIN_USER, valueFrom: {secretKeyRef: {name: grafana-admin, key: admin-user}}}
|
||||
- {name: GF_SECURITY_ADMIN_PASSWORD, valueFrom: {secretKeyRef: {name: grafana-admin, key: admin-password}}}
|
||||
- {name: GF_AUTH_ANONYMOUS_ENABLED, value: "true"}
|
||||
ports:
|
||||
- containerPort: 3000
|
||||
resources:
|
||||
requests: {cpu: 50m, memory: 128Mi}
|
||||
limits: {memory: 512Mi}
|
||||
volumeMounts:
|
||||
- {name: datasources, mountPath: /etc/grafana/provisioning/datasources}
|
||||
volumes:
|
||||
- name: datasources
|
||||
configMap: {name: grafana-datasources}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: grafana
|
||||
namespace: monitoring
|
||||
spec:
|
||||
selector: {app: grafana}
|
||||
ports:
|
||||
- port: 3000
|
||||
targetPort: 3000
|
||||
41
manifests/monitoring/node-exporter.yaml
Normal file
41
manifests/monitoring/node-exporter.yaml
Normal file
@@ -0,0 +1,41 @@
|
||||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
name: node-exporter
|
||||
namespace: monitoring
|
||||
labels: {app: node-exporter}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels: {app: node-exporter}
|
||||
template:
|
||||
metadata:
|
||||
labels: {app: node-exporter}
|
||||
spec:
|
||||
hostNetwork: true
|
||||
hostPID: true
|
||||
tolerations:
|
||||
- operator: Exists
|
||||
containers:
|
||||
- name: node-exporter
|
||||
image: quay.io/prometheus/node-exporter:v1.9.1
|
||||
args:
|
||||
- --path.procfs=/host/proc
|
||||
- --path.sysfs=/host/sys
|
||||
- --collector.filesystem.mount-points-exclude=^/(dev|proc|sys|var/lib/docker/.+|var/lib/kubelet/.+)($|/)
|
||||
ports:
|
||||
- containerPort: 9100
|
||||
hostPort: 9100
|
||||
resources:
|
||||
requests: {cpu: 20m, memory: 32Mi}
|
||||
limits: {memory: 64Mi}
|
||||
volumeMounts:
|
||||
- {name: proc, mountPath: /host/proc, readOnly: true}
|
||||
- {name: sys, mountPath: /host/sys, readOnly: true}
|
||||
- {name: root, mountPath: /rootfs, readOnly: true}
|
||||
volumes:
|
||||
- name: proc
|
||||
hostPath: {path: /proc}
|
||||
- name: sys
|
||||
hostPath: {path: /sys}
|
||||
- name: root
|
||||
hostPath: {path: /}
|
||||
115
manifests/monitoring/prometheus.yaml
Normal file
115
manifests/monitoring/prometheus.yaml
Normal file
@@ -0,0 +1,115 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: monitoring
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: prometheus
|
||||
namespace: monitoring
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: prometheus
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources: [nodes, nodes/proxy, services, endpoints, pods]
|
||||
verbs: [get, list, watch]
|
||||
- apiGroups: ["extensions", "networking.k8s.io"]
|
||||
resources: [ingresses]
|
||||
verbs: [get, list, watch]
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: prometheus
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: prometheus
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: prometheus
|
||||
namespace: monitoring
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: prometheus-config
|
||||
namespace: monitoring
|
||||
data:
|
||||
prometheus.yml: |
|
||||
global:
|
||||
scrape_interval: 15s
|
||||
external_labels:
|
||||
cluster: planck
|
||||
scrape_configs:
|
||||
- job_name: prometheus
|
||||
static_configs:
|
||||
- targets: ["localhost:9090"]
|
||||
- job_name: node-exporter
|
||||
kubernetes_sd_configs:
|
||||
- role: node
|
||||
relabel_configs:
|
||||
- source_labels: [__meta_kubernetes_node_address_InternalIP]
|
||||
target_label: instance_ip
|
||||
- action: labelmap
|
||||
regex: __meta_kubernetes_node_label_(.+)
|
||||
metric_relabel_configs:
|
||||
- source_labels: [__name__]
|
||||
regex: go_.*
|
||||
action: drop
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: prometheus
|
||||
namespace: monitoring
|
||||
spec:
|
||||
serviceName: prometheus
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels: {app: prometheus}
|
||||
template:
|
||||
metadata:
|
||||
labels: {app: prometheus}
|
||||
spec:
|
||||
serviceAccountName: prometheus
|
||||
containers:
|
||||
- name: prometheus
|
||||
image: prom/prometheus:v3.6.0
|
||||
args:
|
||||
- --config.file=/etc/prometheus/prometheus.yml
|
||||
- --storage.tsdb.retention.time=15d
|
||||
- --storage.tsdb.path=/data
|
||||
ports:
|
||||
- containerPort: 9090
|
||||
resources:
|
||||
requests: {cpu: 150m, memory: 512Mi}
|
||||
limits: {memory: 1Gi}
|
||||
volumeMounts:
|
||||
- {name: config, mountPath: /etc/prometheus}
|
||||
- {name: data, mountPath: /data}
|
||||
volumes:
|
||||
- name: config
|
||||
configMap: {name: prometheus-config}
|
||||
volumeClaimTemplates:
|
||||
- metadata: {name: data}
|
||||
spec:
|
||||
accessModes: [ReadWriteOnce]
|
||||
storageClassName: local-path
|
||||
resources:
|
||||
requests: {storage: 20Gi}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: prometheus
|
||||
namespace: monitoring
|
||||
spec:
|
||||
selector: {app: prometheus}
|
||||
ports:
|
||||
- port: 9090
|
||||
targetPort: 9090
|
||||
Reference in New Issue
Block a user