Skip to content
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

[CPDEV-98973] Scale Typha replicas to 1 in All-in-One #658

Merged
merged 2 commits into from
May 22, 2024

Conversation

ilia1243
Copy link
Contributor

@ilia1243 ilia1243 commented May 8, 2024

Description

Solution

  • Scale Typha replicas to 1 if it is enabled in schemes with 1 Kubernetes node.
  • If 2nd Kubernetes node is added, scale replicas to 2 and redeploy calico plugin.
  • Add default tolerations to schedule Calico Typha on all nodes for old Kubernetes versions.

How to apply

Run kubemarine migrate_kubemarine --force-apply calico_typha_schedule_control_planes

Test Cases

TestCase 1

Enable Calico Typha in All-in-One.

Steps:

  1. Set plugins.calico.typha.enabled to True in All-in-One and install the cluster.

Results:

Before After
Installation fails Installation succeeds with 1 deployed Typha replica

TestCase 2

Add 2nd Kubernetes node to All-in-One with Calico Typha enabled.

Steps:

  1. Set plugins.calico.typha.enabled to True in All-in-One and install the cluster.
  2. Add 2nd Kubernetes node.

ER: calico plugin is redeployed and Calico Typha is scaled to 2 replicas.

TestCase 3

Schedule Calico Typha on control-planes.

Steps:

  1. Install cluster of version < v1.26.7 with 3 control planes, and 1 worker.
Before After
Installation fails with 1 Calico Typha pod being Pending Installation succeeds with 2 deployed Typha replica

TestCase 4

Migrate Kubemarine.

Steps:

  1. Install cluster of version < v1.26.7 with 2 control planes, and 2 workers.

ER: Calico Typha is scheduled on 2 workers.

  1. Run kubemarine migrate_kubemarine --force-apply calico_typha_schedule_control_planes
  2. Remove 1 worker.

ER: At least 1 Calico Typha pod is scheduled on control plane.

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • Integration CI passed
  • Unit tests. If Yes list of new/changed tests with brief description
  • There is no merge conflicts

Unit tests

test_calico.py - cover new enrichment, and redeploy cases.

@ilia1243 ilia1243 added the bug Something isn't working label May 8, 2024
@ilia1243 ilia1243 requested review from n549 and Imadzuma May 8, 2024 14:46
@ilia1243 ilia1243 marked this pull request as draft May 13, 2024 14:38
@ilia1243 ilia1243 force-pushed the bugfix/calico_typha_allinone branch from d279149 to d4c3dad Compare May 17, 2024 09:58
@ilia1243 ilia1243 marked this pull request as ready for review May 17, 2024 10:08
@ilia1243 ilia1243 force-pushed the bugfix/calico_typha_allinone branch from d4c3dad to 8d44738 Compare May 17, 2024 10:18
@koryaga koryaga merged commit 62b39a3 into main May 22, 2024
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants