Skip to content

Commit

Permalink
Backport of update cloud preset to enable telemetry collector into re…
Browse files Browse the repository at this point in the history
…lease/1.1.x (#2215)

* backport of commit d474975

* backport of commit 10b48ef

* backport of commit 2555f00

---------

Co-authored-by: Nick Ethier <nethier@hashicorp.com>
  • Loading branch information
hc-github-team-consul-core and nickethier authored Jun 1, 2023
1 parent e96a86d commit ae6581c
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .changelog/2205.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
cli: update cloud preset to enable telemetry collector
```
2 changes: 1 addition & 1 deletion charts/consul/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ global:
# Configures the Helm chart’s components to forward envoy metrics for the Consul service mesh to the
# consul-telemetry-collector. This includes gateway metrics and sidecar metrics.
# @type: boolean
enableTelemetryCollector: true
enableTelemetryCollector: false

# The name (and tag) of the consul-dataplane Docker image used for the
# connect-injected sidecar proxies and mesh, terminating, and ingress gateways.
Expand Down
13 changes: 13 additions & 0 deletions cli/preset/cloud_preset.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ global:
bootstrapToken:
secretName: %s
secretKey: %s
metrics:
enableTelemetryCollector: true
cloud:
enabled: true
resourceId:
Expand All @@ -212,6 +214,15 @@ global:
%s
%s
%s
telemetryCollector:
enabled: true
cloud:
clientId:
secretName: %s
secretKey: %s
clientSecret:
secretName: %s
secretKey: %s
server:
replicas: %d
affinity: null
Expand All @@ -228,6 +239,8 @@ controller:
secretNameHCPClientID, secretKeyHCPClientID,
secretNameHCPClientSecret, secretKeyHCPClientSecret,
apiHostCfg, authURLCfg, scadaAddressCfg,
secretNameHCPClientID, secretKeyHCPClientID,
secretNameHCPClientSecret, secretKeyHCPClientSecret,
cfg.BootstrapResponse.Cluster.BootstrapExpect, secretNameServerCert)
valuesMap := config.ConvertToMap(values)
return valuesMap
Expand Down
22 changes: 22 additions & 0 deletions cli/preset/cloud_preset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,8 @@ global:
gossipEncryption:
secretKey: key
secretName: consul-gossip-key
metrics:
enableTelemetryCollector: true
tls:
caCert:
secretKey: tls.crt
Expand All @@ -491,6 +493,15 @@ server:
replicas: 3
serverCert:
secretName: consul-server-cert
telemetryCollector:
cloud:
clientId:
secretKey: client-id
secretName: consul-hcp-client-id
clientSecret:
secretKey: client-secret
secretName: consul-hcp-client-secret
enabled: true
`

const expectedWithoutOptional = `connectInject:
Expand Down Expand Up @@ -518,6 +529,8 @@ global:
gossipEncryption:
secretKey: key
secretName: consul-gossip-key
metrics:
enableTelemetryCollector: true
tls:
caCert:
secretKey: tls.crt
Expand All @@ -529,6 +542,15 @@ server:
replicas: 3
serverCert:
secretName: consul-server-cert
telemetryCollector:
cloud:
clientId:
secretKey: client-id
secretName: consul-hcp-client-id
clientSecret:
secretKey: client-secret
secretName: consul-hcp-client-secret
enabled: true
`

cloudPreset := &CloudPreset{}
Expand Down

0 comments on commit ae6581c

Please sign in to comment.