add pgw
This commit is contained in:
parent
dcbcd53068
commit
991cf57c4f
6 changed files with 84 additions and 27 deletions
src
main
cljc/dda/c4k_common
resources/monitoring
test/cljc/dda/c4k_common
|
@ -20,29 +20,6 @@
|
|||
|
||||
(def filter-regex-string int/filter-regex-string)
|
||||
|
||||
|
||||
(defn-spec ^{:deprecated "6.4.1"} generate seq?
|
||||
"use generate-config and generate-auth instead"
|
||||
[config ::mon-cfg
|
||||
auth ::mon-auth]
|
||||
[(yaml/load-as-edn "monitoring/namespace.yaml")
|
||||
(yaml/load-as-edn "monitoring/prometheus-cluster-role.yaml")
|
||||
(yaml/load-as-edn "monitoring/prometheus-cluster-role-binding.yaml")
|
||||
(yaml/load-as-edn "monitoring/prometheus-service.yaml")
|
||||
(yaml/load-as-edn "monitoring/prometheus-service-account.yaml")
|
||||
(int/generate-config-secret config auth)
|
||||
(yaml/load-as-edn "monitoring/prometheus-deployment.yaml")
|
||||
(yaml/load-as-edn "monitoring/node-exporter-service-account.yaml")
|
||||
(yaml/load-as-edn "monitoring/node-exporter-cluster-role.yaml")
|
||||
(yaml/load-as-edn "monitoring/node-exporter-cluster-role-binding.yaml")
|
||||
(yaml/load-as-edn "monitoring/node-exporter-daemon-set.yaml")
|
||||
(yaml/load-as-edn "monitoring/node-exporter-service.yaml")
|
||||
(yaml/load-as-edn "monitoring/kube-state-metrics-cluster-role-binding.yaml")
|
||||
(yaml/load-as-edn "monitoring/kube-state-metrics-cluster-role.yaml")
|
||||
(yaml/load-as-edn "monitoring/kube-state-metrics-deployment.yaml")
|
||||
(yaml/load-as-edn "monitoring/kube-state-metrics-service-account.yaml")
|
||||
(yaml/load-as-edn "monitoring/kube-state-metrics-service.yaml")])
|
||||
|
||||
(defn-spec generate-config seq?
|
||||
[]
|
||||
[(yaml/load-as-edn "monitoring/namespace.yaml")
|
||||
|
@ -60,7 +37,10 @@
|
|||
(yaml/load-as-edn "monitoring/kube-state-metrics-cluster-role.yaml")
|
||||
(yaml/load-as-edn "monitoring/kube-state-metrics-deployment.yaml")
|
||||
(yaml/load-as-edn "monitoring/kube-state-metrics-service-account.yaml")
|
||||
(yaml/load-as-edn "monitoring/kube-state-metrics-service.yaml")])
|
||||
(yaml/load-as-edn "monitoring/kube-state-metrics-service.yaml")
|
||||
(yaml/load-as-edn "monitoring/push-gw-deployment.yaml")
|
||||
(yaml/load-as-edn "monitoring/push-gw-service-account.yaml")
|
||||
(yaml/load-as-edn "monitoring/push-gw-service.yaml")])
|
||||
|
||||
(defn-spec generate-auth seq?
|
||||
[config ::mon-cfg
|
||||
|
|
|
@ -31,6 +31,9 @@
|
|||
"monitoring/prometheus-prometheus.yaml" (rc/inline "monitoring/prometheus-prometheus.yaml")
|
||||
"monitoring/prometheus-service-account.yaml" (rc/inline "monitoring/prometheus-service-account.yaml")
|
||||
"monitoring/prometheus-service.yaml" (rc/inline "monitoring/prometheus-service.yaml")
|
||||
"monitoring/push-gw-deployment.yaml" (rc/inline "monitoring/push-gw-deployment.yaml")
|
||||
"monitoring/push-gw-service-account.yaml" (rc/inline "monitoring/push-gw-service-account.yaml")
|
||||
"monitoring/push-gw-service.yaml" (rc/inline "monitoring/push-gw-service.yaml")
|
||||
(throw (js/Error. (str "Undefined Resource: " resource-name))))))
|
||||
|
||||
|
||||
|
|
52
src/main/resources/monitoring/push-gw-deployment.yaml
Normal file
52
src/main/resources/monitoring/push-gw-deployment.yaml
Normal file
|
@ -0,0 +1,52 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: prometheus-pushgateway
|
||||
name: prometheus-pushgateway
|
||||
namespace: monitoring
|
||||
spec:
|
||||
replicas: 1
|
||||
strategy:
|
||||
type: Recreate
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: prometheus-pushgateway
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: prometheus-pushgateway
|
||||
spec:
|
||||
serviceAccountName: prometheus-pushgateway
|
||||
automountServiceAccountToken: true
|
||||
containers:
|
||||
- name: pushgateway
|
||||
image: "quay.io/prometheus/pushgateway:v1.11.0"
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- name: metrics
|
||||
containerPort: 9091
|
||||
protocol: TCP
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /-/healthy
|
||||
port: 9091
|
||||
initialDelaySeconds: 10
|
||||
timeoutSeconds: 10
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /-/ready
|
||||
port: 9091
|
||||
initialDelaySeconds: 10
|
||||
timeoutSeconds: 10
|
||||
volumeMounts:
|
||||
- name: storage-volume
|
||||
mountPath: "/data"
|
||||
subPath: ""
|
||||
securityContext:
|
||||
fsGroup: 65534
|
||||
runAsNonRoot: true
|
||||
runAsUser: 65534
|
||||
volumes:
|
||||
- name: storage-volume
|
||||
emptyDir: {}
|
|
@ -0,0 +1,8 @@
|
|||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: prometheus-pushgateway
|
||||
name: x-prometheus-pushgateway
|
||||
namespace: monitoring
|
||||
automountServiceAccountToken: true
|
16
src/main/resources/monitoring/push-gw-service.yaml
Normal file
16
src/main/resources/monitoring/push-gw-service.yaml
Normal file
|
@ -0,0 +1,16 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: prometheus-pushgateway
|
||||
name: prometheus-pushgateway
|
||||
namespace: monitoring
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 9091
|
||||
targetPort: 9091
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
app.kubernetes.io/name: prometheus-pushgateway
|
|
@ -19,9 +19,7 @@
|
|||
|
||||
|
||||
(deftest should-generate
|
||||
(is (= 17
|
||||
(count (cut/generate conf auth))))
|
||||
(is (= 16
|
||||
(is (= 19
|
||||
(count (cut/generate-config))))
|
||||
(is (= 1
|
||||
(count (cut/generate-auth conf auth)))))
|
||||
|
|
Loading…
Reference in a new issue