Kubernetes vs. non-Kubernetes bundles

Contents:

Non-Kubernetes bundles

A non-Kubernetes bundle, for example, the kubernetes-core bundle, looks as follows:

description: A minimal two-machine Kubernetes cluster, appropriate for development.
series: bionic
machines:
  '0':
    constraints: cores=2 mem=4G root-disk=16G
    series: bionic
  '1':
    constraints: cores=4 mem=4G root-disk=16G
    series: bionic
applications:
  containerd:
    annotations:
      gui-x: '475'
      gui-y: '800'
    charm: cs:~containers/containerd-53
    resources: {}
  easyrsa:
    annotations:
      gui-x: '90'
      gui-y: '420'
    charm: cs:~containers/easyrsa-295
    num_units: 1
    resources:
      easyrsa: 5
    to:
    - lxd:0
  etcd:
    annotations:
      gui-x: '800'
      gui-y: '420'
    charm: cs:~containers/etcd-485
    num_units: 1
    options:
      channel: 3.3/stable
    resources:
      core: 0
      etcd: 3
      snapshot: 0
    to:
    - '0'
  flannel:
    annotations:
      gui-x: '475'
      gui-y: '605'
    charm: cs:~containers/flannel-466
    resources:
      flannel-amd64: 537
      flannel-arm64: 534
      flannel-s390x: 521
  kubernetes-master:
    annotations:
      gui-x: '800'
      gui-y: '850'
    charm: cs:~containers/kubernetes-master-788
    constraints: cores=2 mem=4G root-disk=16G
    expose: true
    num_units: 1
    options:
      channel: 1.17/stable
    resources:
      cdk-addons: 0
      core: 0
      kube-apiserver: 0
      kube-controller-manager: 0
      kube-proxy: 0
      kube-scheduler: 0
      kubectl: 0
    to:
    - '0'
  kubernetes-worker:
    annotations:
      gui-x: '90'
      gui-y: '850'
    charm: cs:~containers/kubernetes-worker-623
    constraints: cores=4 mem=4G root-disk=16G
    expose: true
    num_units: 1
    options:
      channel: 1.17/stable
    resources:
      cni-amd64: 538
      cni-arm64: 529
      cni-s390x: 541
      core: 0
      kube-proxy: 0
      kubectl: 0
      kubelet: 0
    to:
    - '1'
relations:
- - kubernetes-master:kube-api-endpoint
  - kubernetes-worker:kube-api-endpoint
- - kubernetes-master:kube-control
  - kubernetes-worker:kube-control
- - kubernetes-master:certificates
  - easyrsa:client
- - kubernetes-master:etcd
  - etcd:db
- - kubernetes-worker:certificates
  - easyrsa:client
- - etcd:certificates
  - easyrsa:client
- - flannel:etcd
  - etcd:db
- - flannel:cni
  - kubernetes-master:cni
- - flannel:cni
  - kubernetes-worker:cni
- - containerd:containerd
  - kubernetes-worker:container-runtime
- - containerd:containerd
  - kubernetes-master:container-runtime

Kubernetes bundles

A Kubernetes bundle differs from a standard bundle in the following ways:

  • key ‘bundle’ is given the value of ‘kubernetes’
  • key ‘num_units’ is replaced by key ‘scale’
  • key ‘to’ is replaced by key ‘placement’

The value of ‘placement’ is a key=value pair and is used as a Kubernetes node selector.

For example:

bundle: kubernetes
applications:
  mariadb:
    charm: cs:~juju/mariadb-k8s
    scale: 2
    constraints: mem=1G
    options:
        dataset-size: 70%
    storage:
      database: mariadb-pv,20M
  gitlab:
    charm: cs:~juju/gitlab-k8s
    placement: foo=bar
    scale: 1
relations:
  - - gitlab:mysql
    - mariadb:server

Last updated 7 months ago.