Skip to content

fix: Machinepool should use OCI_MANAGED_KUBERNETES_VERSION ENV #375

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 1 commit into from
Aug 29, 2024

Conversation

joekr
Copy link
Member

@joekr joekr commented Aug 20, 2024

What this PR does / why we need it:
Using KUBERNETES_VERSION instead of OCI_MANAGED_KUBERNETES_VERSION will have a version mismatch and the managed nodes will fail to join.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #
Before this the Managed Cluster - Simple was not passing for me. I'm not sure how it was for others. This basically makes sure the cluster and the machine pool are using the same K8s version.

@joekr joekr added the bug Something isn't working label Aug 20, 2024
@joekr joekr self-assigned this Aug 20, 2024
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Aug 20, 2024
@joekr
Copy link
Member Author

joekr commented Aug 20, 2024

e2e tests

Ran 7 of 28 Specs in 2625.648 seconds
SUCCESS! -- 7 Passed | 0 Failed | 0 Pending | 21 Skipped

unit tests

?       github.com/oracle/cluster-api-provider-oci      [no test files]
?       github.com/oracle/cluster-api-provider-oci/cloud/config [no test files]
?       github.com/oracle/cluster-api-provider-oci/cloud/metrics        [no test files]
?       github.com/oracle/cluster-api-provider-oci/cloud/scope/mocks    [no test files]
?       github.com/oracle/cluster-api-provider-oci/cloud/services/base  [no test files]
?       github.com/oracle/cluster-api-provider-oci/cloud/services/base/mock_base        [no test files]
?       github.com/oracle/cluster-api-provider-oci/cloud/services/compute       [no test files]
?       github.com/oracle/cluster-api-provider-oci/cloud/services/compute/mock_compute  [no test files]
?       github.com/oracle/cluster-api-provider-oci/cloud/services/computemanagement     [no test files]
?       github.com/oracle/cluster-api-provider-oci/cloud/services/computemanagement/mock_computemanagement      [no test files]
?       github.com/oracle/cluster-api-provider-oci/cloud/services/containerengine       [no test files]
?       github.com/oracle/cluster-api-provider-oci/cloud/services/containerengine/mock_containerengine  [no test files]
?       github.com/oracle/cluster-api-provider-oci/cloud/services/identity      [no test files]
?       github.com/oracle/cluster-api-provider-oci/cloud/services/identity/mock_identity        [no test files]
?       github.com/oracle/cluster-api-provider-oci/cloud/services/loadbalancer  [no test files]
?       github.com/oracle/cluster-api-provider-oci/cloud/services/loadbalancer/mock_lb  [no test files]
?       github.com/oracle/cluster-api-provider-oci/cloud/services/networkloadbalancer   [no test files]
?       github.com/oracle/cluster-api-provider-oci/cloud/services/networkloadbalancer/mock_nlb  [no test files]
?       github.com/oracle/cluster-api-provider-oci/cloud/services/vcn   [no test files]
?       github.com/oracle/cluster-api-provider-oci/cloud/services/vcn/mock_vcn  [no test files]
?       github.com/oracle/cluster-api-provider-oci/feature      [no test files]
?       github.com/oracle/cluster-api-provider-oci/version      [no test files]
ok      github.com/oracle/cluster-api-provider-oci/api/v1beta1  26.750s coverage: 22.9% of statements
ok      github.com/oracle/cluster-api-provider-oci/api/v1beta2  1.515s  coverage: 15.0% of statements
ok      github.com/oracle/cluster-api-provider-oci/cloud/ociutil        0.966s  coverage: 19.6% of statements
ok      github.com/oracle/cluster-api-provider-oci/cloud/scope  229.590s        coverage: 76.1% of statements
ok      github.com/oracle/cluster-api-provider-oci/cloud/util   1.036s  coverage: 61.1% of statements
ok      github.com/oracle/cluster-api-provider-oci/controllers  28.313s coverage: 58.7% of statements
ok      github.com/oracle/cluster-api-provider-oci/exp/api/v1beta1      8.484s  coverage: 15.3% of statements
ok      github.com/oracle/cluster-api-provider-oci/exp/api/v1beta2      2.197s  coverage: 4.8% of statements
ok      github.com/oracle/cluster-api-provider-oci/exp/controllers      3.010s  coverage: 56.3% of statements

