-
Notifications
You must be signed in to change notification settings - Fork 3
[PRODENG-3744] Use KDD datastore by default #72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| # Patches the calico-kube-controllers Deployment in kube-system to run | ||
| # under the calico-kube-controllers ServiceAccount instead of calico-node. | ||
| # | ||
| # Known MKE3 issue: when Calico is installed with the Kubernetes Datastore | ||
| # (KDD) backend (--calico-datastore-type-kdd at `mke install` time — see | ||
| # calico_datastore_type_kdd in vars/common-vars.yml), MKE brings up the | ||
| # calico-kube-controllers Deployment still wired to the calico-node | ||
| # ServiceAccount. calico-node's RBAC is scoped for the per-node agent, not | ||
| # the cluster-wide controller, so calico-kube-controllers cannot sync from | ||
| # the Kubernetes API (CrashLoopBackOff / RBAC "forbidden" errors in its | ||
| # logs) until it runs as the calico-kube-controllers ServiceAccount that MKE | ||
| # also creates but never wires up. | ||
| # | ||
| # Installing cluster-upgrade-controller/machine-config-controller/SUC each | ||
| # apply their own CRDs/namespaces/Deployments, which was observed to trigger | ||
| # MKE to re-sync its baseline kube-system manifests — reverting this patch | ||
| # if it ran before them. mke-post-install-playbook.yml therefore runs this | ||
| # task last, after every other mutating step, so nothing later in the same | ||
| # run can undo it. | ||
| # | ||
| # Required vars (inherited from the enclosing play): | ||
| # admin_user – MKE administrator username (from vars/mke-creds.yml) | ||
| # admin_pass – MKE administrator password (from vars/mke-creds.yml) | ||
| # mke_url – MKE load-balancer IP/hostname (from inventory all.vars) | ||
| # bundle_dest – local directory for the bundle (default: playbook_dir/mke-bundle) | ||
| # | ||
| # Ref: https://docs.mirantis.com/mke/3.7/cli-ref/mke-cli-install.html | ||
|
|
||
| - name: Fetch MKE client bundle | ||
| ansible.builtin.include_tasks: tasks/mke-client-bundle-tasks.yml | ||
|
|
||
| - name: Patch calico-kube-controllers service account | ||
| ansible.builtin.command: | ||
| argv: | ||
| - kubectl | ||
| - patch | ||
| - deployment | ||
| - calico-kube-controllers | ||
| - -n | ||
| - kube-system | ||
| - --kubeconfig | ||
| - "{{ bundle_dest }}/kube.yml" | ||
| - --type | ||
| - merge | ||
| - --patch | ||
| - '{"spec":{"template":{"spec":{"serviceAccountName":"calico-kube-controllers"}}}}' | ||
| delegate_to: localhost | ||
| run_once: true | ||
| register: _calico_kdd_patch | ||
| changed_when: "'patched' in _calico_kdd_patch.stdout" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Medium - KDD repair task is skipped for clusters that enable the datastore through existing install-flag overrides
The new service-account patch runs only when
calico_datastore_type_kddis true, but the code still exposes the genericmke_install_flagsoverride and documentsmke-post-install-playbook.ymlas a standalone flow. That means a cluster can be installed with--calico-datastore-type-kddthrough the existing flag list while this new boolean stays at its defaultfalse, causing post-install to skip the fix entirely. In that statecalico-kube-controllerskeeps running ascalico-nodeand hits the RBAC-forbidden/CrashLoop behavior this PR is meant to prevent, so the repair is unreliable for valid KDD deployments.Show fix
Drive the patch from the effective install configuration or live cluster state instead of a second manually-synchronized boolean, or at least fail fast when KDD is present in
mke_install_flagsbutcalico_datastore_type_kddis false.More info - Reply on this comment to give feedback or ignore the issue.