forked from thanos-io/thanos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Kube manifests for GCS-enabled setup + store. Added small tutor…
…ial. (thanos-io#61) * Added Kube manifests for GCS-enabled setup + store. Signed-off-by: Bartek Plotka <[email protected]> * Addressed issues. Signed-off-by: Bartek Plotka <[email protected]>
- Loading branch information
Showing
12 changed files
with
235 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,4 @@ LABEL maintainer="The Thanos Authors" | |
|
||
COPY thanos /bin/thanos | ||
|
||
USER nobody | ||
ENTRYPOINT [ "/bin/thanos" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
source ${DIR}/envs.sh | ||
|
||
cd ${DIR} | ||
|
||
echo "Starting Thanos service for gathering all thanos gossip peers." | ||
kubectl apply -f manifests/thanos | ||
|
||
echo "Starting Prometheus pod with sidecar." | ||
kubectl apply -f manifests/prometheus-gcs | ||
|
||
echo "Starting Thanos query pod targeting sidecar." | ||
kubectl apply -f manifests/thanos-query | ||
|
||
echo "Starting Thanos query pod targeting sidecar." | ||
kubectl apply -f manifests/thanos-store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
source ${DIR}/envs.sh | ||
|
||
cd ${DIR} | ||
kubectl delete -f manifests/thanos | ||
kubectl delete -f manifests/prometheus-gcs | ||
kubectl delete -f manifests/thanos-query | ||
kubectl delete -f manifests/thanos-store |
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
kube/manifests/local/config.yaml → kube/manifests/prometheus-gcs/config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: prometheus | ||
name: prometheus-gcs | ||
data: | ||
prometheus.yaml: | | ||
global: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: prometheus-gcs | ||
labels: | ||
app: prometheus-gcs | ||
thanos-peer: "true" | ||
spec: | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: prometheus-gcs | ||
thanos-peer: "true" | ||
spec: | ||
containers: | ||
- image: prom/prometheus:v2.0.0 | ||
args: [ | ||
"--config.file=/etc/prometheus/config/prometheus.yaml", | ||
"--storage.tsdb.path=/data", | ||
"--storage.tsdb.min-block-duration=2h", | ||
"--storage.tsdb.max-block-duration=2h", | ||
"--storage.tsdb.retention=12h" | ||
] | ||
name: prometheus | ||
resources: | ||
requests: | ||
cpu: 100m | ||
memory: 200Mi | ||
volumeMounts: | ||
- name: config-volume | ||
mountPath: /etc/prometheus/config | ||
- name: tsdb-data | ||
mountPath: /data | ||
# To use your own thanos image you need to do `eval $(minikube docker-env) && make docker` and place thanos/thanos:latest here. | ||
# TODO(bplotka): With vm-driver=none, even that is uses same docker, images are not recognized. Investigate. | ||
- image: bplotka/thanos:latest | ||
imagePullPolicy: Always | ||
env: | ||
- name: GOOGLE_APPLICATION_CREDENTIALS | ||
value: /creds/gcs-credentials.json | ||
args: [ | ||
"sidecar", | ||
"--log.level=debug", | ||
"--debug.name=sidecar", | ||
"--api-address=0.0.0.0:19090", # This address will be properly deduced and propagated via cluster.PeerState. | ||
"--metrics-address=0.0.0.0:19190", | ||
"--prometheus.url=http://localhost:9090", | ||
"--tsdb.path=/data", | ||
"--cluster.address=0.0.0.0:19390", | ||
"--cluster.peers=thanos.default.svc.cluster.local:19390", | ||
# This is required to be added in GCS prior startup of this. | ||
"--gcs.bucket=thanos-test" | ||
] | ||
name: thanos | ||
resources: | ||
requests: | ||
cpu: 100m | ||
memory: 50Mi | ||
volumeMounts: | ||
- name: tsdb-data | ||
mountPath: /data | ||
- name: gcs-credentials | ||
mountPath: /creds/ | ||
volumes: | ||
- name: config-volume | ||
configMap: | ||
name: prometheus-gcs | ||
- name: tsdb-data | ||
emptyDir: {} | ||
- name: gcs-credentials | ||
secret: | ||
defaultMode: 420 | ||
# gcs-credentials secret with single file gcs-credentials.json is required. | ||
secretName: gcs-credentials | ||
terminationGracePeriodSeconds: 300 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: prometheus-gcs | ||
name: prometheus-gcs | ||
spec: | ||
externalTrafficPolicy: Cluster | ||
ports: | ||
- port: 9090 | ||
protocol: TCP | ||
targetPort: 9090 | ||
name: http-prometheus | ||
- port: 19190 | ||
protocol: TCP | ||
targetPort: 19190 | ||
name: http-sidecar-metrics | ||
selector: | ||
app: prometheus-gcs | ||
sessionAffinity: None | ||
type: NodePort | ||
status: | ||
loadBalancer: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: thanos-store | ||
labels: | ||
app: thanos-store | ||
thanos-peer: "true" | ||
spec: | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: thanos-store | ||
thanos-peer: "true" | ||
spec: | ||
containers: | ||
# To use your own thanos image you need to do `eval $(minikube docker-env) && make docker` and place thanos/thanos:latest here. | ||
# TODO(bplotka): With vm-driver=none, even that is uses same docker, images are not recognized. Investigate. | ||
- image: bplotka/thanos:latest | ||
imagePullPolicy: Always | ||
env: | ||
- name: GOOGLE_APPLICATION_CREDENTIALS | ||
value: /creds/gcs-credentials.json | ||
args: [ | ||
"store", | ||
"--log.level=debug", | ||
"--debug.name=store", | ||
"--api-address=0.0.0.0:19090", # This address will be properly deduced and propagated via cluster.PeerState. | ||
"--metrics-address=0.0.0.0:19190", | ||
"--tsdb.path=/data", | ||
"--cluster.address=0.0.0.0:19390", | ||
"--cluster.peers=thanos.default.svc.cluster.local:19390", | ||
"--gcs.bucket=thanos-test" | ||
] | ||
name: thanos | ||
resources: | ||
requests: | ||
cpu: 200m | ||
memory: 200Mi | ||
volumeMounts: | ||
- mountPath: /creds/ | ||
name: gcs-credentials | ||
readOnly: true | ||
- name: tsdb-data | ||
mountPath: /data | ||
volumes: | ||
- name: gcs-credentials | ||
secret: | ||
defaultMode: 420 | ||
# gcs-credentials secret with single file gcs-credentials.json is required. | ||
secretName: gcs-credentials | ||
- name: tsdb-data | ||
emptyDir: {} | ||
terminationGracePeriodSeconds: 300 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters