GoogleCloudPlatform / k8s-config-connector

GCP Config Connector, a Kubernetes add-on for managing GCP resources
https://cloud.google.com/config-connector/docs/overview
Apache License 2.0
861 stars 202 forks source link

operator: support installation of specific version #2216

Closed justinsb closed 2 days ago

justinsb commented 3 days ago

Rather than supporting per-object controller switching, I think we should support per-namespace KCC version selection.

1) I think it achieves the same "give me the old controller" behaviour, in practice, and it's reasonably granular as long as we don't start shipping dozens of important direct controllers per release (i.e. as long as we pace ourselves) 2) I worry if we support the terraform reconcilers on a per-object level, we have no way of ever ending that support. And we can't support it forever, because we can't add fields to the old controllers. 3) I think this is a feature we want to support anyway ("gradual upgrades").

cc @yuwenma and @cheftako and @nicslatts

yuwenma commented 3 days ago

hmmm, somehow I don't see @justinsb comments when posting. Sorry for the distractions.

justinsb commented 3 days ago

Here's the error as it looks right now:

apiVersion: core.cnrm.cloud.google.com/v1beta1
kind: ConfigConnectorContext
metadata:
  name: configconnectorcontext.core.cnrm.cloud.google.com
  namespace: default
spec:
  googleServiceAccount: kcc@fake-project.iam.gserviceaccount.com
  version: 1.2.3
status:
  errors:
  - 'error during reconciliation: error building deployment objects: error reading
    file /configconnector-operator/channels/packages/configconnector/1.2.3/namespaced/per-namespace-components.yaml:
    open /configconnector-operator/channels/packages/configconnector/1.2.3/namespaced/per-namespace-components.yaml:
    no such file or directory'
  healthy: false

We can certainly improve that, but I think it's reasonably clear for a soft-launch.

justinsb commented 2 days ago

Updated to give a slightly better error message:

status:
  errors:
  - 'error during reconciliation: error building deployment objects: version "1.2.3"
    could not be loaded: error reading file /configconnector-operator/channels/packages/configconnector/1.2.3/namespaced/per-namespace-components.yaml:
    open /configconnector-operator/channels/packages/configconnector/1.2.3/namespaced/per-namespace-components.yaml:
    no such file or directory'
  healthy: false
yuwenma commented 2 days ago

/lgtm Defer to @cheftako to unhold.

cheftako commented 2 days ago

/lgtm /approve

cheftako commented 2 days ago

/hold cancel

google-oss-prow[bot] commented 2 days ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cheftako, yuwenma

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/GoogleCloudPlatform/k8s-config-connector/blob/master/OWNERS)~~ [cheftako,yuwenma] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment