Skip to content

Commit

Permalink
Add cloud.id support to Kubernetes manifests (elastic#5487)
Browse files Browse the repository at this point in the history
* Add `cloud.id` support to Kubernetes manifests

* Always make update *-kubernetes.yaml files
  • Loading branch information
exekias authored and tsg committed Nov 3, 2017
1 parent 33270f1 commit f122937
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 9 deletions.
16 changes: 9 additions & 7 deletions deploy/kubernetes/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
ALL=filebeat metricbeat
BEAT_VERSION=$(shell head -n 1 ../../libbeat/docs/version.asciidoc | cut -c 17- )

all: ${ALL:=-kubernetes.yaml}
.PHONY: all $(ALL)

all: $(ALL)

test: all
for FILE in $(shell ls *-kubernetes.yaml); do \
Expand All @@ -12,10 +14,10 @@ test: all
clean:
@for f in $(ALL); do rm -f "$$f-kubernetes.yaml"; done

%-kubernetes.yaml: %/*.yaml
@echo "Generating $*-kubernetes.yaml"
@rm -f $*-kubernetes.yaml
@for f in $(shell ls $*/*.yaml); do \
sed "s/%VERSION%/${BEAT_VERSION}/g" $$f >> $*-kubernetes.yaml; \
echo --- >> $*-kubernetes.yaml; \
$(ALL):
@echo "Generating $@-kubernetes.yaml"
@rm -f $@-kubernetes.yaml
@for f in $(shell ls $@/*.yaml); do \
sed "s/%VERSION%/${BEAT_VERSION}/g" $$f >> $@-kubernetes.yaml; \
echo --- >> $@-kubernetes.yaml; \
done
7 changes: 7 additions & 0 deletions deploy/kubernetes/filebeat-kubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ data:
processors:
- add_cloud_metadata:
cloud.id: ${ELASTIC_CLOUD_ID}
cloud.auth: ${ELASTIC_CLOUD_AUTH}
output.elasticsearch:
hosts: ['${ELASTICSEARCH_HOST:elasticsearch}:${ELASTICSEARCH_PORT:9200}']
username: ${ELASTICSEARCH_USERNAME}
Expand Down Expand Up @@ -81,6 +84,10 @@ spec:
value: elastic
- name: ELASTICSEARCH_PASSWORD
value: changeme
- name: ELASTIC_CLOUD_ID
value:
- name: ELASTIC_CLOUD_AUTH
value:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
Expand Down
3 changes: 3 additions & 0 deletions deploy/kubernetes/filebeat/filebeat-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ data:
processors:
- add_cloud_metadata:
cloud.id: ${ELASTIC_CLOUD_ID}
cloud.auth: ${ELASTIC_CLOUD_AUTH}
output.elasticsearch:
hosts: ['${ELASTICSEARCH_HOST:elasticsearch}:${ELASTICSEARCH_PORT:9200}']
username: ${ELASTICSEARCH_USERNAME}
Expand Down
4 changes: 4 additions & 0 deletions deploy/kubernetes/filebeat/filebeat-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ spec:
value: elastic
- name: ELASTICSEARCH_PASSWORD
value: changeme
- name: ELASTIC_CLOUD_ID
value:
- name: ELASTIC_CLOUD_AUTH
value:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
Expand Down
11 changes: 11 additions & 0 deletions deploy/kubernetes/metricbeat-kubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ data:
processors:
- add_cloud_metadata:
cloud.id: ${ELASTIC_CLOUD_ID}
cloud.auth: ${ELASTIC_CLOUD_AUTH}
output.elasticsearch:
hosts: ['${ELASTICSEARCH_HOST:elasticsearch}:${ELASTICSEARCH_PORT:9200}']
username: ${ELASTICSEARCH_USERNAME}
Expand Down Expand Up @@ -105,6 +108,10 @@ spec:
value: elastic
- name: ELASTICSEARCH_PASSWORD
value: changeme
- name: ELASTIC_CLOUD_ID
value:
- name: ELASTIC_CLOUD_AUTH
value:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
Expand Down Expand Up @@ -209,6 +216,10 @@ spec:
value: elastic
- name: ELASTICSEARCH_PASSWORD
value: changeme
- name: ELASTIC_CLOUD_ID
value:
- name: ELASTIC_CLOUD_AUTH
value:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ data:
processors:
- add_cloud_metadata:
cloud.id: ${ELASTIC_CLOUD_ID}
cloud.auth: ${ELASTIC_CLOUD_AUTH}
output.elasticsearch:
hosts: ['${ELASTICSEARCH_HOST:elasticsearch}:${ELASTICSEARCH_PORT:9200}']
username: ${ELASTICSEARCH_USERNAME}
Expand Down
4 changes: 4 additions & 0 deletions deploy/kubernetes/metricbeat/metricbeat-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ spec:
value: elastic
- name: ELASTICSEARCH_PASSWORD
value: changeme
- name: ELASTIC_CLOUD_ID
value:
- name: ELASTIC_CLOUD_AUTH
value:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
Expand Down
4 changes: 4 additions & 0 deletions deploy/kubernetes/metricbeat/metricbeat-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ spec:
value: elastic
- name: ELASTICSEARCH_PASSWORD
value: changeme
- name: ELASTIC_CLOUD_ID
value:
- name: ELASTIC_CLOUD_AUTH
value:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
Expand Down
2 changes: 1 addition & 1 deletion filebeat/docs/running-on-kubernetes.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ To deploy Filebeat to Kubernetes just run:

["source", "sh", subs="attributes"]
------------------------------------------------
kubectl deploy -f kubernetes/filebeat-kubernetes.yaml
kubectl deploy -f filebeat-kubernetes.yaml
------------------------------------------------

Then you should be able to check the status by running:
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/docs/running-on-kubernetes.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ To deploy Metricbeat to Kubernetes just run:

["source", "sh", subs="attributes"]
------------------------------------------------
kubectl deploy -f kubernetes/metricbeat-kubernetes.yaml
kubectl deploy -f metricbeat-kubernetes.yaml
------------------------------------------------

Then you should be able to check the status by running:
Expand Down

0 comments on commit f122937

Please sign in to comment.