meta-virtualization/recipes-containers/kubernetes
Bruce Ashfield ebd4e07b77 k8s: update to 1.23.6
Bumping kubernetes to version v1.23.6-rc.0-16-gfbcfa330181, which comprises the following commits:

    1e8f6d51484 Copy request in timeout handler
    edd7a386c61 kube-up: use registry.k8s.io for containerd-related jobs
    3194c87ba25 e2e: Wait only for the service account
    a62ee8e5c3b e2e: Wait for kube-root-ca.crt to be created
    651b1fa1cce Include pod UID in secret/configmap cache key
    33d089b173c Move kubelet secret and configmap manager calls to sync_Pod functions
    7f02733e4d8 test: Verify that nodes do not transition to Failed while ready
    77865d3db93 test: Add E2E for job completions with cpu reservation
    b51d11be7a4 test: Add E2E for init container pod deletion
    290cdbf8792 kubelet: Delay writing a terminal phase until the pod is terminated
    914475e2e9f Update CHANGELOG/CHANGELOG-1.23.md for v1.23.5
    b3b64745789 Release commit for Kubernetes v1.23.6-rc.0
    c285e781331 Release commit for Kubernetes v1.23.5
    01c2f1c6420 Remove apf_fd from httplog
    c52cd9c5920 Update Go to 1.17.8
    1a897af197a cluster/gce: update konnectivity image tags to v0.0.30
    d741174d7e1 bump sigs.k8s.io/apiserver-network-proxy/konnectivity-client@v0.0.30
    0b8199041d1 fix dryrun when ca file exists
    903f164b679 fix regression introduced by PR 100320
    56bfc202e45 Add unit tests
    a5faf0b5ce2 Fix nodes volumesAttached status not updated
    4c85abf90bb Fix default config flags
    1570a75766b test/e2e/framework: include the new control plane taint
    60cd43c44e0 kubelet: Clean up a static pod that has been terminated before starting
    33863be9478 Add an e2e test for updating a static pod while it restarts
    621894de9d6 cronjob_controllerv2: do not filter jobs to be reconciled by labels
    c9f904304d9 kube-proxy: fix duplicate port opening
    f783e573f11 increase Azure ACR credential provider timeout
    ba2cd0ca3db Updating EndpointSlice strategy to retain node name in topology until field is set
    4e69dd88613 fix: do not return early in the node informer when there is no change of the topology label.
    68ea240512a /test/e2e_kubeadm: adjust label checks for 1.23
    2efffd62367 Ignore container notfound error while getPodstatuses
    9f5e25033b6 Update CHANGELOG/CHANGELOG-1.23.md for v1.23.4
    d4b2d8cf961 Release commit for Kubernetes v1.23.5-rc.0
    e6c093d87ea Release commit for Kubernetes v1.23.4
    949798fe712 Add PDB selector patch integration test
    47fc5aea4a2 Revert v1beta1 PodDisruptionBudget select patchStrategy
    ef293a9ee95 test/e2e_kubeadm: fix matching UnversionedKubeletConfigMap defaults
    799ffd58065 kubeadm: fix the bug that 'kubeadm init --dry-run --upload-certs' command failed with 'secret not found' error
    c465ceccb32 Update Go to 1.17.7
    f0eac451011 Use serializable struct for x-kubernetes-validations in openapi
    02d1a291c8b Make JSON schema round tripping test more strict
    30eff360132 ignore CRI PodSandboxNetworkStatus for host network pods
    34a8474e600 set secondary address on host-network pods
    14c399ec5e3 Deeply copy JSONSchemaProps.XValidations.
    9fe0c40c8e5 wrap error from RunCordonOrUncordon
    0d487176d3a Ensure the execHostnameTest() compares hostnames
    733c0ebc7c3 Revert "Fix comparison between FQDN and hostname"
    ebfa08cd39b service REST: Call Decorator(old) on update path
    92d09f90c01 add namespace in azurefile volumeid
    5830d1474ff fix: azurefile volumeid conflict in csi migration
    bce4e5ba5b1 Mark device as uncertain if unmount device succeeds
    4b868d09c98 Update CHANGELOG/CHANGELOG-1.23.md for v1.23.3
    72506a8439c Release commit for Kubernetes v1.23.4-rc.0
    816c97ab8cf Release commit for Kubernetes v1.23.3
    f2c6108f462 kubelet: fix podstatus not containing pod full name
    398effdfe0d Fix bug with node restriction blocking pvc.status.resizestatus change
    6d08a56228a Fix regression pruning array fields with x-kubernetes-preserve-unknown-fields: true
    996d8fca977 Set max results if its not set
    9c31df589b7 Update CHANGELOG/CHANGELOG-1.23.md for v1.23.2
    918dd8343f0 Release commit for Kubernetes v1.23.3-rc.0
    9d142434e3a Release commit for Kubernetes v1.23.2
    4935e0a527e Update k/utils to v0.0.0-20211116205334-6203023598ed
    38e9dce15f4 [go] update to Go 1.17.6
    28ad5463fda fix: remove outdated ipv4 route when the corresponding node is deleted
    dfea07a3b04 fix: delete non existing disk issue
    65b309c76d8 Revert "Automated cherry pick of #107554: Correct the feature gate string for RBD migration."
    677eae51666 fix containers order after applying
    89d8be52ef4 generated: ./hack/update-vendor.sh
    04f3c5793c1 upgrade sigs.k8s.io/structured-merge-diff/v4 to v4.2.1
    8c8fe66f7aa Execute sync before taking the snapshot
    4b1d9d80da7 Correct the feature gate string for RBD migration.
    50e813278cd fix: azuredisk parameter lowercase translation issue
    879947434c0 removed unnecessary log line
    88249a973a8 kubectl: add integration test for result reporting
    16a4de9268a cli: let kubectl handle error printing
    c5365784330 cli: avoid logging command line errors in more cases
    26dae30f913 Fix header mutation race in timeout filter
    81c8d0aad93 clear pod's .status.nominatedNodeName when necessary
    f61c4b18c42 use node informer to check volumes attachment status before backoff
    f4ba875cdfd When volume is not marked in-use, do not backoff
    e36b9382ecd kubeadm: remove the restriction that the ca.crt can only contain one certificate
    f4835a2cd3e flake fix: remove the error handler for cronjob integration test
    962ab763c5e Fix the leak of vSphere client sessions
    cc6c36f286d client-go: Clear the ResourceVersionMatch on paged list calls
    d42a44fcb2f Enabling kube-proxy metrics on windows kernel mode
    e6a8826e992 Remove JSON logging performance regression

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2022-03-28 12:05:00 -04:00
..
kubernetes kubernetes: add sysctl.d configuration 2021-12-15 12:59:12 -05:00
kubernetes_git.bb k8s: update to 1.23.6 2022-03-28 12:05:00 -04:00
README.md kubernetes: add README 2021-12-15 12:55:28 -05:00

k8s: Kubernetes

meta-virtualization provides the recipes and packages suitable for a k8s cluster instance.

For a kubernetes controller:

  • packagegroup-k8s-host

For a kubernetes worker/node:

  • packagegroup-k8s-node

If kernel issues or missing features are detected, consider adding the "kernel-modules" package to your image (Since the configuration and RDEPENDS may not be correct for your kernel + k8s version).

CNI

The CNI base packages provide core support and are installed by default as dependencies of the kubernetes packages. Minimal configuration and startup are provided, but you will need to apply the CNI configuration of your choice after boot (see below fo an example)

Configure and initialize the host

A convenience script "k8s-init" is provided to do basic setup on the controller node. After the contoller boots, run it for kubeadm setup and other basic configuration.

Once the node is ready ('kubectl get nodes' to check), follow the instructions for copying the token to your home directory, and apply the networking configuration of choice (flannel in the example):

  % mkdir -p $HOME/.kube
  % cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
  % chown $(id -u):$(id -g) $HOME/.kube/config

  % kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml

Configuration and initialize the node/worker

Once the kubernetes node has booted, it is ready to join the cluster. Some basica configuration is done via the packages and a systctl.d configuration snippet.

Join the cluster (substitute your controller ip and token information):

kubeadm join <controller ip>:6443 --token cq8ngi.6m6mgqi9zf08ypc4 --discovery-token-ca-cert-hash sha256:6064ae531c8dad824f9eadff030f83ec84d00796fac75f1adbd343255eb34fd2

Notes:

Memory:

if running under qemu, the default of 256M of memory is not enough, k3s will OOM and exit.

Boot with qemuparams="-m 2048" to boot with 2G of memory (or choose the appropriate amount for your configuration)

CPUs:

Kubernetes needs at least two cpus, so ensure your qemuboot is smp of at least 2, and/or that your hardware has the required capabilties.

Disk:

if using qemu and core-image* you'll need to add extra space in your disks to ensure containers can start. The following in your image recipe, or local.conf would add 2G of extra space to the rootfs:

IMAGE_ROOTFS_EXTRA_SPACE = "2097152"

Example qemux86-64 boot line:

runqemu qemux86-64 nographic kvm slirp qemuparams="-m 2048"

k8s logs can be seen via:

% journalctl -u kubelet

or

% journalctl -xe

Example output from qemux86-64:

If you've lost the join token, you can create a new one, or list existing ones:

root@qemux86-64-7b:~# kubeadm token create --print-join-command
kubeadm join 10.10.10.117:6443 --token dr71zq.y5vi3s2n2antvcej --discovery-token-ca-cert-hash sha256:6064ae531c8dad824f9eadff030f83ec84d00796fac75f1adbd343255eb34fd2

root@qemux86-64-7b:~# kubeadm token list
TOKEN                     TTL         EXPIRES                USAGES                   DESCRIPTION                                                EXTRA GROUPS
cq8ngi.6m6mgqi9zf08ypc4   23h         2021-12-16T16:58:02Z   authentication,signing   The default bootstrap token generated by 'kubeadm init'.   system:bootstrappers:kubeadm:default-node-token
dr71zq.y5vi3s2n2antvcej   23h         2021-12-16T17:46:28Z   authentication,signing   <none>                                                     system:bootstrappers:kubeadm:default-node-token
root@qemux86-64:~# kubectl get nodes
NAME            STATUS   ROLES                  AGE   VERSION
qemux86-64-7b   Ready    control-plane,master   51m   v1.23.1-rc.0.1+dd1b0a12471310-dirty
qemux86-64-9d   Ready    <none>                 49m   v1.23.1-rc.0.1+dd1b0a12471310-dirty