Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,9 @@ spec:
prometheusNamespace:
description: PrometheusNamespace is used the provided Prometheus namespace for metrics This sets the proxy container's CLI argument `--prometheus-namespace`
type: string
quotaProject:
description: QuotaProject Specifies the project to use for Cloud SQL Admin API quota tracking. The IAM principal must have the "serviceusage.services.use" permission for the given project. See https://cloud.google.com/service-usage/docs/overview and https://cloud.google.com/storage/docs/requester-pays This sets the proxy container's CLI argument `--quota-project`
type: string
telemetryPrefix:
description: TelemetryPrefix is the prefix for Cloud Monitoring metrics. This sets the proxy container's CLI argument `--telemetry-prefix`
type: string
Expand Down
1 change: 1 addition & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ _Appears in:_

| Field | Description |
| --- | --- |
| `quotaProject` _string_ | QuotaProject Specifies the project to use for Cloud SQL Admin API quota tracking. The IAM principal must have the "serviceusage.services.use" permission for the given project. See https://cloud.google.com/service-usage/docs/overview and https://cloud.google.com/storage/docs/requester-pays This sets the proxy container's CLI argument `--quota-project` |
| `prometheus` _boolean_ | Prometheus Enables Prometheus HTTP endpoint /metrics on localhost This sets the proxy container's CLI argument `--prometheus` |
| `prometheusNamespace` _string_ | PrometheusNamespace is used the provided Prometheus namespace for metrics This sets the proxy container's CLI argument `--prometheus-namespace` |
| `telemetryProject` _string_ | TelemetryProject enables Cloud Monitoring and Cloud Trace with the provided project ID. This sets the proxy container's CLI argument `--telemetry-project` |
Expand Down
3 changes: 3 additions & 0 deletions installer/cloud-sql-proxy-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,9 @@ spec:
prometheusNamespace:
description: PrometheusNamespace is used the provided Prometheus namespace for metrics This sets the proxy container's CLI argument `--prometheus-namespace`
type: string
quotaProject:
description: QuotaProject Specifies the project to use for Cloud SQL Admin API quota tracking. The IAM principal must have the "serviceusage.services.use" permission for the given project. See https://cloud.google.com/service-usage/docs/overview and https://cloud.google.com/storage/docs/requester-pays This sets the proxy container's CLI argument `--quota-project`
type: string
telemetryPrefix:
description: TelemetryPrefix is the prefix for Cloud Monitoring metrics. This sets the proxy container's CLI argument `--telemetry-prefix`
type: string
Expand Down
8 changes: 8 additions & 0 deletions internal/api/v1alpha1/authproxyworkload_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,14 @@ type AdminServerSpec struct {

// TelemetrySpec specifies how the proxy container will expose telemetry.
type TelemetrySpec struct {
// QuotaProject Specifies the project to use for Cloud SQL Admin API quota tracking.
// The IAM principal must have the "serviceusage.services.use" permission
// for the given project. See https://cloud.google.com/service-usage/docs/overview and
// https://cloud.google.com/storage/docs/requester-pays
// This sets the proxy container's CLI argument `--quota-project`
//+kubebuilder:validation:Optional
QuotaProject *string `json:"quotaProject,omitempty"`

// Prometheus Enables Prometheus HTTP endpoint /metrics on localhost
// This sets the proxy container's CLI argument `--prometheus`
//+kubebuilder:validation:Optional
Expand Down
5 changes: 5 additions & 0 deletions internal/api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions internal/workload/podspec_updates.go
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,9 @@ func (s *updateState) applyTelemetrySpec(p *cloudsqlapi.AuthProxyWorkload) {
if tel.TelemetryPrefix != nil {
s.addProxyContainerEnvVar(p, "CSQL_PROXY_TELEMETRY_PREFIX", *tel.TelemetryPrefix)
}
if tel.QuotaProject != nil {
s.addProxyContainerEnvVar(p, "CSQL_PROXY_QUOTA_PROJECT", *tel.QuotaProject)
}

return
}
Expand Down
2 changes: 2 additions & 0 deletions internal/workload/podspec_updates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,7 @@ func TestProxyCLIArgs(t *testing.T) {
DisableMetrics: &wantTrue,
Prometheus: &wantTrue,
PrometheusNamespace: ptr("hello"),
QuotaProject: ptr("qp"),
},
AdminServer: &v1alpha1.AdminServerSpec{
EnableAPIs: []string{"Debug", "QuitQuitQuit"},
Expand Down Expand Up @@ -666,6 +667,7 @@ func TestProxyCLIArgs(t *testing.T) {
"CSQL_PROXY_DISABLE_TRACES": "true",
"CSQL_PROXY_DISABLE_METRICS": "true",
"CSQL_PROXY_PROMETHEUS": "true",
"CSQL_PROXY_QUOTA_PROJECT": "qp",
"CSQL_PROXY_MAX_CONNECTIONS": "10",
"CSQL_PROXY_MAX_SIGTERM_DELAY": "20",
},
Expand Down