Addon Management

    In addition, kOps offers end-user management of addons via the channels tool (which is still experimental, but we are working on making it a recommended part of kubernetes addon management). We ship some curated addons in the addons directory, more information in the .

    kOps uses the channels tool for system addon management also. Because kOps uses the same tool for system addon management as it does for user addon management, this means that addons installed by kOps as part of cluster bringup can be managed alongside additional addons. (Though note that bootstrap addons are much more likely to be replaced during a kOps upgrade).

    The general kOps philosophy is to try to make the set of bootstrap addons minimal, and to make installation of subsequent addons easy.

    Thus, kube-dns and the networking overlay (if any) are the canonical bootstrap addons. But addons such as the dashboard or the EFK stack are easily installed after kOps bootstrap, with a kubectl apply -f https://... or with the channels tool.

    In future, we may as a convenience make it easy to add optional addons to the kOps manifest, though this will just be a convenience wrapper around doing it manually.

    If you want to update the bootstrap addons, you can run the following command to show you which addons need updating. Add --yes to actually apply the updates.

    channels apply channel s3://KOPS_S3_BUCKET/CLUSTER_NAME/addons/bootstrap-channel.yaml

    Versioning

    For example, a typical addons declaration might looks like this:

    That declares two versions of an addon, with manifests at v1.4.0.yaml and at v1.5.0.yaml. These are evaluated as relative paths to the Addons file itself. (The channels tool supports a few more protocols than kubectl - for example for S3 hosted manifests).

    The version field gives meaning to the alternative manifests. This is interpreted as a semver. The channels tool keeps track of the current version installed (currently by means of an annotation on the kube-system namespace).

    The channel tool updates the installed version when any of the following conditions apply.

    • The version declared in the addon manifest is greater then the currently installed version.
    • The version number’s match, but the ids are different
    • The version number and ids match, but the hash of the addon’s manifest has changed since it was installed.

    This means that a user can edit a deployed addon, and changes will not be replaced, until a new version of the addon is installed. The long-term direction here is that addons will mostly be configured through a ConfigMap or Secret object, and that the addon manager will (TODO) not replace the ConfigMap.

    The selector determines the objects which make up the addon. This will be used to construct a --prune argument (TODO), so that objects that existed in the previous but not the new version will be removed as part of an upgrade.

    The addon manager now supports a kubernetesVersion field, which is a semver range specifier on the kubernetes version. If the targeted version of kubernetes does not match the semver specified, the addon version will be ignored.

    For example:

    On kubernetes versions before 1.6, we will install v1.5.0.yaml, whereas from kubernetes versions 1.6 on we will install v1.6.0.yaml.

    Note that we remove the pre-release field of the kubernetes semver, so that 1.6.0-beta.1 will match . This matches the way kubernetes does pre-releases.

    Semver is not enough: id

    However, semver is insufficient here with the kubernetes version selection. The problem arises in the following scenario:

    • Upgrade to k8s 1.6, 1.6 version of manifest is installed
    • Downgrade to k8s 1.5; we want the 1.5 version of the manifest to be installed but the 1.6 version will have a semver that is greater than or equal to the 1.5 semver.

    We need a way to break the ties between the semvers, and thus we introduce the id field.

    Thus a manifest will actually look like this:

    Note that the two addons have the same version, but a different kubernetesVersion selector. But they have different id values; addons with matching semvers but different ids will be upgraded. (We will never downgrade to an older semver though, regardless of id)

    A few tips:

    • The version can now more closely mirror the upstream version.