mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 21:46:22 +01:00
91 lines
1.8 KiB
Plaintext
91 lines
1.8 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * microshift/running_applications/microshift-applications.adoc
|
|
|
|
:_content-type: PROCEDURE
|
|
[id="microshift-applying-manifests-example_{context}"]
|
|
= Using manifests example
|
|
This example demonstrates automatic deployment of a BusyBox container using `kustomize` manifests in the `/etc/microshift/manifests` directory.
|
|
|
|
.Procedure
|
|
. Create the BusyBox manifest files by running the following commands:
|
|
+
|
|
.. Define the directory location:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ MANIFEST_DIR=/etc/microshift/manifests
|
|
----
|
|
+
|
|
.. Make the directory:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ sudo mkdir -p ${MANIFEST_DIR}
|
|
----
|
|
+
|
|
.. Place the YAML file in the directory:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ 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
|
|
namespace:busybox
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
app: busybox
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: busybox
|
|
spec:
|
|
containers:
|
|
- name: busybox
|
|
image: BUSYBOX_IMAGE
|
|
command:
|
|
- sleep
|
|
- "3600"
|
|
EOF
|
|
----
|
|
|
|
. Next, create the `kustomize` manifest files by running the following commands:
|
|
+
|
|
.. Place the YAML file in the directory:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ 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: busybox:1.35
|
|
EOF
|
|
----
|
|
|
|
. Restart {product-title} to apply the manifests by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ sudo systemctl restart microshift
|
|
----
|
|
+
|
|
. Apply the manifests and start the `busybox` pod by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc get pods -n busybox
|
|
----
|