-
Notifications
You must be signed in to change notification settings - Fork 0
/
trickster-aio.template.yaml
156 lines (151 loc) · 4.83 KB
/
trickster-aio.template.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
apiVersion: v1
kind: Template
metadata:
name: trickster
objects:
- apiVersion: v1
kind: DeploymentConfig
metadata:
labels:
app: trickster
name: trickster
spec:
replicas: ${{REPLICAS}}
selector:
app: trickster
strategy:
resources:
requests:
cpu: 20m
memory: 1Gi
rollingParams:
intervalSeconds: 1
maxSurge: 25%
maxUnavailable: 25%
timeoutSeconds: 600
updatePeriodSeconds: 1
type: Rolling
triggers:
- type: ConfigChange
template:
metadata:
labels:
app: trickster
name: trickster
spec:
containers:
- name: trickster
image: tricksterio/trickster:${TRICKSTER_IMAGE_TAG}
imagePullPolicy: IfNotPresent
volumeMounts:
- name: cfg-volume
mountPath: /etc/trickster
env:
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
volumes:
- name: cfg-volume
configMap:
name: trickster-conf
items:
- key: trickster-conf
path: trickster.conf
- apiVersion: route.openshift.io/v1
kind: Route
metadata:
annotations:
openshift.io/host.generated: "true"
name: trickster
spec:
port:
targetPort: proxy
tls:
termination: edge
to:
kind: Service
name: trickster
weight: 100
wildcardPolicy: None
- apiVersion: v1
kind: ConfigMap
metadata:
name: trickster-conf
labels:
app: trickster-conf
data:
trickster-conf: |-
[main]
# instance_id allows you to run multiple trickster processes on the same host and log to separate files
# Useful for baremetal, not so much for elastic deployments, so only uncomment if you really need it
#instance_id = 1
# Configuration options for the Proxy Server
[proxy_server]
# listen_port defines the port on which Trickster's Proxy server listens.
# since this is a proxy for Prometheus, we use 9090 by default, just like Prometheus does
listen_port = 9090
[cache]
# cache_type defines what kind of cache Trickster uses
# options are 'boltdb, 'filesystem', 'memory', and 'redis'. 'memory' is the default
cache_type = 'memory'
# record_ttl_secs defines the relative expiration of cached queries. default is 6 hours (21600 seconds)
record_ttl_secs = 21600
# Configuration options when using a Redis Cache
# [cache.redis]
# protocol defines the protocol for connecting to redis ('unix' or 'tcp') 'tcp' is default
# protocol = 'tcp'
# endpoint defines the fqdn+port or path to a unix socket file for connecting to redis
# default is 'redis:6379'
# endpoint = 'trickster-redis.${namespace}.svc.cluster.local:6379'
# Configuration options for mapping Origin(s)
[origins]
# The default origin
[origins.default]
# origin_url defines the URL of the origin. Default is http://prometheus:9090
origin_url = '${PROMETHEUS_SVC_URL}'
# api path defines the path of the Prometheus API (usually '/api/v1')
api_path = '/api/v1'
# default_step defines the step (in seconds) of a query_range request if one is
# not provided by the client. This helps to correct improperly formed client requests.
default_step = 300
# max_value_age_secs defines the maximum age of specific datapoints in seconds. Default is 86400 (24 hours)
max_value_age_secs = 86400
# Configuration Options for Metrics Instrumentation
[metrics]
# listen_port defines the port that Trickster's metrics server listens on at /metrics
listen_port = 8082
# Configuration Options for Logging Instrumentation
[logging]
# log_level defines the verbosity of the logger. Possible values are 'debug', 'info', 'warn', 'error'
# default is info
log_level = 'info'
- apiVersion: v1
kind: Service
metadata:
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "8082"
prometheus.io/path: "/metrics"
name: trickster
spec:
ports:
- port: 9090
targetPort: 9090
name: proxy
- port: 8082
targetPort: 8082
name: metrics
selector:
app: trickster
parameters:
- name: IMAGE_TAG
value: dummy # needed because saasherder will fail if this parameter doesn't exist
- name: TRICKSTER_IMAGE_TAG
value: "latest"
- name: REPLICAS
value: "3"
- name: PROMETHEUS_SVC_URL
value: ""
- name: NAMESPACE
value: example