Consul Template version
0.21.2
Configuration
pid_file = "/pid/consul-template"
log_level = "info"
kill_signal = "SIGTERM"
vault {
address = "http://127.0.0.1:8100"
vault_agent_token_file = "/vault/token"
ssl {
enabled = true
ca_cert = "/vault_ca/ca.pem"
}
}
template {
source = "/template/config.template.hcl"
destination = "/output/config.hcl"
create_dest_dirs = true
error_on_missing_key = true
command = "/bin/sh -c 'kill -1 $(cat /pid/app) || echo \"not running\"'"
}
template {
contents = <<EOF
{{- key "apps/xxx/cluster_config_hcl" -}}
EOF
destination = "/output/cluster_config_data.hcl"
create_dest_dirs = true
error_on_missing_key = true
command = "/bin/sh -c 'kill -1 $(cat /pid/app) || echo \"not running\"'"
}
Template is a bunch of reads from Consul KV and Vault KV V2
Debug output
The log is an endless sequence of re-rendering.
E 2019-09-04T07:37:08.073444678Z 2019/09/04 07:37:08.073314 [DEBUG] (runner) receiving dependency vault.read(kv/_app/sendgrid)
E 2019-09-04T07:37:08.073467285Z 2019/09/04 07:37:08.073330 [DEBUG] (runner) initiating run
E 2019-09-04T07:37:08.073473410Z 2019/09/04 07:37:08.073335 [DEBUG] (runner) checking template cd4eb212446d2146ac52730ec8822a70
E 2019-09-04T07:37:08.081545651Z 2019/09/04 07:37:08.081401 [DEBUG] (runner) rendering "/template/config.template.hcl" => "/output/config.hcl"
E 2019-09-04T07:37:08.081561990Z 2019/09/04 07:37:08.081479 [DEBUG] (runner) checking template 314c5ce0120813609a37cc38463f8eb5
E 2019-09-04T07:37:08.081871327Z 2019/09/04 07:37:08.081769 [DEBUG] (runner) rendering "(dynamic)" => "/output/cluster_config_data.hcl"
E 2019-09-04T07:37:08.081888057Z 2019/09/04 07:37:08.081848 [DEBUG] (runner) diffing and updating dependencies
E 2019-09-04T07:37:08.081894179Z 2019/09/04 07:37:08.081859 [DEBUG] (runner) kv.get(apps/vault/service_address) is still needed
E 2019-09-04T07:37:08.081912721Z 2019/09/04 07:37:08.081865 [DEBUG] (runner) kv.block(apps/database/set_role) is still needed
E 2019-09-04T07:37:08.081918556Z 2019/09/04 07:37:08.081870 [DEBUG] (runner) kv.get(apps/tracemalloc/enable) is still needed
E 2019-09-04T07:37:08.081924041Z 2019/09/04 07:37:08.081884 [DEBUG] (runner) vault.read(kv/_app/sendgrid) is still needed
E 2019-09-04T07:37:08.081930021Z 2019/09/04 07:37:08.081893 [DEBUG] (runner) kv.get(apps/monitor_image) is still needed
E 2019-09-04T07:37:08.081935552Z 2019/09/04 07:37:08.081897 [DEBUG] (runner) kv.get(apps/helm_chart_repo) is still needed
E 2019-09-04T07:37:08.081940577Z 2019/09/04 07:37:08.081901 [DEBUG] (runner) vault.read(kv/_app/internal_jwt/keys) is still needed
E 2019-09-04T07:37:08.081959030Z 2019/09/04 07:37:08.081906 [DEBUG] (runner) kv.block(apps/auth/audience) is still needed
E 2019-09-04T07:37:08.081964790Z 2019/09/04 07:37:08.081919 [DEBUG] (runner) kv.block(apps/database/uri) is still needed
E 2019-09-04T07:37:08.081970957Z 2019/09/04 07:37:08.081924 [DEBUG] (runner) kv.get(apps/sqlalchemy_track_modifications) is still needed
E 2019-09-04T07:37:08.081976535Z 2019/09/04 07:37:08.081928 [DEBUG] (runner) kv.get(apps/database/timeout) is still needed
E 2019-09-04T07:37:08.081982004Z 2019/09/04 07:37:08.081932 [DEBUG] (runner) kv.block(apps/vault/kv_path) is still needed
E 2019-09-04T07:37:08.082002534Z 2019/09/04 07:37:08.081944 [DEBUG] (runner) kv.block(apps/cors/origins) is still needed
E 2019-09-04T07:37:08.082008383Z 2019/09/04 07:37:08.081949 [DEBUG] (runner) kv.get(apps/deployment/helm_image) is still needed
E 2019-09-04T07:37:08.082027040Z 2019/09/04 07:37:08.081954 [DEBUG] (runner) kv.block(apps/auth/access_token_params) is still needed
E 2019-09-04T07:37:08.082033267Z 2019/09/04 07:37:08.081959 [DEBUG] (runner) kv.get(apps/mail/default_sender_address) is still needed
E 2019-09-04T07:37:08.082038331Z 2019/09/04 07:37:08.081971 [DEBUG] (runner) kv.block(apps/cluster_config_hcl) is still needed
E 2019-09-04T07:37:08.082043321Z 2019/09/04 07:37:08.081979 [DEBUG] (runner) kv.block(apps/database/vault_path) is still needed
E 2019-09-04T07:37:08.082048325Z 2019/09/04 07:37:08.081984 [DEBUG] (runner) kv.block(apps/span_domain) is still needed
E 2019-09-04T07:37:08.082052991Z 2019/09/04 07:37:08.081988 [DEBUG] (runner) vault.read(kv/_app/internal_jwt/whitelist) is still needed
E 2019-09-04T07:37:08.082057918Z 2019/09/04 07:37:08.081999 [DEBUG] (runner) kv.block(apps/vault/agent_address) is still needed
E 2019-09-04T07:37:08.082063255Z 2019/09/04 07:37:08.082008 [DEBUG] (runner) kv.block(apps/auth/realm) is still needed
E 2019-09-04T07:37:08.082068528Z 2019/09/04 07:37:08.082014 [DEBUG] (runner) kv.block(apps/auth/disable) is still needed
E 2019-09-04T07:37:08.082074069Z 2019/09/04 07:37:08.082019 [DEBUG] (runner) kv.block(apps/auth/issuer) is still needed
E 2019-09-04T07:37:08.082088916Z 2019/09/04 07:37:08.082023 [DEBUG] (runner) kv.block(apps/auth/algorithms) is still needed
E 2019-09-04T07:37:08.082094189Z 2019/09/04 07:37:08.082037 [DEBUG] (runner) vault.read(kv/_app/oidc) is still needed
E 2019-09-04T07:37:08.082099122Z 2019/09/04 07:37:08.082042 [DEBUG] (runner) kv.get(apps/mail/enable) is still needed
E 2019-09-04T07:37:08.082104300Z 2019/09/04 07:37:08.082047 [DEBUG] (runner) kv.block(apps/vault/app_base) is still needed
E 2019-09-04T07:37:08.082109580Z 2019/09/04 07:37:08.082051 [DEBUG] (runner) kv.block(apps/auth/client_id) is still needed
E 2019-09-04T07:37:08.082115112Z 2019/09/04 07:37:08.082061 [DEBUG] (runner) kv.get(apps/notification/enabled) is still needed
E 2019-09-04T07:37:08.082120843Z 2019/09/04 07:37:08.082065 [DEBUG] (runner) kv.get(apps/sentry/dsn) is still needed
E 2019-09-04T07:37:08.082126265Z 2019/09/04 07:37:08.082070 [DEBUG] (runner) kv.get(apps/jaeger/sampler/type) is still needed
E 2019-09-04T07:37:08.082131261Z 2019/09/04 07:37:08.082075 [DEBUG] (runner) kv.block(apps/database/database) is still needed
E 2019-09-04T07:37:08.082146697Z 2019/09/04 07:37:08.082086 [DEBUG] (runner) kv.get(apps/monitor_image_memory_limit) is still needed
E 2019-09-04T07:37:08.082158760Z 2019/09/04 07:37:08.082094 [DEBUG] (runner) kv.get(apps/deployment/deployment_job_cluster_namespace) is still needed
E 2019-09-04T07:37:08.082164512Z 2019/09/04 07:37:08.082099 [DEBUG] (runner) kv.get(apps/jaeger/sampler/param) is still needed
E 2019-09-04T07:37:08.082169734Z 2019/09/04 07:37:08.082104 [DEBUG] (runner) kv.get(apps/mail/sendgrid_credentials_vault_path) is still needed
E 2019-09-04T07:37:08.082175047Z 2019/09/04 07:37:08.082116 [DEBUG] (runner) watching 38 dependencies
E 2019-09-04T07:37:08.082180157Z 2019/09/04 07:37:08.082121 [DEBUG] (runner) all templates rendered
E 2019-09-04T07:37:08.082193225Z 2019/09/04 07:37:08.082132 [DEBUG] (runner) receiving dependency vault.read(kv/_app/oidc)
E 2019-09-04T07:37:08.082198239Z 2019/09/04 07:37:08.082148 [DEBUG] (runner) receiving dependency vault.read(kv/_app/internal_jwt/whitelist)
E 2019-09-04T07:37:08.082203331Z 2019/09/04 07:37:08.082165 [DEBUG] (runner) receiving dependency vault.read(kv/_app/internal_jwt/keys)
E 2019-09-04T07:37:08.082208922Z 2019/09/04 07:37:08.082170 [DEBUG] (runner) initiating run
E 2019-09-04T07:37:08.082214290Z 2019/09/04 07:37:08.082174 [DEBUG] (runner) checking template cd4eb212446d2146ac52730ec8822a70
E 2019-09-04T07:37:08.084507185Z 2019/09/04 07:37:08.084382 [DEBUG] (runner) rendering "/template/config.template.hcl" => "/output/config.hcl"
E 2019-09-04T07:37:08.084527964Z 2019/09/04 07:37:08.084445 [DEBUG] (runner) checking template 314c5ce0120813609a37cc38463f8eb5
E 2019-09-04T07:37:08.084780944Z 2019/09/04 07:37:08.084699 [DEBUG] (runner) rendering "(dynamic)" => "/output/cluster_config_data.hcl"
E 2019-09-04T07:37:08.084972402Z 2019/09/04 07:37:08.084914 [DEBUG] (runner) diffing and updating dependencies
E 2019-09-04T07:37:08.084984522Z 2019/09/04 07:37:08.084927 [DEBUG] (runner) kv.block(apps/database/database) is still needed
E 2019-09-04T07:37:08.085037171Z 2019/09/04 07:37:08.084931 [DEBUG] (runner) kv.get(apps/sqlalchemy_track_modifications) is still needed
E 2019-09-04T07:37:08.085042937Z 2019/09/04 07:37:08.084956 [DEBUG] (runner) kv.get(apps/vault/service_address) is still needed
E 2019-09-04T07:37:08.085046651Z 2019/09/04 07:37:08.084961 [DEBUG] (runner) kv.get(apps/sentry/dsn) is still needed
E 2019-09-04T07:37:08.085058274Z 2019/09/04 07:37:08.084965 [DEBUG] (runner) vault.read(kv/_app/sendgrid) is still needed
E 2019-09-04T07:37:08.085062228Z 2019/09/04 07:37:08.084969 [DEBUG] (runner) kv.block(apps/database/uri) is still needed
E 2019-09-04T07:37:08.085065720Z 2019/09/04 07:37:08.084973 [DEBUG] (runner) kv.get(apps/database/timeout) is still needed
E 2019-09-04T07:37:08.085069421Z 2019/09/04 07:37:08.084977 [DEBUG] (runner) vault.read(kv/_app/internal_jwt/keys) is still needed
E 2019-09-04T07:37:08.085085624Z 2019/09/04 07:37:08.084981 [DEBUG] (runner) kv.block(apps/cors/origins) is still needed
E 2019-09-04T07:37:08.085089411Z 2019/09/04 07:37:08.084985 [DEBUG] (runner) kv.block(apps/auth/client_id) is still needed
E 2019-09-04T07:37:08.085092981Z 2019/09/04 07:37:08.084989 [DEBUG] (runner) kv.block(apps/auth/realm) is still needed
E 2019-09-04T07:37:08.085096733Z 2019/09/04 07:37:08.084993 [DEBUG] (runner) kv.get(apps/mail/enable) is still needed
E 2019-09-04T07:37:08.085100465Z 2019/09/04 07:37:08.084997 [DEBUG] (runner) kv.block(apps/vault/app_base) is still needed
E 2019-09-04T07:37:08.085104058Z 2019/09/04 07:37:08.085001 [DEBUG] (runner) kv.get(apps/monitor_image) is still needed
E 2019-09-04T07:37:08.085107526Z 2019/09/04 07:37:08.085004 [DEBUG] (runner) vault.read(kv/_app/internal_jwt/whitelist) is still needed
E 2019-09-04T07:37:08.085110984Z 2019/09/04 07:37:08.085008 [DEBUG] (runner) kv.block(apps/vault/kv_path) is still needed
E 2019-09-04T07:37:08.085115677Z 2019/09/04 07:37:08.085012 [DEBUG] (runner) kv.block(apps/auth/audience) is still needed
E 2019-09-04T07:37:08.085169605Z 2019/09/04 07:37:08.085032 [DEBUG] (runner) vault.read(kv/_app/oidc) is still needed
E 2019-09-04T07:37:08.085175329Z 2019/09/04 07:37:08.085036 [DEBUG] (runner) kv.block(apps/span_domain) is still needed
E 2019-09-04T07:37:08.085178943Z 2019/09/04 07:37:08.085041 [DEBUG] (runner) kv.get(apps/deployment/helm_image) is still needed
E 2019-09-04T07:37:08.085182417Z 2019/09/04 07:37:08.085045 [DEBUG] (runner) kv.block(apps/auth/disable) is still needed
E 2019-09-04T07:37:08.085185912Z 2019/09/04 07:37:08.085049 [DEBUG] (runner) kv.block(apps/auth/access_token_params) is still needed
E 2019-09-04T07:37:08.085189392Z 2019/09/04 07:37:08.085052 [DEBUG] (runner) kv.block(apps/database/set_role) is still needed
E 2019-09-04T07:37:08.085192973Z 2019/09/04 07:37:08.085056 [DEBUG] (runner) kv.block(apps/auth/issuer) is still needed
E 2019-09-04T07:37:08.085196355Z 2019/09/04 07:37:08.085060 [DEBUG] (runner) kv.get(apps/tracemalloc/enable) is still needed
E 2019-09-04T07:37:08.085199926Z 2019/09/04 07:37:08.085064 [DEBUG] (runner) kv.get(apps/mail/default_sender_address) is still needed
E 2019-09-04T07:37:08.085203531Z 2019/09/04 07:37:08.085067 [DEBUG] (runner) kv.block(apps/vault/agent_address) is still needed
E 2019-09-04T07:37:08.085207186Z 2019/09/04 07:37:08.085071 [DEBUG] (runner) kv.block(apps/auth/algorithms) is still needed
E 2019-09-04T07:37:08.085210676Z 2019/09/04 07:37:08.085075 [DEBUG] (runner) kv.get(apps/notification/enabled) is still needed
E 2019-09-04T07:37:08.085214135Z 2019/09/04 07:37:08.085078 [DEBUG] (runner) kv.get(apps/jaeger/sampler/param) is still needed
E 2019-09-04T07:37:08.085221996Z 2019/09/04 07:37:08.085082 [DEBUG] (runner) kv.block(apps/cluster_config_hcl) is still needed
E 2019-09-04T07:37:08.085225724Z 2019/09/04 07:37:08.085085 [DEBUG] (runner) kv.get(apps/monitor_image_memory_limit) is still needed
E 2019-09-04T07:37:08.085229226Z 2019/09/04 07:37:08.085090 [DEBUG] (runner) kv.get(apps/deployment/deployment_job_cluster_namespace) is still needed
E 2019-09-04T07:37:08.085233105Z 2019/09/04 07:37:08.085094 [DEBUG] (runner) kv.block(apps/database/vault_path) is still needed
E 2019-09-04T07:37:08.085236798Z 2019/09/04 07:37:08.085112 [DEBUG] (runner) kv.get(apps/helm_chart_repo) is still needed
E 2019-09-04T07:37:08.085240446Z 2019/09/04 07:37:08.085116 [DEBUG] (runner) kv.get(apps/jaeger/sampler/type) is still needed
E 2019-09-04T07:37:08.085243953Z 2019/09/04 07:37:08.085119 [DEBUG] (runner) kv.get(apps/mail/sendgrid_credentials_vault_path) is still needed
E 2019-09-04T07:37:08.085247506Z 2019/09/04 07:37:08.085124 [DEBUG] (runner) watching 38 dependencies
E 2019-09-04T07:37:08.085250892Z 2019/09/04 07:37:08.085128 [DEBUG] (runner) all templates rendered
Reverting back to 0.21.0 seems to fix the issue. I guess this has something to do with the Vault KV V2 changes introduced since 0.21.1.
The metrics also show a constant usage of CPU cycles by Consul Template.
Consul Template version
0.21.2Configuration
Template is a bunch of reads from Consul KV and Vault KV V2
Debug output
The log is an endless sequence of re-rendering.
Reverting back to
0.21.0seems to fix the issue. I guess this has something to do with the Vault KV V2 changes introduced since 0.21.1.The metrics also show a constant usage of CPU cycles by Consul Template.