Sign inSign up

tbcloud/kubernite

By tbcloud

•Updated about 7 years ago

kubernetes drone plugin

Image
0

1.7K

tbcloud/kubernite repository overview

⁠Kubernite

kubernite

Build Status

Kubernite is a Drone⁠ Plugin for Kubernetes written in golang using the official client-go⁠ kubernetes api client library.

⁠Motivation

Kubernite was built out of a desire to achieve complete automation of the deployment stage of the development cycle of an application running in a kubernetes cluster. To that end the plugin was developed with the following functionality:

  1. trigger the redeployment of an existing deployment in a kubernetes cluster with consistent and traceable kubernetes.io/change-cause⁠ annotations
  2. update the deployment manifest file and commit the changes to source control to keep the state of the deployment in the cluster in sync with the manifest files which describe it. (This is to keep with Declarative Management of Kubernetes Objects⁠)

⁠Usage

⁠Elementary Example
  - name: deploy
    image: tbcloud/kubernite:<version>
    settings:
        # url for accessing the kubernetes server
        kubernetes_server:
          from_secret: kubernetes_server
        # cluster ca certificate (for TLS)
        kubernetes_cert_data:
          from_secret: kubernetes_cert_data
        # client ca certificate (for TLS)
        kubernetes_client_cert_data:
          from_secret: kubernetes_client_cert_data
        # for cluster access
        kubernetes_client_key_data:
          from_secret: kubernetes_client_key_data
        # path to deployment manifest file
        deployment_file_path: src/deployments/kubernetes/Deployment.yaml

See additional examples⁠.

⁠Plugin Settings
SettingDescription
kubernetes_serverURL of kubernetes server. Can be found in the kube config at key 'cluster.server'. The kube config can typcially be found at $USER/.kube/config or by running kubectl config view.
kubernetes_cert_dataRoot certificate used to verify the certificate presented by the API server when transport security⁠ is being established. Can be found in the kube config at key 'cluster.certificate-authority-data'. The kube config can typcially be found at $USER/.kube/config.
kubernetes_client_cert_dataPublic client certificate data for client X509 certificate. Used in authentication process. Can be found in kube config at key 'user.client-certificate-data'. See authenticating with X509 Client Certs⁠, and generating certificates⁠. Can be found in the kube config at key 'user.client-key-data'. The kube config can typcially be found at $USER/.kube/config. Note that if you are using a hosted service such as Digital Ocean KaaS⁠ you may need to download your config file from them to get access to this data.
kubernetes_client_key_dataPrivate key data for client X509 certificate. Used in authentication process. Can be found in kube config at key 'user.client-key-data'. See authenticating with X509 Client Certs⁠, and generating certificates⁠. Can be found in the kube config at key 'user.client-key-data'. The kube config can typcially be found at $USER/.kube/config. Note that if you are using a hosted service such as Digital Ocean KaaS⁠ you may need to download your config file from them to get access to this data.
deployment_file_pathPath to deployment manifest⁠ .yaml or .yml file which describes the deployment to be redeployed by kubernite.
deployment_tag_repository_path[optional - default is /drone/src] Path to root of repository from which tag/commit information is drawn to update the kubernetes.io/change-cause annotations in the deployment file. Defaults to default drone working directory (i.e. /drone/src) which is typically the root of the repository which has triggered the deployment.
dry_run[optional - default is false] If set, no deployment takes place and the updated deployment file which would be applied to the cluster is printed out in json format.
deployment_file_repository_path[optional - no default] Path to root of repository to which deployment file with updated kubernetes.io/change-cause annotations will be committed and pushed if settings.commit_deployment is set.
commit_deployment[optional - default is false] If set, deployment file with updated kubernetes.io/change-cause annotations will be committed and pushed to repository with it's root at settings.deployment_file_repository_path.

⁠Working Principle

A redeployment of an existing deployment is triggered when the pod template part of the deployment's .spec section is changed. working principle

⁠Additional Examples

⁠FAQ

⁠Credits

⁠TODO

  • add support for other client authentication methods

Tag summary

Content type

Image

Digest

Size

19.9 MB

Last updated

about 7 years ago

docker pull tbcloud/kubernite