Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tutorial showing how to run CRI-O in kind #8170

Merged
merged 1 commit into from
May 22, 2024

Conversation

roman-kiselenko
Copy link
Member

@roman-kiselenko roman-kiselenko commented May 13, 2024

What type of PR is this?

/kind documentation

What this PR does / why we need it:

Small tutorial: How to run CRI-O as container runtime in kind.

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

None

Does this PR introduce a user-facing change?

None

@openshift-ci openshift-ci bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. kind/documentation Categorizes issue or PR as related to documentation. labels May 13, 2024
@openshift-ci openshift-ci bot requested review from hasan4791 and wgahnagl May 13, 2024 17:26
@roman-kiselenko
Copy link
Member Author

@cri-o/cri-o-maintainers PTAL 🙏

Copy link

codecov bot commented May 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 49.54%. Comparing base (9712c53) to head (1e12bed).
Report is 40 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8170      +/-   ##
==========================================
- Coverage   49.58%   49.54%   -0.04%     
==========================================
  Files         153      153              
  Lines       16930    16961      +31     
==========================================
+ Hits         8394     8404      +10     
- Misses       7489     7510      +21     
  Partials     1047     1047              

@haircommander
Copy link
Member

thanks! you've got some markdown lint failures

@kwilczynski kwilczynski changed the title Tutorial how to run CRI-O in KIND Add tutorial how to run CRI-O in kind May 14, 2024
@kwilczynski kwilczynski changed the title Add tutorial how to run CRI-O in kind Add tutorial showing how to run CRI-O in kind May 14, 2024
tutorial.md Outdated Show resolved Hide resolved
@kwilczynski
Copy link
Member

@roman-kiselenko, given that it's based on your excellent blog post, feel free to ignore my suggestions for the changes to the way how "kind" is styled.

@roman-kiselenko roman-kiselenko force-pushed the docs/crio-in-kind branch 6 times, most recently from 07a5a0b to 760e5c7 Compare May 14, 2024 13:04
Copy link

@maiqueb maiqueb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. Amazing. Managed to create the cluster with the provided information.

One quick remark though; I have faced an issue with my configuration (I had docker configured to use buildx ...). I could not build the crio image if using buildx ...

Not sure if you want to highlight that.

Thanks again.

@mrunalp
Copy link
Member

mrunalp commented May 14, 2024

Awesome! We could keep this updated for newer versions on main branch and release branches will retain version specific instructions.