@joekr
Copy link
Member Author

joekr commented Aug 28, 2024

Failing e2e cluster config (I'm cutting out a lot of the unrelated info to make it easier to read).

---
apiVersion: cluster.x-k8s.io/v1beta1
kind: MachinePool
metadata:
  name: capoci-e2e-al4-managed-mp-0
  namespace: capoci-e2e-al4
spec:
  clusterName: capoci-e2e-al4-managed
  replicas: 1
  template:
    spec:
      bootstrap:
        dataSecretName: ""
      clusterName: capoci-e2e-al4-managed
      infrastructureRef:
        apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
        kind: OCIManagedMachinePool
        name: capoci-e2e-al4-managed-mp-0
      version: v1.28.7
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: MachinePool
metadata:
  name: capoci-e2e-al4-managed-mp-1
  namespace: capoci-e2e-al4
spec:
  clusterName: capoci-e2e-al4-managed
  replicas: 1
  template:
    spec:
      bootstrap:
        dataSecretName: ""
      clusterName: capoci-e2e-al4-managed
      infrastructureRef:
        apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
        kind: OCIManagedMachinePool
        name: capoci-e2e-al4-managed-mp-1
      version: v1.28.7
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
kind: OCIManagedCluster
metadata:
  labels:
    cluster.x-k8s.io/cluster-name: capoci-e2e-al4-managed
  name: capoci-e2e-al4-managed-managed
  namespace: capoci-e2e-al4
spec:
  compartmentId: <compartment>
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
kind: OCIManagedControlPlane
metadata:
  name: capoci-e2e-al4-managed
  namespace: capoci-e2e-al4
spec:
  version: v1.27.2

after change

---
apiVersion: cluster.x-k8s.io/v1beta1
kind: MachinePool
metadata:
  name: capoci-e2e-div-managed-mp-0
  namespace: capoci-e2e-div
spec:
  clusterName: capoci-e2e-div-managed
  replicas: 1
  template:
    spec:
      bootstrap:
        dataSecretName: ""
      clusterName: capoci-e2e-div-managed
      infrastructureRef:
        apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
        kind: OCIManagedMachinePool
        name: capoci-e2e-div-managed-mp-0
      version: v1.28.2
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: MachinePool
metadata:
  name: capoci-e2e-div-managed-mp-1
  namespace: capoci-e2e-div
spec:
  clusterName: capoci-e2e-div-managed
  replicas: 1
  template:
    spec:
      bootstrap:
        dataSecretName: ""
      clusterName: capoci-e2e-div-managed
      infrastructureRef:
        apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
        kind: OCIManagedMachinePool
        name: capoci-e2e-div-managed-mp-1
      version: v1.28.2
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
kind: OCIManagedCluster
metadata:
  labels:
    cluster.x-k8s.io/cluster-name: capoci-e2e-div-managed
  name: capoci-e2e-div-managed-managed
  namespace: capoci-e2e-div
spec:
  compartmentId: <compartment>
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
kind: OCIManagedControlPlane
metadata:
  name: capoci-e2e-div-managed
  namespace: capoci-e2e-div
spec:
  version: v1.28.2

Copy link
Member

@xtoddx xtoddx left a comment

Choose a reason for hiding this comment

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

LGTM

Using KUBERNETES_VERSION instead of OCI_MANAGED_KUBERNETES_VERSION
will have a version mismatch and the managed nodes will fail
to join.
@joekr joekr force-pushed the fix-machinepool-e2e branch from e57b36e to 9d4d0ca Compare August 29, 2024 21:14
@joekr joekr merged commit ca7c47a into oracle:main Aug 29, 2024
1 of 2 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 OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants