diff --git a/service/files/curator.yaml.j2 b/service/files/curator.yaml.j2 index ac234c1..fe19e51 100644 --- a/service/files/curator.yaml.j2 +++ b/service/files/curator.yaml.j2 @@ -4,7 +4,7 @@ client: hosts: - localhost - port: {{ elasticsearch.port }} + port: {{ elasticsearch.port.cont }} url_prefix: use_ssl: False certificate: diff --git a/service/files/defaults.yaml b/service/files/defaults.yaml index 4d4c2e4..a06409a 100644 --- a/service/files/defaults.yaml +++ b/service/files/defaults.yaml @@ -1,24 +1,30 @@ configs: elasticsearch: - port: 9200 - cluster_port: 9300 + port: + cont: 9200 + cluster_port: + cont: 9300 retention_period: 30 kibana: - port: 5601 + port: + cont: 5601 heka: max_procs: 2 service_pattern: "^k8s_(.-)%..*" - hindsight_heka_tcp_port: 5565 + hindsight_heka_tcp_port: + cont: 5565 grafana: host: "grafana" - port: 3000 + port: + cont: 3000 user: "admin" password: "admin" influxdb: database: "ccp" host: "influxdb" password: "" - port: 8086 + port: + cont: 8086 user: "" snap: log_level: 3 diff --git a/service/files/grafana-configure.sh.j2 b/service/files/grafana-configure.sh.j2 index 9e04b65..48ea254 100755 --- a/service/files/grafana-configure.sh.j2 +++ b/service/files/grafana-configure.sh.j2 @@ -1,20 +1,20 @@ #!/bin/bash echo "Waiting for Grafana to come up..." -until $(curl --fail --output /dev/null --silent http://{{ grafana.user }}:{{ grafana.password }}@localhost:{{ grafana.port }}/api/org); do +until $(curl --fail --output /dev/null --silent http://{{ grafana.user }}:{{ grafana.password }}@localhost:{{ grafana.port.cont }}/api/org); do printf "." sleep 2 done echo -e "Grafana is up and running.\n" echo "Creating InfluxDB datasource..." -curl -i -XPOST -H "Accept: application/json" -H "Content-Type: application/json" "http://{{ grafana.user }}:{{ grafana.password }}@localhost:{{ grafana.port }}/api/datasources" -d ' +curl -i -XPOST -H "Accept: application/json" -H "Content-Type: application/json" "http://{{ grafana.user }}:{{ grafana.password }}@localhost:{{ grafana.port.cont }}/api/datasources" -d ' { "name": "CCP InfluxDB", "type": "influxdb", "access": "proxy", "isDefault": true, - "url": "'"http://{{ influxdb.host }}:{{ influxdb.port }}"'", + "url": "'"http://{{ influxdb.host }}:{{ influxdb.port.cont }}"'", "password": "'"{{ influxdb.password }}"'", "user": "'"{{ influxdb.user }}"'", "database": "'"{{ influxdb.database }}"'" @@ -28,7 +28,7 @@ echo -e "InfluxDB datasource was successfully created.\n" echo "Importing default dashboards..." for dashboard in /dashboards/*.json; do echo -e "\tImporting ${dashboard}..." - curl -i -XPOST --data "@${dashboard}" -H "Accept: application/json" -H "Content-Type: application/json" "http://{{ grafana.user }}:{{ grafana.password}}@localhost:{{ grafana.port }}/api/dashboards/db" + curl -i -XPOST --data "@${dashboard}" -H "Accept: application/json" -H "Content-Type: application/json" "http://{{ grafana.user }}:{{ grafana.password}}@localhost:{{ grafana.port.cont }}/api/dashboards/db" if [ $? -ne 0 ]; then echo "Error importing ${dashboard}" exit 1 diff --git a/service/files/heka-elasticsearch.toml.j2 b/service/files/heka-elasticsearch.toml.j2 index 4bb2469..2d3446d 100644 --- a/service/files/heka-elasticsearch.toml.j2 +++ b/service/files/heka-elasticsearch.toml.j2 @@ -6,7 +6,7 @@ fields = ["Timestamp", "Type", "Logger", "Severity", "Payload", "Pid", "Hostname [elasticsearch_output] type = "ElasticSearchOutput" -server = "http://elasticsearch:{{ elasticsearch.port }}" +server = "http://elasticsearch:{{ elasticsearch.port.cont }}" message_matcher = "Type == 'log'" encoder = "elasticsearch_json_encoder" use_buffering = true diff --git a/service/files/hindsight_heka_tcp.cfg.j2 b/service/files/hindsight_heka_tcp.cfg.j2 index e3d2007..c4bdf41 100644 --- a/service/files/hindsight_heka_tcp.cfg.j2 +++ b/service/files/hindsight_heka_tcp.cfg.j2 @@ -1,6 +1,6 @@ filename = "heka_tcp.lua" address = "localhost" -port = {{ hindsight_heka_tcp_port }} +port = {{ hindsight_heka_tcp_port.cont }} -- the heka_tcp plugin is a "Continuous" plugin, so instruction_limit -- must be set to zero instruction_limit = 0 diff --git a/service/files/hindsight_influxdb_tcp.cfg.j2 b/service/files/hindsight_influxdb_tcp.cfg.j2 index 549fb81..5662295 100644 --- a/service/files/hindsight_influxdb_tcp.cfg.j2 +++ b/service/files/hindsight_influxdb_tcp.cfg.j2 @@ -1,6 +1,6 @@ filename = "influxdb_tcp.lua" host = "influxdb" -port = {{ influxdb.port }} +port = {{ influxdb.port.cont }} database = "{{ influxdb.database }}" batch_max_lines = 3000 message_matcher = "TRUE" diff --git a/service/files/influxdb.conf.j2 b/service/files/influxdb.conf.j2 index 1f70755..fe13e37 100644 --- a/service/files/influxdb.conf.j2 +++ b/service/files/influxdb.conf.j2 @@ -13,5 +13,5 @@ reporting-disabled = true [http] auth-enabled = false # FIXME(elemoine) - bind-address = "{{ network_topology["private"]["address"] }}:{{ influxdb.port }}" + bind-address = "{{ network_topology["private"]["address"] }}:{{ influxdb.port.cont }}" log-enabled = false diff --git a/service/files/kibana.yml.j2 b/service/files/kibana.yml.j2 index bfd4e26..19e5335 100644 --- a/service/files/kibana.yml.j2 +++ b/service/files/kibana.yml.j2 @@ -1,11 +1,11 @@ # Kibana is served by a back end server. This controls which port to use. -port: {{ kibana.port }} +port: {{ kibana.port.cont }} # The host to bind the server to. host: "{{ network_topology["private"]["address"] }}" # The Elasticsearch instance to use for all your queries. -elasticsearch_url: "http://elasticsearch:{{ elasticsearch.port }}" +elasticsearch_url: "http://elasticsearch:{{ elasticsearch.port.cont }}" # preserve_elasticsearch_host true will send the hostname specified in `elasticsearch`. If you set it to false, # then the host you use to connect to *this* Kibana instance will be sent. diff --git a/service/files/snap-task.json.j2 b/service/files/snap-task.json.j2 index 000af6e..4c666a3 100644 --- a/service/files/snap-task.json.j2 +++ b/service/files/snap-task.json.j2 @@ -100,7 +100,7 @@ "plugin_name": "heka", "config": { "host": "localhost", - "port": {{ hindsight_heka_tcp_port }} + "port": {{ hindsight_heka_tcp_port.cont }} } }] }