<!-- markdownlint-disable MD013 -->
```sh
$ kind create cluster --image kindnode/crio:$CRIO_VERSION --config ./kind-crio.yaml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to use podman for running the cluster as an alternative to docker?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK yes ... BUT generating the node and base images requires docker. Or used to require :)

Probably better if someone confirmed this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, AFAIK, there is a lot of different options, and by leveraging KIND_EXPERIMENTAL_PROVIDER variable, you can create a cluster with different runtimes:

  • podman
  • nerdctl.lima
  • finch
  • nerdctl

@kwilczynski
Copy link
Member

One quick remark though; I have faced an issue with my configuration (I had docker configured to use buildx ...). I could not build the crio image if using build ...

@maiqueb, what sort of issue shave you had? Any errors you can share we could have a look at?

This might be something we want to fix, potentially.

@maiqueb
Copy link

maiqueb commented May 15, 2024

One quick remark though; I have faced an issue with my configuration (I had docker configured to use buildx ...). I could not build the crio image if using build ...

@maiqueb, what sort of issue shave you had? Any errors you can share we could have a look at?

This might be something we want to fix, potentially.

Sure thing @kwilczynski. The error happens when I try to build the CRIO img from the node image:

➜  new-cni-verbs-demo docker build --build-arg CRIO_VERSION=$CRIO_VERSION -t kindnode/crio:$CRIO_VERSION .
[+] Building 1.4s (2/2) FINISHED                                                                                    docker-container:kind-builder
 => [internal] load build definition from Dockerfile                                                                                         0.0s
 => => transferring dockerfile: 977B                                                                                                         0.0s
 => ERROR [internal] load metadata for docker.io/kindest/node:latest                                                                         1.2s
------
 > [internal] load metadata for docker.io/kindest/node:latest:
------
WARNING: No output specified with docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load
Dockerfile:1
--------------------
   1 | >>> FROM kindest/node:latest
   2 |     
   3 |     ARG CRIO_VERSION
--------------------
ERROR: failed to solve: kindest/node:latest: failed to resolve source metadata for docker.io/kindest/node:latest: docker.io/kindest/node:latest: not found

# I'm using buildx
➜  new-cni-verbs-demo cat ~/.docker/config.json      
{
	"auths": {},
	"aliases": {
		"builder": "buildx"
	}
}# 

The weird thing IMO is the image is actually available in docker images:

➜  new-cni-verbs-demo docker images
REPOSITORY                                  TAG                                              IMAGE ID       CREATED         SIZE
...
kindest/node                                latest                                           7acfe6ceb949   28 hours ago    1.06GB
...

This was "fixed" by ... not using buildx :)

➜  new-cni-verbs-demo mv ~/.docker/config.json ~/.docker/config.jsonBACKUP 
➜  new-cni-verbs-demo docker build --build-arg CRIO_VERSION=$CRIO_VERSION -t kindnode/crio:$CRIO_VERSION .
[+] Building 0.3s (6/6) FINISHED                                                                                                   docker:default
 => [internal] load build definition from Dockerfile                                                                                         0.0s
 => => transferring dockerfile: 977B                                                                                                         0.0s
 => [internal] load metadata for docker.io/kindest/node:latest                                                                               0.0s
 => [internal] load .dockerignore                                                                                                            0.0s
 => => transferring context: 2B                                                                                                              0.0s
 => [1/2] FROM docker.io/kindest/node:latest                                                                                                 0.0s
 => CACHED [2/2] RUN echo "Installing Packages ..."     && apt-get clean     && apt-get update -y     && DEBIAN_FRONTEND=noninteractive apt  0.0s
 => exporting to image                                                                                                                       0.0s
 => => exporting layers                                                                                                                      0.0s
 => => writing image sha256:fe153b4a09c05031acc6dc4dc09ec5563df58f5d9332320b17a859918b0caf84                                                 0.0s
 => => naming to docker.io/kindnode/crio:v1.30              

I've also tried to use --load when building, to no avail:

➜  new-cni-verbs-demo mv ~/.docker/config.jsonBACKUP ~/.docker/config.json 
➜  new-cni-verbs-demo docker build --build-arg CRIO_VERSION=$CRIO_VERSION --load -t kindnode/crio:$CRIO_VERSION .
[+] Building 0.6s (2/2) FINISHED                                                                                    docker-container:kind-builder
 => [internal] load build definition from Dockerfile                                                                                         0.0s
 => => transferring dockerfile: 977B                                                                                                         0.0s
 => ERROR [internal] load metadata for docker.io/kindest/node:latest                                                                         0.4s
------
 > [internal] load metadata for docker.io/kindest/node:latest:
------
Dockerfile:1
--------------------
   1 | >>> FROM kindest/node:latest
   2 |     
   3 |     ARG CRIO_VERSION
--------------------
ERROR: failed to solve: kindest/node:latest: failed to resolve source metadata for docker.io/kindest/node:latest: docker.io/kindest/node:latest: not found

Signed-off-by: roman-kiselenko <roman.kiselenko.dev@gmail.com>
@roman-kiselenko
Copy link
Member Author

roman-kiselenko commented May 17, 2024

@maiqueb Thank you for your tip; I've added the note about buildx.

Copy link
Contributor

openshift-ci bot commented May 22, 2024

@maiqueb: changing LGTM is restricted to collaborators

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@haircommander
Copy link
Member

/approve

LGTM, thank you!
@cri-o/cri-o-maintainers PTAL

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 22, 2024
@kwilczynski
Copy link
Member

/approve
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 22, 2024
Copy link
Contributor

openshift-ci bot commented May 22, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: haircommander, kwilczynski, maiqueb, roman-kiselenko

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 747c152 into cri-o:main May 22, 2024
52 of 53 checks passed
@roman-kiselenko roman-kiselenko deleted the docs/crio-in-kind branch May 23, 2024 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. kind/documentation Categorizes issue or PR as related to documentation. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants