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

docs: add microshift podman desktop example blog #9031

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

cdrage
Copy link
Contributor

@cdrage cdrage commented Sep 23, 2024

docs: add microshift podman desktop example blog

What does this PR do?

  • Creates a bootc blog using microshift and podman desktop
  • Blog covers how to create a microshift container with RHEL / Red Hat
    tools and then create it all via Podman Desktop

Screenshot / video of UI

N/A

What issues does this PR fix or reference?

Closes containers/podman-desktop-extension-bootc#816

How to test this PR?

Follow the steps.

N/A on unit tests

Signed-off-by: Charlie Drage [email protected]

@cdrage cdrage requested review from slemeur, benoitf and a team as code owners September 23, 2024 17:37
@cdrage cdrage requested review from feloy, axel7083 and SoniaSandler and removed request for a team September 23, 2024 17:37
@slemeur
Copy link
Collaborator

slemeur commented Sep 27, 2024

cc @vrothberg to review the content

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

LGTM, nice work!

Did you loop in MicroShift folks?

website/blog/2024-09-19-bootc-microshift.md Outdated Show resolved Hide resolved
@cdrage
Copy link
Contributor Author

cdrage commented Sep 27, 2024

LGTM, nice work!

Did you loop in MicroShift folks?

Pinged them on slack!

- Access to an [OpenShift Hybrid Cloud pull secret](https://console.redhat.com/openshift/install/pull-secret)
- [Podman Desktop installed](https://podman-desktop.io/downloads)
- [Podman Desktop BootC Extension](https://github.com/containers/podman-desktop-extension-bootc)
- Your preferred VM-running software (e.g., [using libvirt](https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/8/html/configuring_and_managing_virtualization/getting-started-with-virtualization-in-rhel-8_configuring-and-managing-virtualization#enabling-virtualization-in-rhel8_virt-getting-started) or [qemu](https://www.qemu.org/))

Choose a reason for hiding this comment

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

We should probably point to RHEL 9 docs here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ggiguash can you provide a link if possible?

Copy link

Choose a reason for hiding this comment

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

@cdrage , does this work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahhh got it! thank you.

Comment on lines 66 to 79
# For simplicity, we echo the repo location for to /etc/yum.repos.d/minishift.repo
RUN echo -e '# OpenShift 4.17 release\n\
[ocp]\n\
name=OpenShift 4.17\n\
baseurl=https://mirror.openshift.com/pub/openshift-v4/$basearch/microshift/ocp/latest-4.17/el9/os/\n\
enabled=1\n\
gpgcheck=0\n\
\n\
# Dependencies\n\
[ocp-deps]\n\
name=OpenShift 4.17 dependencies\n\
baseurl=https://mirror.openshift.com/pub/openshift-v4/$basearch/dependencies/rpms/4.17-el9-beta/\n\
enabled=1\n\
gpgcheck=0' > /etc/yum.repos.d/minishift.repo

Choose a reason for hiding this comment

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

Is there a reason we're pointing to pre-release MicroShift repositories?
I think we should install a released version of MicroShift as described here.

Comment on lines 82 to 85
RUN dnf install -y microshift

# Enable MicroShift on boot
RUN systemctl enable microshift

Choose a reason for hiding this comment

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

These layers better be squashed. See the previous comment.

Comment on lines 88 to 90
ARG OPENSHIFT_PULL_SECRET
RUN echo $OPENSHIFT_PULL_SECRET > /etc/crio/openshift-pull-secret
RUN chmod 600 /etc/crio/openshift-pull-secret

Choose a reason for hiding this comment

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

I'm not sure we should recommend embedding private secrets into container images (or VMs).
Can we set up the pull secret at runtime as described here?

- Your public SSH key (if available) so you may remotely access your build
- An [OpenShift Hybrid Cloud pull secret](https://console.redhat.com/openshift/install/pull-secret)

Pass these as `SSH_PUBLIC_KEY` and `OPENSHIFT_PULL_SECRET` in the build page arguments.

Choose a reason for hiding this comment

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

We should not pass secrets at build time and store them in the image.

With the above `qemu` command, a port has now been opened locally at :2222 to SSH forward to the bootable image. You can now access your virtual machine by doing the following:

```sh
$ sh localhost -p 2222

Choose a reason for hiding this comment

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

Suggested change
$ sh localhost -p 2222
$ ssh localhost -p 2222

With the above `qemu` command, a port has now been opened locally at :2222 to SSH forward to the bootable image. You can now access your virtual machine by doing the following:

```sh
$ sh localhost -p 2222

Choose a reason for hiding this comment

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

Suggested change
$ sh localhost -p 2222
$ ssh localhost -p 2222

1. SSH into the VM:

```sh
$ sh localhost -p 2222

Choose a reason for hiding this comment

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

Suggested change
$ sh localhost -p 2222
$ ssh localhost -p 2222

@cdrage cdrage marked this pull request as draft September 30, 2024 12:12
@cdrage cdrage force-pushed the microshift-blog branch 2 times, most recently from 055b9b4 to c3e498f Compare October 1, 2024 20:16
@cdrage cdrage marked this pull request as ready for review October 7, 2024 14:17
@cdrage
Copy link
Contributor Author

cdrage commented Oct 7, 2024

I have updated the PR:

  • Steps for copying over the secret is now added, as to not include the secret when building
  • Updates to the password / username (we login with redhat/pass now)
  • Use the Containerfile from the official microshift docs which is accessible via downloading by curl / clicking the link.

@ggiguash

### What does this PR do?

* Creates a bootc blog using microshift and podman desktop
* Blog covers how to create a microshift container with RHEL / Red Hat
  tools and then create it all via Podman Desktop

### Screenshot / video of UI

<!-- If this PR is changing UI, please include
screenshots or screencasts showing the difference -->

N/A

### What issues does this PR fix or reference?

<!-- Include any related issues from Podman Desktop
repository (or from another issue tracker). -->

Closes containers/podman-desktop-extension-bootc#816

### How to test this PR?

<!-- Please explain steps to verify the functionality,
do not forget to provide unit/component tests -->

Follow the steps.

N/A on unit tests

Signed-off-by: Charlie Drage <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show demo on using bootc + podman desktop + microshift
5 participants