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

Add external cloud provider support for VPC #1015

Merged
merged 1 commit into from
Jan 12, 2023

Conversation

Karthik-K-N
Copy link
Contributor

@Karthik-K-N Karthik-K-N commented Jan 4, 2023

What this PR does / why we need it:

This PR adds the support to use external cloud controller for VPC cluster, Major changes included are

  1. Made changes to update the provider id format for VPC machines as per the ibmcloud ccm
  2. Added command line flag named provider-id-format to allow user to select the provider id format. For ccm support it should be set to v2.
  3. Added template to create cluster with external cloud controller.
  4. Added necessary documentation to configure external cloud controller.

With this support now users will be able to create a service of type LoadBalancer in workload clusters.

Previous PR to add external cloud provider support for Power VS workload cluster: #614

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 #990

Special notes for your reviewer:

/area provider/ibmcloud

  1. Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. area/provider/ibmcloud Issues or PRs related to ibmcloud provider labels Jan 4, 2023
@netlify
Copy link

netlify bot commented Jan 4, 2023

Deploy Preview for kubernetes-sigs-cluster-api-ibmcloud ready!

Name Link
🔨 Latest commit a4fffc2
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-ibmcloud/deploys/63be3fb05092370009b49d60
😎 Deploy Preview https://deploy-preview-1015--kubernetes-sigs-cluster-api-ibmcloud.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 4, 2023
@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jan 4, 2023
cloud/scope/machine.go Outdated Show resolved Hide resolved
@Karthik-K-N
Copy link
Contributor Author

Tested the CCM integration as follows

  1. Created a deployment
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
spec:
  selector:
    matchLabels:
      app: nginx
  replicas: 2
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
        - name: nginx
          image: nginx:1.14.2
          ports:
            - containerPort: 80
  1. Created a LoadBalancer Service
apiVersion: v1
kind: Service
metadata:
  name: test-svc
spec:
  type: LoadBalancer
  ports:
    - name: http
      port: 80
      targetPort: 80
  selector:
    app: nginx
  externalTrafficPolicy: Cluster
  1. Loadbalancer got created in IBM Cloud

Screenshot 2023-01-05 at 2 14 44 PM

  1. Health status of Loadbalancer

Screenshot 2023-01-05 at 2 14 25 PM

  1. Tried accessing the service via loadbalancer URL

Screenshot 2023-01-05 at 2 14 08 PM

@Karthik-K-N Karthik-K-N changed the title [WIP] Add external cloud provider support for VPC Add external cloud provider support for VPC Jan 5, 2023
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 5, 2023
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 6, 2023
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 10, 2023
main.go Outdated Show resolved Hide resolved
@Prajyot-Parab
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 10, 2023
main.go Show resolved Hide resolved
Comment on lines -489 to -491
- name: VPCCTL_CLOUD_CONFIG
value: /etc/cloud/ibmpowervs.conf
- name: VPCCTL_PUBLIC_ENDPOINT
Copy link
Member

Choose a reason for hiding this comment

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

don't we need these params anymore? if yes - why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

VPCCTL_CLOUD_CONFIG has been removed as a part of refactoring IBM Cloud provider repo.

VPCCTL_PUBLIC_ENDPOINT has been renamed as ENABLE_VPC_PUBLIC_ENDPOINT

main.go Outdated Show resolved Hide resolved
main.go Outdated
case options.ProviderIDFormatV2:
setupLog.Info("Using v2 version of ProviderID format")
default:
errStr := fmt.Errorf("invalid value for flag provider-id-fmt: %s, Supported values: %s, %s ", options.PowerVSProviderIDFormat, options.ProviderIDFormatV1, options.ProviderIDFormatV2)
Copy link
Member

Choose a reason for hiding this comment

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

why options.PowerVSProviderIDFormat here?

main.go Outdated Show resolved Hide resolved
@@ -10,7 +10,7 @@ This document describes how to use [kind](https://kind.sigs.k8s.io) and [Tilt](h
2. [kind](https://kind.sigs.k8s.io) v0.9 or newer (other clusters can be
used if `preload_images_for_kind` is set to false)
3. [kustomize](https://kubectl.docs.kubernetes.io/installation/kustomize/)
4. [Tilt](https://docs.tilt.dev/install.html) v0.22.2 or newer
4. [Tilt](https://docs.tilt.dev/install.html) v0.30.8 or newer
Copy link
Member

Choose a reason for hiding this comment

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

any reason for bumping the minimum tilt version required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

```
> Note: To deploy workload cluster with [Power VS clusterclass-template](/topics/powervs/clusterclass-cluster.html). Set the `POWERVS_PROVIDER_ID_FORMAT` environmental variable.
Currently, both [ClusterClass](https://cluster-api.sigs.k8s.io/tasks/experimental-features/cluster-class/index.html) and [ClusterResourceset](https://cluster-api.sigs.k8s.io/tasks/experimental-features/cluster-resource-set.html) are experimental feature so we need to enable the feature gate by setting `EXP_CLUSTER_RESOURCE_SET`, `CLUSTER_TOPOLOGY` environmental variables.
> Note: To deploy VPC workload cluster with [IBM cloud controller manager](/topics/vpc/load-balancer.html) which is currently in experimental stage. Set the `PROVIDER_ID_FORMAT` environmental variable.
Copy link
Member

Choose a reason for hiding this comment

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

content wise is good but this section contains lots of notes section and became tough to read, lets refactor this page in a separate issue.

pkg/cloud/services/utils/accounts.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 11, 2023
Copy link
Member

@mkumatag mkumatag left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 12, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Karthik-K-N, mkumatag, Prajyot-Parab

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 12, 2023
@k8s-ci-robot k8s-ci-robot merged commit 31d5a80 into kubernetes-sigs:main Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/provider/ibmcloud Issues or PRs related to ibmcloud provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CCM integration for the VPC
4 participants