Running applications


Red Hat build of MicroShift 4.12

Running applications in MicroShift

Red Hat OpenShift Documentation Team

Abstract

This document provides details about how to run applications in MicroShift.

Chapter 1. Application deployment with Red Hat build of MicroShift

You can use the kustomize configuration management tool to deploy applications. Read through the following procedure for an example of how this tool works in Red Hat build of MicroShift.

1.1. How manifests work with kustomize

The kustomize configuration management tool is integrated with Red Hat build of MicroShift. At every start, Red Hat build of MicroShift searches the /etc/microshift/manifests and /usr/lib/microshift/ manifest directories for a kustomization.yaml file. If it finds one, Red Hat build of MicroShift automatically runs the equivalent of the kubectl apply -k command to apply the identified manifests to the cluster.

LocationIntent

/etc/microshift/manifests

Read-write location for configuration management systems or development.

/usr/lib/microshift/manifests

Read-only location for embedding configuration manifests on OSTree-based systems.

1.2. Using manifests example

This example demonstrates automatic deployment of a BusyBox container using kustomize manifests in the /etc/microshift/manifests directory.

Procedure

  1. Create the BusyBox manifest files by running the following commands:

    1. Define the directory location:

      Copy to Clipboard Toggle word wrap
      $ MANIFEST_DIR=/etc/microshift/manifests
    2. Make the directory:

      Copy to Clipboard Toggle word wrap
      $ sudo mkdir -p ${MANIFEST_DIR}
    3. Place the YAML file in the directory:

      Copy to Clipboard Toggle word wrap
      $ sudo tee ${MANIFEST_DIR}/busybox.yaml &>/dev/null <<EOF
      
      apiVersion: v1
      kind: Namespace
      metadata:
        name: busybox
      ---
      apiVersion: apps/v1
      kind: Deployment
      metadata:
        name: busybox-deployment
      spec:
        selector:
          matchLabels:
            app: busybox
        template:
          metadata:
            labels:
              app: busybox
          spec:
            containers:
            - name: busybox
              image: BUSYBOX_IMAGE
              command:
                - sleep
                - "3600"
      EOF
  2. Next, create the kustomize manifest files by running the following commands:

    1. Place the YAML file in the directory:

      Copy to Clipboard Toggle word wrap
      $ sudo tee ${MANIFEST_DIR}/kustomization.yaml &>/dev/null <<EOF
      ---
      apiVersion: kustomize.config.k8s.io/v1beta1
      kind: Kustomization
      namespace: busybox
      resources:
        - busybox.yaml
      images:
        - name: BUSYBOX_IMAGE
          newName: registry.k8s.io/busybox
      EOF
  3. Restart Red Hat build of MicroShift to apply the manifests by running the following command:

    Copy to Clipboard Toggle word wrap
    $ sudo systemctl restart microshift
  4. Apply the manifests and start the busybox pod by running the following command:

    Copy to Clipboard Toggle word wrap
    $ oc get pods -n busybox

Chapter 2. How Operators work with Red Hat build of MicroShift

You can use Operators with Red Hat build of MicroShift to create applications that monitor the running services in your cluster. Operators can manage applications and their resources, such as deploying a database or message bus. As customized software running inside your cluster, Operators can be used to implement and automate common operations.

Operators offer a more localized configuration experience and integrate with Kubernetes APIs and CLI tools such as kubectl and oc. Operators are designed specifically for your applications. Operators enable you to configure components instead of modifying a global configuration file.

Red Hat build of MicroShift applications are generally expected to be deployed in static environments. However, Operators are available if helpful in your use case. To determine an Operator’s compatibility with Red Hat build of MicroShift, check the Operator’s documentation.

To minimize the footprint of Red Hat build of MicroShift, Operators are installed directly with manifests instead of using the Operator Lifecycle Manager (OLM). The following examples provide instructions on how you can use the kustomize configuration management tool with Red Hat build of MicroShift to deploy an application. Use the same steps to install Operators with manifests.

2.1. How manifests work with kustomize

The kustomize configuration management tool is integrated with Red Hat build of MicroShift. At every start, Red Hat build of MicroShift searches the /etc/microshift/manifests and /usr/lib/microshift/ manifest directories for a kustomization.yaml file. If it finds one, Red Hat build of MicroShift automatically runs the equivalent of the kubectl apply -k command to apply the identified manifests to the cluster.

LocationIntent

/etc/microshift/manifests

Read-write location for configuration management systems or development.

/usr/lib/microshift/manifests

Read-only location for embedding configuration manifests on OSTree-based systems.

2.2. Using manifests example

This example demonstrates automatic deployment of a BusyBox container using kustomize manifests in the /etc/microshift/manifests directory.

Procedure

  1. Create the BusyBox manifest files by running the following commands:

    1. Define the directory location:

      Copy to Clipboard Toggle word wrap
      $ MANIFEST_DIR=/etc/microshift/manifests
    2. Make the directory:

      Copy to Clipboard Toggle word wrap
      $ sudo mkdir -p ${MANIFEST_DIR}
    3. Place the YAML file in the directory:

      Copy to Clipboard Toggle word wrap
      $ sudo tee ${MANIFEST_DIR}/busybox.yaml &>/dev/null <<EOF
      
      apiVersion: v1
      kind: Namespace
      metadata:
        name: busybox
      ---
      apiVersion: apps/v1
      kind: Deployment
      metadata:
        name: busybox-deployment
      spec:
        selector:
          matchLabels:
            app: busybox
        template:
          metadata:
            labels:
              app: busybox
          spec:
            containers:
            - name: busybox
              image: BUSYBOX_IMAGE
              command:
                - sleep
                - "3600"
      EOF
  2. Next, create the kustomize manifest files by running the following commands:

    1. Place the YAML file in the directory:

      Copy to Clipboard Toggle word wrap
      $ sudo tee ${MANIFEST_DIR}/kustomization.yaml &>/dev/null <<EOF
      ---
      apiVersion: kustomize.config.k8s.io/v1beta1
      kind: Kustomization
      namespace: busybox
      resources:
        - busybox.yaml
      images:
        - name: BUSYBOX_IMAGE
          newName: registry.k8s.io/busybox
      EOF
  3. Restart Red Hat build of MicroShift to apply the manifests by running the following command:

    Copy to Clipboard Toggle word wrap
    $ sudo systemctl restart microshift
  4. Apply the manifests and start the busybox pod by running the following command:

    Copy to Clipboard Toggle word wrap
    $ oc get pods -n busybox

Legal Notice

Copyright © 2023 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.
Back to top
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2025 Red Hat, Inc.