Emmanuel Kasper
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # openSHift Running In Managed Podman Kubernetes upstream has KIND, let me introduced SHRIMP, a way to quickly deploy a containerized a Microshift Kubernetes on any Linux system having a podman package. [Microshift](https://next.redhat.com/project/microshift/) is an all in on binary of the OpenShift core components, targeted for edge deployments. The Microshift RPM and the cri-o container runtime are all that you need to run a single node OpenShift/Kubernetes cluster. Alternatively, you can run Microshift inside an all-in-one container, allowing you to run Microshift on any kind of Linux host. This setup is perfect for small lab or developement environements using a minimal amount of resources and this is what were going to cover in this blog post. Note that if you want the whole OpenShift Container Platform experience on your laptop, there is [OpenShift Local](https://developers.redhat.com/products/openshift-local/overview), which comes with the standard Cluster Operators in a VM and gives you the real Platform As A Service environment of OpenShift. A great product, OpenShift Local is nevertheless ressource hungry and will happily consumate four full cores and 8GB of RAM (and kicks the CPU fan of the laptop quite often) Build the container image ------------------------- ~~~ $ git clone git@github.com:openshift/microshift.git $ cd microshift $ make build-containerized-all-in-one-amd64 ~~~ Now publish this container image in a container registry, or use the public image I built in https://quay.io/repository/rhn_support_ekasprzy/microshift-aio Prepare podman to run Microshift in a container ----------------------------------------------- We need to change the storage driver to **vfs**, so that we can start **overlayfs** inside the container: ~~~ cat /etc/containers/storage.conf [storage] driver="vfs" ~~~ We will create a specific bridge for this installation, so that the microshift installation is isolated from other containers: ~~~ sudo podman network create --subnet 10.87.87.0/24 --gateway 10.87.87.1 shrimpnet ~~~ Finally start the container: ~~~ sudo podman run --name shrimp --privileged \ --ip=10.87.87.2 --network=shrimpnet \ --publish 127.0.0.1:6443:6443 --log-level=info \ quay.io/rhn_support_ekasprzy/microshift-aio:4.10.0-0.microshift-2022-09-19-ubi-8.6 ~~~ Verify that the MicroShift installation is running -------------------------------------------------- Once the container is started, verify that we have the cri-o and microshit services running inside the shrimp: ~~~ sudo podman exec shrimp systemctl status cri-o ... systemd[1]: Started Container Runtime Interface for OCI (CRI-O). ~~~ We can now extract the oc client and a kubeconfig to access the API server running inside the container: ~~~ mkdir .kube sudo podman cp shrimp:/var/lib/microshift/resources/kubeadmin/kubeconfig $HOME/.kube/config sudo chown $USER:$USER $HOME/.kube/config sudo podman cp shrimp:/usr/local/bin/oc /usr/local/bin/oc ~~~ We now verify that we have a running API server ~~~ $ oc cluster-info Kubernetes control plane is running at https://127.0.0.1:6443 ~~~ and a running single node cluster ~~~ $ oc get nodes -o wide NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME 0e47b5635d8a Ready <none> 41h v1.21.0 10.87.87.2 <none> Red Hat Enterprise Linux 8.6 (Ootpa) 5.10.0-16-amd64 cri-o://1.23.3 ~~~ as we see from the output above, the node internal IP matches the `--ip` parameter we gave to podman when creating the shrimp Optionally create a systemd unit to run microshift on boot ---------------------------------------------------------- Finally we generate a systemd unit based on the running container, so we can autostart the shrimp on boot ~~~ sudo podman stop shrimp sudo podman generate systemd shrimp | sudo tee -a /etc/systemd/system/shrimp.service ~~~ We can now use the systemd unit to run the shrimp ~~~ sudo systemctl enable --now shrimp ~~~ ~~~ $ systemctl status shrimp ● shrimp.service - Podman container-46fc1b252bb0d0ba707a2210f06783cf28aa1d88faf2de1874b685087640a6fa.serv> Loaded: loaded (/etc/systemd/system/shrimp.service; enabled; vendor preset: enabled) Active: active (running) since Tue 2022-09-06 12:22:24 UTC; 31min ago Docs: man:podman-generate-systemd(1) Process: 255 ExecStart=/usr/bin/podman start 46fc1b252bb0d0ba707a2210f06783cf28aa1d88faf2de1874b6850> Main PID: 518 (conmon) Tasks: 2 (limit: 2339) Memory: 14.9M CPU: 209ms CGroup: /system.slice/shrimp.service └─518 /usr/bin/conmon --api-version 1 -c 46fc1b252bb0d0ba707a2210f06783cf28aa1d88faf2de187 ~~~ Create a sample deployment and access it ---------------------------------------- ~~~ $ oc new-project hello-nginx $ oc create deployment hello-nginx --image=docker.io/library/nginx $ oc create service nodeport hello-nginx --node-port=30003 --tcp=8080:80 $ w3m -dump http://10.87.87.2:30003 Welcome to nginx! ... ~~~

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully