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-101682] Support single control plane cluster #659

Merged
merged 2 commits into from
May 29, 2024

Conversation

ilia1243
Copy link
Contributor

@ilia1243 ilia1243 commented May 13, 2024

Description

  • If no nodes with control-plane role are provided, Kubemarine fails with internal error.
  • At least one control-plane node is necessary even for connection-only enrichment
    • choose default node in do procedure
    • preserve information about the procedure run.
  • In contrast, it is potentially possible to install the cluster with the only control-plane node for dev aims.
    • In particular, this allows to rebuild the only worker node using remove & add node while temporarily persisting only control planes.

Solution

  • Raise exception if no control planes are specified in the inventory.
  • Allow clusters without workers.

Test Cases

TestCase 1

Rebuild the only worker node using remove & add node.

Steps:

  1. Install the cluster with 1 worker and 1 control-plane.
  2. Remove the only worker.

Results:

Before After
KME0004 Node is removed successfully
  1. Add the worker.

ER: Node is added successfully.

TestCase 2

Install single control plane cluster.

Steps:

  1. Configure inventory
    nodes:
    - name: control-plane
      internal_address: <address>
      roles: [control-plane]
    services:
      coredns:
        deployment:
          spec:
            template:
              spec:
                nodeSelector:
                  node-role.kubernetes.io/worker: null
    plugins:
      nginx-ingress-controller:
        install: false
  2. Install the cluster.

Results:

Before After
KME0004 Cluster is installed successfully
  1. Upgrade the cluster.

ER: Cluster is upgraded successfully.

TestCase 3

Try to install cluster without control planes.

Steps:

  1. Try to install cluster without control planes.

Results:

Before After
Internal error KME0004

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_defaults.yaml - cover new functionality and validation.

@ilia1243 ilia1243 added the improvement New feature or request label May 13, 2024
@ilia1243 ilia1243 requested a review from Imadzuma May 13, 2024 10:07
@ilia1243 ilia1243 requested a review from n549 May 13, 2024 12:44
@vlar0816 vlar0816 changed the title Support single control plane cluster [CPDEV-101682] Support single control plane cluster May 14, 2024
@ilia1243 ilia1243 force-pushed the improvement/single_cp_cluster branch from add13fe to d134d83 Compare May 14, 2024 13:29
@ilia1243 ilia1243 force-pushed the improvement/single_cp_cluster branch from d134d83 to 58b4774 Compare May 29, 2024 09:23
@OleksandrIaresko OleksandrIaresko self-requested a review May 29, 2024 11:31
Raise exception if no control planes are specified in the inventory.
@ilia1243 ilia1243 force-pushed the improvement/single_cp_cluster branch from 58b4774 to f3b00e6 Compare May 29, 2024 11:52
@koryaga koryaga merged commit 3662544 into main May 29, 2024
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants