Deploy a basic application

MicroShift operates similar to many other Kubernetes providers. This means that you can use the same tools to deploy and manage your applications.

All of the standard Kubernetes management tools can be used to maintain and modify your MicroShift applications. Below we will show some examples using oc, kustomize, and helm to deploy and maintain applications.

Example Applications

Metal LB

Metal LB is a load balancer that can be used to route traffic to a number of backends.

Creating the Metal LB namespace and deployment.

oc apply -f
oc apply -f

Once the components are available, a ConfigMap is required to define the address pool for the load balancer to use.

Create the Metal LB ConfigMap:

oc create -f - <<EOF
apiVersion: v1
kind: ConfigMap
  namespace: metallb-system
  name: config
  config: |
    - name: default
      protocol: layer2

Now we are able to deploy a test application to verify thing are working as expected.

oc create ns test
oc create deployment nginx -n test --image nginx

Create a service:

oc create -f - <<EOF
apiVersion: v1
kind: Service
  name: nginx
  namespace: test
  annotations: default
  - port: 80
    targetPort: 80
    app: nginx
  type: LoadBalancer

Verify the service exists and that an IP address has been assigned.

oc get svc -n test
NAME    TYPE           CLUSTER-IP      EXTERNAL-IP     PORT(S)        AGE
nginx   LoadBalancer   80:32434/TCP   29m

Using your browser you can now access the NGINX application by the EXTERNAL-IP provided by the service.

Last modified March 27, 2023 at 1:17 PM PST : Redirect to project repo docs (0c61240)
Last modified March 27, 2023 at 1:17 PM PST : Redirect to project repo docs (0c61240)