1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00

OSDOCS-8389 Lab overview section

This commit is contained in:
xJustin
2024-01-23 06:53:00 -05:00
committed by openshift-cherrypick-robot
parent 881779a145
commit bc2d0993d4
4 changed files with 281 additions and 0 deletions

View File

@@ -163,6 +163,8 @@ Topics:
File: cloud-experts-deploying-application-intro
- Name: Prerequisites
File: cloud-experts-deploying-application-prerequisites
- Name: Lab Overview
File: cloud-experts-deploying-application-lab-overview
---
Name: Getting started
Dir: rosa_getting_started

View File

@@ -0,0 +1,279 @@
:_mod-docs-content-type: ASSEMBLY
[id="cloud-experts-deploying-application-lab-overview"]
= Tutorial: Deploying an application
include::_attributes/attributes-openshift-dedicated.adoc[]
:context: cloud-experts-deploying-application-intro
toc::[]
//rosaworkshop.io content metadata
//Brought into ROSA product docs 22-JAN-2024
== Lab overview
=== Lab resources
* link:https://github.com/openshift-cs/ostoy[Source code for the OSToy application]
* link:https://quay.io/ostoylab/ostoy-frontend[OSToy front-end container image]
* link:https://quay.io/ostoylab/ostoy-microservice[OSToy microservice container image]
* Deployment Definition YAML files:
+
.`ostoy-frontend-deployment.yaml`
+
[source,yaml]
----
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: ostoy-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: ostoy-frontend
labels:
app: ostoy
spec:
selector:
matchLabels:
app: ostoy-frontend
strategy:
type: Recreate
replicas: 1
template:
metadata:
labels:
app: ostoy-frontend
spec:
# Uncomment to use with ACK portion of the workshop
# If you chose a different service account name please replace it.
# serviceAccount: ostoy-sa
containers:
- name: ostoy-frontend
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
capabilities:
drop:
- ALL
image: quay.io/ostoylab/ostoy-frontend:1.6.0
imagePullPolicy: IfNotPresent
ports:
- name: ostoy-port
containerPort: 8080
resources:
requests:
memory: "256Mi"
cpu: "100m"
limits:
memory: "512Mi"
cpu: "200m"
volumeMounts:
- name: configvol
mountPath: /var/config
- name: secretvol
mountPath: /var/secret
- name: datavol
mountPath: /var/demo_files
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 10
periodSeconds: 5
env:
- name: ENV_TOY_SECRET
valueFrom:
secretKeyRef:
name: ostoy-secret-env
key: ENV_TOY_SECRET
- name: MICROSERVICE_NAME
value: OSTOY_MICROSERVICE_SVC
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
volumes:
- name: configvol
configMap:
name: ostoy-configmap-files
- name: secretvol
secret:
defaultMode: 420
secretName: ostoy-secret
- name: datavol
persistentVolumeClaim:
claimName: ostoy-pvc
---
apiVersion: v1
kind: Service
metadata:
name: ostoy-frontend-svc
labels:
app: ostoy-frontend
spec:
type: ClusterIP
ports:
- port: 8080
targetPort: ostoy-port
protocol: TCP
name: ostoy
selector:
app: ostoy-frontend
---
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: ostoy-route
spec:
to:
kind: Service
name: ostoy-frontend-svc
---
apiVersion: v1
kind: Secret
metadata:
name: ostoy-secret-env
type: Opaque
data:
ENV_TOY_SECRET: VGhpcyBpcyBhIHRlc3Q=
---
kind: ConfigMap
apiVersion: v1
metadata:
name: ostoy-configmap-files
data:
config.json: '{ "default": "123" }'
---
apiVersion: v1
kind: Secret
metadata:
name: ostoy-secret
data:
secret.txt: VVNFUk5BTUU9bXlfdXNlcgpQQVNTV09SRD1AT3RCbCVYQXAhIzYzMlk1RndDQE1UUWsKU01UUD1sb2NhbGhvc3QKU01UUF9QT1JUPTI1
type: Opaque
----
+
.`ostoy-microservice-deployment.yaml`
+
[source,yaml]
----
apiVersion: apps/v1
kind: Deployment
metadata:
name: ostoy-microservice
labels:
app: ostoy
spec:
selector:
matchLabels:
app: ostoy-microservice
replicas: 1
template:
metadata:
labels:
app: ostoy-microservice
spec:
containers:
- name: ostoy-microservice
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
capabilities:
drop:
- ALL
image: quay.io/ostoylab/ostoy-microservice:1.5.0
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
protocol: TCP
resources:
requests:
memory: "128Mi"
cpu: "50m"
limits:
memory: "256Mi"
cpu: "100m"
---
apiVersion: v1
kind: Service
metadata:
name: ostoy-microservice-svc
labels:
app: ostoy-microservice
spec:
type: ClusterIP
ports:
- port: 8080
targetPort: 8080
protocol: TCP
selector:
app: ostoy-microservice
----
* S3 bucket manifest for ACK S3
+
.`s3-bucket.yaml`
+
[source,yaml]
----
apiVersion: s3.services.k8s.aws/v1alpha1
kind: Bucket
metadata:
name: ostoy-bucket
namespace: ostoy
spec:
name: ostoy-bucket
----
[NOTE]
====
To simplify deployment of the OSToy application, all of the objects required in the above deployment manifests are grouped together. For a typical enterprise deployment, a separate manifest file for each Kubernetes object is recommended.
====
=== About the OSToy application
OSToy is a simple Node.js application that you will deploy to a ROSA cluster to help explore the functionality of Kubernetes. This application has a user interface where you can:
* Write messages to the log (stdout / stderr).
* Intentionally crash the application to view self-healing.
* Toggle a liveness probe and monitor OpenShift behavior.
* Read config maps, secrets, and env variables.
* If connected to shared storage, read and write files.
* Check network connectivity, intra-cluster DNS, and intra-communication with the included microservice.
* Increase the load to view automatic scaling of the pods to handle the load using the Horizontal Pod Autoscaler.
* Optional: Connect to an AWS S3 bucket to read and write objects.
=== OSToy Application Diagram
image::ostoy-arch.png[OSToy architecture diagram]
=== Understanding the OSToy UI
image::ostoy-homepage.png[Preview of the OSToy homepage]
1. Shows the pod name that served your browser the page.
2. *Home:* The main page of the application where you can perform some of the functions listed which we will explore.
3. *Persistent Storage:* Allows you to write data to the persistent volume bound to this application.
4. *Config Maps:* Shows the contents of configmaps available to the application and the key:value pairs.
5. *Secrets:* Shows the contents of secrets available to the application and the key:value pairs.
6. *ENV Variables:* Shows the environment variables available to the application.
7. *Networking:* Tools to illustrate networking within the application.
8. *Pod Auto Scaling:* Tool to increase the load of the pods and test the HPA.
9. *ACK S3:* Optional: Integrate with AWS S3 to read and write objects to a bucket.
+
[NOTE]
====
In order see the "ACK S3" section of OSToy, you must complete the ACK section of this workshop. If you decide not to complete that section, the OSToy application will still function.
====
+
10. *About:* Displays more information about the application.

BIN
images/ostoy-arch.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

BIN
images/ostoy-homepage.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 KiB