Kubic:Development

Jump to: navigation, search

Development and contribution

Community

Development environment

To set up virtual machines with Kubic locally, please use the kubic-terraform-kvm project and refer to the README.

Submitting new container images

This instruction assumes that you know how openSUSE Build System works and you have the `osc` tool configured. If not, please refer to the Build Service Tutorial.

Fetch the whole project to your local workstation:

mkdir obs
cd obs
for image in $(osc ls devel:kubic:containers); do osc bco devel:kubic:containers $image; done
cd home\:*:branches:devel:kubic:containers

Make a new OBS package with the name of the container image which is following the naming convention: kubic-$name-image

osc mkpac kubic-cilium-image

Then we need to create a _service file. Instead of writing one from scratch, it is recommended to copy another one taken from another image and then modify it accordingly.

cd kubic-cilium-image
cp ../kubic-hyperkube-image/_service .

Now replace all the strings called hyperkube with your own (e.g. %s/hyperkube/cilium/g). Last but not least, we have to make sure that our container image is going to be named after the RPM package that contains.

For this, look at the <service name="replace_using_package_version" mode="buildtime"> section and replace the <param name="package"> with your own.

e.g.

- <param name="package">etcd</param>
+ <param name="package">cilium</param>

Also there is another important section we need to pay attention into. Sometime, the sources include a root folder along with a config.sh. To include then we have to tell OBS about it. Here's an example of such an incident derived from the traefik image:

<service name="obs_scm" mode="disabled">
<param name="url">https://github.com/kubic-project/container-images.git</param>
    <param name="scm">git</param>
    <param name="subdir">traefik-image</param>
    <param name="extract">traefik-image.kiwi.ini</param>
    <param name="extract">config.sh</param>
    <param name="exclude">root</param>
    <param name="revision">master</param>
    <param name="versionformat">%cd</param>
</service>
<service name="obs_scm" mode="disabled">
    <param name="url">https://github.com/kubic-project/container-images.git</param>
    <param name="scm">git</param>
    <param name="extract">pre_checkin.sh</param>
    <param name="revision">master</param>
    <param name="versionformat">%cd</param>
</service>
<service name="obs_scm" mode="disabled">
    <param name="url">https://github.com/kubic-project/container-images.git</param>
    <param name="scm">git</param>
    <param name="subdir">traefik-image/root</param>
    <param name="filename">root</param>
    <param name="version">_none_</param>
    <param name="revision">master</param>
</service>