Giter VIP home page Giter VIP logo

cloud-provider-ibm's Introduction

IBM Cloud Provider

This is the IBM Cloud Provider repository which implements the IBM Cloud Controller Manager (CCM). The IBM CCM can be used to provide IBM Cloud infrastructure node and load balancer support to Kubernetes or OpenShift clusters running on IBM Cloud. This repository branch is based on Kubernetes version v1.24.0-rc.0. See CONTRIBUTING.md for contribution guidelines.

Local Build and Deploy Instructions

Building IBM Cloud Provider from your Local Repository

These build instructions have been verified using VirtualBox version 6.1.18, Vagrant version 2.2.14 and MacOS version 11.4.

  1. Change to your local repository. The build will work against this directory by making it a vagrant folder synchronized to the VM.

  2. cd vagrant-kube-build

  3. ./build.sh

  4. If the build fails, you can correct the errors and re-run ./build.sh. You can also run specific build steps by passing one or more of the following options:

    • Build setup (always run with other steps to setup the build environment and dependencies): setup
    • Build source (i.e. make fmt, make lint, etc.): source
    • Build containers (i.e. make containers): containers
    • Build Docker registry for the containers: registry
    • Build specific make step (cannot be run with other steps): make [[option] ...]
  5. Once the build is complete, you can log into the VM via vagrant ssh. Running vagrant ssh-config will give you SSH configuration updates which you can apply to your host's ~/.ssh/config file. This allows you to run ssh cloud-provider-ibm-build to access the VM. Also, you can use vagrant suspend to suspend the VM and vagrant destroy -f to destroy it.

Deploying IBM Cloud Provider

Refer to examples for deploying the IBM Cloud Provider based on underlying infrastructure type, classic or VPC.

Testing

Unit

The default build process above will run all unit tests and matches what is done by Travis CI.

make test

Functional

Functional tests are available under tests/fvt and are designed to run against an existing cluster. These tests exercise the load balancer interfaces without having to do a full build and deployment. These tests are not run by Travis CI.

To run these tests, do the following:

  1. Copy your cluster admin configuration into tests/fvt/kubeconfig along with the associated 3 *.pem files:

    1. The setupFVT.sh script in vagrant-kube-build can do this for you, just:
      • cd vagrant-kube-build
      • ./setupFVT.sh <CLUSTER_NAME>
  2. Edit ibm-cloud-config.ini file depending on whether you are testing a cluster using classic or VPC infrastructure:

    1. For Classic, no modifications are needed
    2. For VPC, you must uncomment the lines at the bottom from [provider] to the end, and update them with information from your cluster:
      • accountID can be anything (for example, accountID = bogusAccountID)
      • clusterID must be set to your cluster ID
  3. Once you have this done, the default ./build.sh script will run the FVT tests.

  4. You can also use this tester to run additional tests. To do that:

    1. Run the full ./build.sh to run through the default tests once
    2. vagrant ssh into the build VM and run other variations of the tests using any of the following as examples:
      • make runfvt TEST_FVT_OPTIONS="--action=create --name=BradsLB1"
      • make runfvt TEST_FVT_OPTIONS="--action=delete --name=BradsLB1"

Dependencies

Dependencies are managed via go modules for builds. Be sure to regenerate the go.mod and go.sum files when there are new or updated dependencies. You can do this by running make updatedeps.

Kubernetes Version Update Process

The following steps are required to create a new or update an existing branch for a new Kubernetes version.

  1. If the update is for a new Kubernetes major or minor version, select the current branch from which the new branch will be created. Then in the Find or create a branch... field under the Branch drop-down menu, enter the new branch name release-<major>.<minor> where <major>.<minor> is the Kubernetes major and minor version (e.g. release-1.24).

  2. The Travis CI configuration for this repo includes a cron job that runs every day. If a new Kubernetes patch version is available for a release, the cron job will automatically open a pull request with the necessary changes for that patch.

    • If the update is for a new Kubernetes major or minor version, this cron job will have to be enabled in Travis CI. Do the following to enable the job:

      1. Navigate to the Travis CI settings page, and locate the Cron Jobs section.
      2. Beneath the list of current cron configurations, create a new configuration with these specifications:
        • Branch: release-<major>.<minor> (e.g. release-1.24)
        • Interval: Daily
        • Options: Always Run
      3. Click Add
    • This task can also be run manually to skip having to wait for the cron job to trigger. Running the following steps will create the PR:

      1. cd vagrant-kube-build
      2. ./build.sh make kube-update KUBE_VERSION=vX.Y.Z (e.g v1.24.0-rc.0)
      3. Go to the URL displayed in the build output to create the pull request.
  3. go.mod and go.sum dependencies are kept up to date with the renovate application. One or more pull requests with the necessary changes will be created and must be reviewed and merged.

  4. If the current branch is the latest branch, update this repository's branch settings to make it the default branch.

  5. If the update is for a new Kubernetes major or minor version, update the IBM CCM base image if an update is available.

  6. If the update is for a new Kubernetes major or minor version, open a PR to update the golangci-lint version in .travis.yml to use the latest release. Available releases can be found here. You may need to make changes to the code to achieve compliance with the latest linting version.

  7. If the update is for a new Kubernetes major or minor version, update the nightly build job to include the branch in the releases to tag. Ensure the job is rebuilt with the changes before proceeding to the next step.

  8. Once all PRs are merged, follow the release process to build the IBM Cloud Provider for the update.

Release Process

Travis CI is used to build IBM Cloud Provider releases. A nightly build job will trigger a Travis build by publishing a new tag when there are changes for a release.

cloud-provider-ibm's People

Contributors

iksrochpub avatar rtheis avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.