Open ben-xD opened 1 year ago
Hi @ben-xD
The binaries for all services that are included with MicroK8s (etcd, flanneld, containerd, helm, etc) can be found in /snap/microk8s/current/bin
. Some ways to retrieve
It is possible to retrieve this version by calling the binary directly with the --version
flag, e.g.
$ /snap/microk8s/current/bin/containerd --version
containerd github.com/containerd/containerd v1.6.15 5b842e528e99d4d4c1686467debf2bd4b88ecd86
$ /snap/microk8s/current/opt/cni/bin/flanneld --version
v0.15.1
The version of each component that MicroK8s is using is defined in build-scripts/components/<component>/version.sh
. For example, for flanneld this is https://github.com/ubuntu/microk8s/blob/master/scripts/components/flanneld/version.sh#L3. Note that this is latest master. For versioned releases, see the respective branch. For example, for 1.25 https://github.com/ubuntu/microk8s/blob/1.25/build-scripts/components/flanneld/version.sh#L3
There have been some discussions in the past to extend the microk8s version
command with something like an --all
flag which would print the versions of all included components as well. That would be mostly a convenience wrapper around the first option.
I am not too sure if that would be useful, since the possible changes and breaking backwards compatibility of its output format would invalidate any of its benefits.
Happy to get your opinion on this if 1 or 2 are not helping, and how a possible extension to the microk8s version
command could make things easier.
Thanks!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Got here from stalebot, we are now doing this in MicroK8s in the form of a bom.json file explaining how MicroK8s was built:
The bom.json
file is always included in microk8s inspection reports, which you can generate with microk8s inspect
An example bom.json
looks like this:
{
"microk8s": {
"version": "1.29",
"revision": "b25957fe365f9382ff5626c381a1f8093beee868"
},
"tools": {
"go": [
"go version go1.21.5 linux/amd64"
],
"gcc": [
"gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0",
"Copyright (C) 2019 Free Software Foundation, Inc.",
"This is free software; see the source for copying conditions. There is NO",
"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
],
"python": [
"Python 3.8.10 (default, Nov 22 2023, 10:22:35) ",
"[GCC 9.4.0]"
],
"python-requirements": [
"attrs==23.1.0",
"certifi==2019.11.28",
"chardet==3.0.4",
"Click==7.0",
"colorama==0.4.3",
"cryptography==2.8",
"idna==2.8",
"jsonschema==4.0.0",
"netifaces==0.10.9",
"pyOpenSSL==19.0.0",
"pyrsistent==0.20.0",
"python-dateutil==2.7.3",
"PyYAML==6.0.1",
"requests==2.22.0",
"six==1.14.0",
"urllib3==1.25.8"
]
},
"components": {
"cluster-agent": {
"repository": "https://github.com/canonical/microk8s-cluster-agent",
"version": "main",
"revision": "664ceaa4b5a4942ac51ae3cd9ad8e25a322d88b6",
"patches": []
},
"cni": {
"repository": "https://github.com/containernetworking/plugins",
"version": "v1.2.0",
"revision": "d13b1442dc19b62e4fc07409159823a5ed51aff5",
"patches": [
"build-scripts/components/cni/patches/default/0001-single-entrypoint-for-cni-tools.patch"
]
},
"containerd": {
"repository": "https://github.com/containerd/containerd",
"version": "v1.6.15",
"revision": "d01edcafe71d22954a8db2b17af60791a0b63aba",
"patches": [
"build-scripts/components/containerd/patches/default/0001-microk8s-sideload-images-plugin.patch"
]
},
"etcd": {
"repository": "https://github.com/etcd-io/etcd",
"version": "v3.5.5",
"revision": "19002cfc689fba2b8f56605e5797bf79f8b61fdd",
"patches": []
},
"flannel-cni-plugin": {
"repository": "https://github.com/flannel-io/cni-plugin",
"version": "v1.1.2",
"revision": "18a3027e7d03feeb6ecdfdbc3bf254a8c8b38b04",
"patches": []
},
"flanneld": {
"repository": "https://github.com/flannel-io/flannel",
"version": "v0.21.2",
"revision": "ed6f4af2e1a50a5f43fcdd849296d78bb6ea1360",
"patches": [
"build-scripts/components/flanneld/patches/default/0001-disable-udp-backend.patch"
]
},
"helm": {
"repository": "https://github.com/helm/helm",
"version": "v3.9.1",
"revision": "4edefda5c1d60fda05c692d22d27dbd3adb7938d",
"patches": [
"build-scripts/components/helm/patches/default/0001-disable-warnings-for-kubeconfig-permissions.patch"
]
},
"k8s-dqlite": {
"repository": "https://github.com/canonical/k8s-dqlite",
"version": "master",
"revision": "02a9ad7ebfa2698137a3509734d36307152d74e0",
"patches": []
},
"kubernetes": {
"repository": "https://github.com/kubernetes/kubernetes",
"version": "v1.29.0",
"revision": "5c566ca8ab4dbc47e155dec70b47fd080a1462af",
"patches": [
"build-scripts/components/kubernetes/patches/v1.28.0/0000-Kubelite-integration.patch",
"build-scripts/components/kubernetes/patches/v1.28.0/0001-Set-log-reapply-handling-to-ignore-unchanged.patch"
]
},
"runc": {
"repository": "https://github.com/opencontainers/runc",
"version": "v1.1.4",
"revision": "5fd4c4d144137e991c4acebb2146ab1483a97925",
"patches": []
}
},
"addons": {
"community": {
"repository": "https://github.com/canonical/microk8s-community-addons",
"version": "main",
"revision": "dff5e323a7d32d7e58138d7d5c7e93e5a0dc14a1"
},
"core": {
"repository": "https://github.com/canonical/microk8s-core-addons",
"version": "main",
"revision": "4044a14022913d3d7ae26b8869c52eb1b6924bd4"
}
}
}
Microk8s uses a few services, listed on https://microk8s.io/docs/configuring-services. For example, flanneld: https://github.com/flannel-io/flannel
Please let users find out the version of services used. Which version of flanneld is used? If this is already possible, please document it or let me know.
Why is this important?
If I know the version of the service, I can use the correct version of the documentation, so I can configure it properly. It also helps debug certain behaviour. I can also report issues about specific versions - improves bug reports.