Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Higher-Order Deployments: Reducing Boilerplate With Kubernetes Custom Resource Definitions

Higher-Order Deployments: Reducing Boilerplate With Kubernetes Custom Resource Definitions

Custom Resource Definitions (CRDs) with associated Controllers can provide a more powerful alternative to templating YAML manifests in Kubernetes. This talk will cover how we use CRDs and Controllers at Manifold to define higher-order composite Kubernetes resources for our deployments at Manifold. These CRDs combine the definition of Deployments, Services, and Ingresses into a single resource that is continually reconciled by Kubernetes, preventing accidental deletion or modification of one of the components. With the associated Controllers, we are able to define new styles of deployment rollouts, and trigger automatic deployments when secrets or container images change, based on definable policies.

James Bowes

May 03, 2018
Tweet

More Decks by James Bowes

Other Decks in Technology

Transcript

  1. Photo by Lauren Lester on Unsplash apiVersion: extensions/v1beta1 kind: Deployment

    metadata: name: worker spec: replicas: 2 strategy: Photo by Lauren Lester on Unsplash
  2. Photo by Wine Dharma on Unsplash • 1 Custom Resource

    Definition • 1 Controller • Admission Controllers to taste @jrbowes
  3. apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: name: applications.manifold.co spec: group: stable.manifold.co

    version: v1 scope: Namespaced names: plural: applications singular: application kind: Application @jrbowes
  4. - name: Create my app's deployment k8s_raw: state: present definition:

    apiVersion: extensions/v1beta1 kind: Deployment metadata: name: my-app spec: replicas: 2 @jrbowes
  5. - name: Create all of my app k8s_raw: state: present

    definition: apiVersion: manifold.co/v1 kind: Application metadata: name: my-app spec: external: true @jrbowes
  6. Photo by Matthew Hamilton on Unsplash CRDs are new &

    incomplete No multi-version support yet @jrbowes
  7. Photo by Matthew Hamilton on Unsplash Attempts to simplify are

    still early • Metacontroller • Kubekit • operator-sdk • Your cool project? @jrbowes