Skip to content

Commit 8d0ae3d

Browse files
committed
fix: configure webhook to ignore kube-system
Fixes #461.
1 parent 1a99e64 commit 8d0ae3d

File tree

6 files changed

+24
-5
lines changed

6 files changed

+24
-5
lines changed

config/crd/bases/cloudsql.cloud.google.com_authproxyworkloads.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ apiVersion: apiextensions.k8s.io/v1
1515
kind: CustomResourceDefinition
1616
metadata:
1717
annotations:
18-
controller-gen.kubebuilder.io/version: v0.13.0
18+
controller-gen.kubebuilder.io/version: v0.9.2
19+
creationTimestamp: null
1920
name: authproxyworkloads.cloudsql.cloud.google.com
2021
spec:
2122
group: cloudsql.cloud.google.com

config/rbac/role.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
apiVersion: rbac.authorization.k8s.io/v1
1515
kind: ClusterRole
1616
metadata:
17+
creationTimestamp: null
1718
name: manager-role
1819
rules:
1920
- apiGroups:

config/webhook/core_webhook.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ webhooks:
3939
failurePolicy: Ignore
4040
name: pods.proxy.cloudsql.google.com
4141
matchPolicy: Equivalent
42+
namespaceSelector:
43+
matchExpressions:
44+
- key: kubernetes.io/metadata.name
45+
operator: NotIn
46+
values:
47+
- kube-system
4248
rules:
4349
- apiGroups:
4450
- ""

docs/api.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ _Appears in:_
4949
| `maxConnections` _integer_ | MaxConnections limits the number of connections. Default value is no limit. This sets the proxy container's CLI argument `--max-connections` |
5050
| `maxSigtermDelay` _integer_ | MaxSigtermDelay is the maximum number of seconds to wait for connections to close after receiving a TERM signal. This sets the proxy container's CLI argument `--max-sigterm-delay` and configures `terminationGracePeriodSeconds` on the workload's PodSpec. |
5151
| `sqlAdminAPIEndpoint` _string_ | SQLAdminAPIEndpoint is a debugging parameter that when specified will change the Google Cloud api endpoint used by the proxy. |
52-
| `image` _string_ | Image is the URL to the proxy image. Optional, by default the operator will use the latest Cloud SQL Auth Proxy version as of the release of the operator. <br /><br /> The operator ensures that all workloads configured with the default proxy image are upgraded automatically to use to the latest released proxy image. <br /><br /> When the customer upgrades the operator, the operator upgrades all workloads using the default proxy image to the latest proxy image. The change to the proxy container image is applied in accordance with the RolloutStrategy. |
52+
| `image` _string_ | Image is the URL to the proxy image. Optional, by default the operator will use the latest Cloud SQL Auth Proxy version as of the release of the operator.
53+
The operator ensures that all workloads configured with the default proxy image are upgraded automatically to use to the latest released proxy image.
54+
When the customer upgrades the operator, the operator upgrades all workloads using the default proxy image to the latest proxy image. The change to the proxy container image is applied in accordance with the RolloutStrategy. |
5355
| `rolloutStrategy` _string_ | RolloutStrategy indicates the strategy to use when rolling out changes to the workloads affected by the results. When this is set to `Workload`, changes to this resource will be automatically applied to a running Deployment, StatefulSet, DaemonSet, or ReplicaSet in accordance with the Strategy set on that workload. When this is set to `None`, the operator will take no action to roll out changes to affected workloads. `Workload` will be used by default if no value is set. See: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy |
5456
| `quiet` _boolean_ | Quiet configures the proxy's --quiet flag to limit the amount of logging generated by the proxy container. |
5557

@@ -142,7 +144,7 @@ _Appears in:_
142144
| `prometheusNamespace` _string_ | PrometheusNamespace is used the provided Prometheus namespace for metrics This sets the proxy container's CLI argument `--prometheus-namespace` |
143145
| `telemetryProject` _string_ | TelemetryProject enables Cloud Monitoring and Cloud Trace with the provided project ID. This sets the proxy container's CLI argument `--telemetry-project` |
144146
| `telemetryPrefix` _string_ | TelemetryPrefix is the prefix for Cloud Monitoring metrics. This sets the proxy container's CLI argument `--telemetry-prefix` |
145-
| `telemetrySampleRate` _[int](#int)_ | TelemetrySampleRate is the Cloud Trace sample rate. A smaller number means more traces. This sets the proxy container's CLI argument `--telemetry-sample-rate` |
147+
| `telemetrySampleRate` _integer_ | TelemetrySampleRate is the Cloud Trace sample rate. A smaller number means more traces. This sets the proxy container's CLI argument `--telemetry-sample-rate` |
146148
| `httpPort` _integer_ | HTTPPort the port for Prometheus and health check server. This sets the proxy container's CLI argument `--http-port` |
147149
| `disableTraces` _boolean_ | DisableTraces disables Cloud Trace testintegration (used with telemetryProject) This sets the proxy container's CLI argument `--disable-traces` |
148150
| `disableMetrics` _boolean_ | DisableMetrics disables Cloud Monitoring testintegration (used with telemetryProject) This sets the proxy container's CLI argument `--disable-metrics` |
@@ -179,6 +181,7 @@ _Appears in:_
179181
| `version` _string_ | |
180182
| `namespace` _string_ | |
181183
| `name` _string_ | |
182-
| `conditions` _[Condition](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#condition-v1-meta) array_ | Conditions show the status of the AuthProxyWorkload resource on this matching workload. <br /><br /> The "UpToDate" condition indicates that the proxy was successfully applied to all matching workloads. See ConditionUpToDate. |
184+
| `conditions` _[Condition](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#condition-v1-meta) array_ | Conditions show the status of the AuthProxyWorkload resource on this matching workload.
185+
The "UpToDate" condition indicates that the proxy was successfully applied to all matching workloads. See ConditionUpToDate. |
183186

184187

installer/cloud-sql-proxy-operator.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ kind: CustomResourceDefinition
2424
metadata:
2525
annotations:
2626
cert-manager.io/inject-ca-from: cloud-sql-proxy-operator-system/cloud-sql-proxy-operator-serving-cert
27-
controller-gen.kubebuilder.io/version: v0.13.0
27+
controller-gen.kubebuilder.io/version: v0.9.2
2828
name: authproxyworkloads.cloudsql.cloud.google.com
2929
spec:
3030
conversion:
@@ -1259,6 +1259,7 @@ rules:
12591259
apiVersion: rbac.authorization.k8s.io/v1
12601260
kind: ClusterRole
12611261
metadata:
1262+
creationTimestamp: null
12621263
name: cloud-sql-proxy-operator-manager-role
12631264
rules:
12641265
- apiGroups:
@@ -1605,6 +1606,12 @@ webhooks:
16051606
failurePolicy: Ignore
16061607
matchPolicy: Equivalent
16071608
name: pods.proxy.cloudsql.google.com
1609+
namespaceSelector:
1610+
matchExpressions:
1611+
- key: kubernetes.io/metadata.name
1612+
operator: NotIn
1613+
values:
1614+
- kube-system
16081615
rules:
16091616
- apiGroups:
16101617
- ""

internal/api/v1/zz_generated.deepcopy.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)