Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Refactor bsc#1155810 #853

Merged
merged 1 commit into from
Dec 2, 2019
Merged

Refactor bsc#1155810 #853

merged 1 commit into from
Dec 2, 2019

Conversation

jenting
Copy link

@jenting jenting commented Nov 25, 2019

Why is this PR needed?

Address the comments of this PR

What does this PR do?

  1. Moves create root CA certificate and key to kubernetes package.
  2. Splits state into two: upload ca cert, generate server cert/key and upload.

Anything else a reviewer needs to know?

N/A

Info for QA

Please double verify on all the platforms: OpenStack, VMWare, Bare Metal.

Related info

#832

Status BEFORE applying the patch

N/A

Status AFTER applying the patch

N/A

Docs

N/A

Merge restrictions

(Please do not edit this)

We are in v4-maintenance phase, so we will restrict what can be merged to prevent unexpected surprises:

What can be merged (merge criteria):
    2 approvals:
        1 developer: code is fine
        1 QA: QA is fine
    there is a PR for updating documentation (or a statement that this is not needed)

Signed-off-by: JenTing Hsiao [email protected]

@jenting jenting self-assigned this Nov 25, 2019
@jenting jenting added the enhancement New feature or request label Nov 25, 2019
innobead
innobead previously approved these changes Nov 26, 2019
Copy link
Contributor

@ereslibre ereslibre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @jenting, two minor comments and it's a LGTM.

pkg/skuba/actions/node/upgrade/apply.go Outdated Show resolved Hide resolved
internal/pkg/skuba/deployments/ssh/kubelet.go Outdated Show resolved Hide resolved
Signed-off-by: JenTing Hsiao <[email protected]>
@jenting jenting requested a review from maximenoel8 November 29, 2019 02:14
@maximenoel8
Copy link

maximenoel8 commented Dec 2, 2019

QA information :

Building skuba :

  • git pull on pull request 853
  • make ( for devel env )
    I'm using devel to be able to upgrade kubelet from 1.15.2 to 1.16.2

Testing environment :

  • 1 lb / 1 master / 1 node on vmware

Cluster setting :

skuba cluster init --control-plane <IP_LB> --strict-capability-defaults --kubernetes-version 1.15.2 cluster

I'm using the new option --kubernetes-version to be able to upgrade once the cluster is deployed

Scenario:

I want to upgrade my kubelet version and crio version ( kubelet: 1.15.2 -> 1.16.2 / crio: 1.15.0 -> 1.16.0) using the upgrade method.

Before :

  • Checking if the cluster need an upgrade

Command : skuba cluster upgrade plan
Result :

** This is an UNTAGGED version and NOT intended for production usage. **
Current Kubernetes cluster version: 1.15.2
Latest Kubernetes version: 1.16.2

Upgrade path to update from 1.15.2 to 1.16.2:
 - 1.15.2 -> 1.16.2

Addons for next cluster version 1.16.2 are already up to date.

There is no need to run 'skuba addon upgrade apply' after you have completed the platform upgrade.
  • Checking master01 need an upgrade
    Command : skuba node upgrade plan master01
    Result :
** This is an UNTAGGED version and NOT intended for production usage. **
Current Kubernetes cluster version: 1.15.2
Latest Kubernetes version: 1.16.2

Current Node version: 1.15.2

Component versions in master01
  - apiserver: 1.15.2 -> 1.16.2
  - controller-manager: 1.15.2 -> 1.16.2
  - scheduler: 1.15.2 -> 1.16.2
  - etcd: 3.3.11 -> 3.3.15
  - kubelet: 1.15.2 -> 1.16.2
  - cri-o: 1.15.0 -> 1.16.0
  • Checking worker01 need an upgrade

Test:

Part 1 - Upgrade master01
  • Upgrade master01
  • Check master01 DON'T need an upgrade
  • Check current version for kubelet is 1.16.2 with skuba command
  • Check current version for crio is 1.16.0 with skuba command
  • Check current version for kubelet is 1.16.2 directly on the node
  • Check current version for crio is 1.16.0 directly on the node
  • Check skuba cluster upgrade plan command return (*)
    Command : skuba cluster upgrade plan
    Result :
** This is an UNTAGGED version and NOT intended for production usage. **
Current Kubernetes cluster version: 1.16.2
Latest Kubernetes version: 1.16.2

Congratulations! You are already at the latest version available
Part 2 - Upgrade worker01
  • Upgrade worker01
  • Check worker01 DON'T need an upgrade
  • Check current version for kubelet is 1.16.2 with skuba command
  • Check current version for crio is 1.16.0 with skuba command
  • Check current version for kubelet is 1.16.2 directly on the node
  • Check current version for crio is 1.16.0 directly on the node
  • Check skuba cluster upgrade plan command return

Comments

The test is PASS for me. I was able to correctly upgrade my cluster.
The only things that doesn't seem correct is the step Check skuba cluster upgrade plan command return in part 1 (*)
Command : skuba cluster upgrade plan
Result :

** This is an UNTAGGED version and NOT intended for production usage. **
Current Kubernetes cluster version: 1.16.2
Latest Kubernetes version: 1.16.2

Congratulations! You are already at the latest version available

The worker is not upgraded yet but the cluster upgrade plan doesn't show me that. It can be confusing during an upgrade.

@jenting
Copy link
Author

jenting commented Dec 2, 2019

Thanks for your testing @maximenoel8.

The test steps test the CaaS platform upgrade but it does not contain checking the bug symptom that all the master and worker node kubelet server certificates signed by the same CA certificate.

You could follow the PR #832 test steps (Status BEFORE/AFTER applying the patch), or check all nodes kubelet server certificates are signed by the same CA certificate.

# ssh into the node
ssh sles@<ip-address>
# check certificate
openssl s_client -connect localhost:10250 -CAfile /var/lib/kubelet/pki/kubelet-ca.crt <<< "Q"

Copy link
Contributor

@ereslibre ereslibre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @jenting.

@jenting jenting merged commit 1e5ae95 into SUSE:master Dec 2, 2019
@jenting jenting deleted the refactor-bsc1155810 branch December 2, 2019 15:35
@maximenoel8
Copy link

maximenoel8 commented Dec 3, 2019

Check the certificate by using the command :

openssl s_client -connect localhost:10250 -CAfile kubelet-ca.crt <<< "Q" 

on each node.

CN is correctly equal to kubelet-ca and I can identify myself by using kubelet-ca.crt to 10250

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants