Skip to content

Commit d24eb8e

Browse files
authored
Merge pull request #83635 from jneczypor/OSDOCS-10768
OSDOCS-10768: Re-work first third of "Deploying an application" Tutorials for ROSA with HCP
2 parents c39dad7 + a129781 commit d24eb8e

File tree

7 files changed

+340
-11
lines changed

7 files changed

+340
-11
lines changed

_topic_maps/_topic_map_rosa_hcp.yml

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ Topics:
7575
File: cloud-experts-getting-started-deleting
7676
- Name: Obtaining support
7777
File: cloud-experts-getting-started-support
78+
- Name: Deploying an application workshop
79+
Dir: deploying_application_workshop
80+
Topics:
81+
- Name: Workshop overview
82+
File: learning-lab-overview
7883
# ---
7984
# Name: Architecture
8085
# Dir: architecture
@@ -127,16 +132,40 @@ Topics:
127132
# File: cloud-experts-dynamic-certificate-custom-domain
128133
# - Name: Assigning consistent egress IP for external traffic
129134
# File: cloud-experts-consistent-egress-ip
130-
- Name: Deploying an application
131-
Dir: cloud-experts-deploying-application
132-
Distros: openshift-rosa-hcp
133-
Topics:
134-
- Name: Introduction
135-
File: cloud-experts-deploying-application-intro
136-
- Name: Prerequisites
137-
File: cloud-experts-deploying-application-prerequisites
138-
- Name: Lab Overview
139-
File: cloud-experts-deploying-application-lab-overview
135+
# ---
136+
# Name: Getting started
137+
# Dir: rosa_getting_started
138+
# Distros: openshift-rosa-hcp
139+
# Topics:
140+
# - Name: ROSA quickstart guide
141+
# File: rosa-quickstart-guide-ui
142+
# - Name: Comprehensive guide to getting started with ROSA
143+
# File: rosa-getting-started
144+
# - Name: Understanding the ROSA with STS deployment workflow
145+
# File: rosa-sts-getting-started-workflow
146+
# ---
147+
# Name: Prepare your environment
148+
# Dir: rosa_planning
149+
# Distros: openshift-rosa-hcp
150+
# Topics:
151+
# - Name: Prerequisites checklist for deploying ROSA using STS
152+
# File: rosa-cloud-expert-prereq-checklist
153+
# - Name: Detailed requirements for deploying ROSA using STS
154+
# File: rosa-sts-aws-prereqs
155+
# - Name: ROSA IAM role resources
156+
# File: rosa-sts-ocm-role
157+
# - Name: Limits and scalability
158+
# File: rosa-limits-scalability
159+
#- Name: ROSA with HCP limits and scalability
160+
# File: rosa-hcp-limits-scalability
161+
# - Name: Planning your environment
162+
# File: rosa-planning-environment
163+
# - Name: Required AWS service quotas
164+
# File: rosa-sts-required-aws-service-quotas
165+
# - Name: Setting up your environment
166+
# File: rosa-sts-setting-up-environment
167+
# - Name: Preparing Terraform to install ROSA clusters
168+
# File: rosa-understanding-terraform
140169
---
141170
Name: Install ROSA with HCP clusters
142171
Dir: rosa_hcp

rosa_hcp/rosa-hcp-quickstart-guide.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ include::modules/rosa-getting-started-install-configure-cli-tools.adoc[leveloffs
1919

2020
.Next steps
2121

22-
Before you can use the {cluster-manager} {hybrid-console-second} to deploy ROSA clusters, you must associate your AWS account with your Red{nbsp}Hat organization and create the required account-wide STS roles and policies. For information on how your AWS and Red Hat accounts interact, see xref:../cloud_experts_tutorials/cloud-experts-deploying-application/cloud-experts-deploying-application-prerequisites.adoc#rosa-sts-understanding-aws-account-association_cloud-experts-deploying-application-prerequisites[Understanding AWS account association]
22+
Before you can use the {cluster-manager} {hybrid-console-second} to deploy ROSA clusters, you must associate your AWS account with your Red{nbsp}Hat organization and create the required account-wide STS roles and policies.
2323

2424
include::modules/rosa-sts-creating-account-wide-sts-roles-and-policies.adoc[leveloffset=+1]
2525

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../_attributes/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../images/
Lines changed: 296 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,296 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
[id="learning-lab-overview"]
3+
= Workshop overview
4+
include::_attributes/attributes-openshift-dedicated.adoc[]
5+
:context: learning-lab-overview
6+
toc::[]
7+
8+
//rosaworkshop.io content metadata
9+
//Brought into ROSA product docs 22-JAN-2024
10+
//Modified for HCP 15 October 2024
11+
12+
== Introduction
13+
14+
After successfully provisioning your cluster, follow this workshop to deploy an application on it to understand the concepts of deploying and operating container-based applications.
15+
16+
.Workshop objectives
17+
18+
* Deploy a Node.js-based application by using Source-to-Image (S2I) and Kubernetes deployment objects
19+
* Set up a continuous delivery (CD) pipeline to automatically push source code changes
20+
* Experience self-healing applications
21+
* Explore configuration management through ConfigMaps, secrets, and environment variables
22+
* Use persistent storage to share data across pod restarts
23+
* Explore networking in Kubernetes and applications
24+
* Familiarize yourself with ROSA and Kubernetes functionality
25+
* Automatically scale pods based on loads from the Horizontal Pod Autoscaler (HPA)
26+
//* Use AWS Controllers for Kubernetes (ACK) to deploy and use an S3 bucket
27+
28+
.Prerequisites
29+
30+
* A provisioned ROSA cluster
31+
* The link:https://docs.openshift.com/rosa/cli_reference/openshift_cli/getting-started-cli.html[OpenShift command line interface (CLI)]
32+
* A link:https://github.com/signup[GitHub account]
33+
34+
== About the OSToy application
35+
36+
OSToy is a Node.js application that deploys to a ROSA cluster to help explore the functionality of Kubernetes.
37+
38+
This application has a user interface where you can:
39+
40+
* Write messages to the log (stdout / stderr)
41+
* Intentionally crash the application to view self-healing
42+
* Toggle a liveness probe and monitor OpenShift behavior
43+
* Read ConfigMaps, secrets, and environment variables
44+
* Read and write files when connected to shared storage
45+
* Check network connectivity, intra-cluster DNS, and intra-communication with the included microservice
46+
* Increase the load to view automatic scaling of the pods by using the HPA
47+
//* Connect to an AWS S3 bucket to read and write objects
48+
49+
=== OSToy Application Diagram
50+
51+
image::ostoy-arch.png[OSToy architecture diagram]
52+
53+
=== Understanding the OSToy UI
54+
55+
image::ostoy-homepage.png[Preview of the OSToy homepage]
56+
57+
. Pod name
58+
. *Home:* Application home page
59+
. *Persistent Storage:* Writes data to the persistent volume bound to the application
60+
. *Config Maps:* Shows ConfigMaps available to the application and the key:value pairs
61+
. *Secrets:* Shows secrets available to the application and the key:value pairs
62+
. *ENV Variables:* Shows environment variables available to the application
63+
. *Networking:* Networking tools
64+
. *Pod Auto Scaling:* Increase the load of the pods and test the Horizontal Pod Autoscaler (HPA)
65+
. *ACK S3:* Integrate with AWS S3 to read and write objects to a bucket
66+
+
67+
. *About:* Application information
68+
69+
=== Lab resources
70+
71+
* link:https://github.com/openshift-cs/ostoy[OSToy application source code]
72+
* link:https://quay.io/ostoylab/ostoy-frontend[OSToy front-end container image]
73+
* link:https://quay.io/ostoylab/ostoy-microservice[OSToy microservice container image]
74+
* Deployment definition YAML files:
75+
+
76+
.`ostoy-frontend-deployment.yaml`
77+
+
78+
[source,yaml]
79+
----
80+
apiVersion: v1
81+
kind: PersistentVolumeClaim
82+
metadata:
83+
name: ostoy-pvc
84+
spec:
85+
accessModes:
86+
- ReadWriteOnce
87+
resources:
88+
requests:
89+
storage: 1Gi
90+
---
91+
apiVersion: apps/v1
92+
kind: Deployment
93+
metadata:
94+
name: ostoy-frontend
95+
labels:
96+
app: ostoy
97+
spec:
98+
selector:
99+
matchLabels:
100+
app: ostoy-frontend
101+
strategy:
102+
type: Recreate
103+
replicas: 1
104+
template:
105+
metadata:
106+
labels:
107+
app: ostoy-frontend
108+
spec:
109+
# Uncomment to use with ACK portion of the workshop
110+
# If you chose a different service account name please replace it.
111+
# serviceAccount: ostoy-sa
112+
containers:
113+
- name: ostoy-frontend
114+
securityContext:
115+
allowPrivilegeEscalation: false
116+
runAsNonRoot: true
117+
seccompProfile:
118+
type: RuntimeDefault
119+
capabilities:
120+
drop:
121+
- ALL
122+
image: quay.io/ostoylab/ostoy-frontend:1.6.0
123+
imagePullPolicy: IfNotPresent
124+
ports:
125+
- name: ostoy-port
126+
containerPort: 8080
127+
resources:
128+
requests:
129+
memory: "256Mi"
130+
cpu: "100m"
131+
limits:
132+
memory: "512Mi"
133+
cpu: "200m"
134+
volumeMounts:
135+
- name: configvol
136+
mountPath: /var/config
137+
- name: secretvol
138+
mountPath: /var/secret
139+
- name: datavol
140+
mountPath: /var/demo_files
141+
livenessProbe:
142+
httpGet:
143+
path: /health
144+
port: 8080
145+
initialDelaySeconds: 10
146+
periodSeconds: 5
147+
env:
148+
- name: ENV_TOY_SECRET
149+
valueFrom:
150+
secretKeyRef:
151+
name: ostoy-secret-env
152+
key: ENV_TOY_SECRET
153+
- name: MICROSERVICE_NAME
154+
value: OSTOY_MICROSERVICE_SVC
155+
- name: NAMESPACE
156+
valueFrom:
157+
fieldRef:
158+
fieldPath: metadata.namespace
159+
volumes:
160+
- name: configvol
161+
configMap:
162+
name: ostoy-configmap-files
163+
- name: secretvol
164+
secret:
165+
defaultMode: 420
166+
secretName: ostoy-secret
167+
- name: datavol
168+
persistentVolumeClaim:
169+
claimName: ostoy-pvc
170+
---
171+
apiVersion: v1
172+
kind: Service
173+
metadata:
174+
name: ostoy-frontend-svc
175+
labels:
176+
app: ostoy-frontend
177+
spec:
178+
type: ClusterIP
179+
ports:
180+
- port: 8080
181+
targetPort: ostoy-port
182+
protocol: TCP
183+
name: ostoy
184+
selector:
185+
app: ostoy-frontend
186+
---
187+
apiVersion: route.openshift.io/v1
188+
kind: Route
189+
metadata:
190+
name: ostoy-route
191+
spec:
192+
to:
193+
kind: Service
194+
name: ostoy-frontend-svc
195+
---
196+
apiVersion: v1
197+
kind: Secret
198+
metadata:
199+
name: ostoy-secret-env
200+
type: Opaque
201+
data:
202+
ENV_TOY_SECRET: VGhpcyBpcyBhIHRlc3Q=
203+
---
204+
kind: ConfigMap
205+
apiVersion: v1
206+
metadata:
207+
name: ostoy-configmap-files
208+
data:
209+
config.json: '{ "default": "123" }'
210+
---
211+
apiVersion: v1
212+
kind: Secret
213+
metadata:
214+
name: ostoy-secret
215+
data:
216+
secret.txt: VVNFUk5BTUU9bXlfdXNlcgpQQVNTV09SRD1AT3RCbCVYQXAhIzYzMlk1RndDQE1UUWsKU01UUD1sb2NhbGhvc3QKU01UUF9QT1JUPTI1
217+
type: Opaque
218+
----
219+
+
220+
.`ostoy-microservice-deployment.yaml`
221+
+
222+
[source,yaml]
223+
----
224+
apiVersion: apps/v1
225+
kind: Deployment
226+
metadata:
227+
name: ostoy-microservice
228+
labels:
229+
app: ostoy
230+
spec:
231+
selector:
232+
matchLabels:
233+
app: ostoy-microservice
234+
replicas: 1
235+
template:
236+
metadata:
237+
labels:
238+
app: ostoy-microservice
239+
spec:
240+
containers:
241+
- name: ostoy-microservice
242+
securityContext:
243+
allowPrivilegeEscalation: false
244+
runAsNonRoot: true
245+
seccompProfile:
246+
type: RuntimeDefault
247+
capabilities:
248+
drop:
249+
- ALL
250+
image: quay.io/ostoylab/ostoy-microservice:1.5.0
251+
imagePullPolicy: IfNotPresent
252+
ports:
253+
- containerPort: 8080
254+
protocol: TCP
255+
resources:
256+
requests:
257+
memory: "128Mi"
258+
cpu: "50m"
259+
limits:
260+
memory: "256Mi"
261+
cpu: "100m"
262+
---
263+
apiVersion: v1
264+
kind: Service
265+
metadata:
266+
name: ostoy-microservice-svc
267+
labels:
268+
app: ostoy-microservice
269+
spec:
270+
type: ClusterIP
271+
ports:
272+
- port: 8080
273+
targetPort: 8080
274+
protocol: TCP
275+
selector:
276+
app: ostoy-microservice
277+
----
278+
* S3 bucket manifest for ACK S3
279+
+
280+
.`s3-bucket.yaml`
281+
+
282+
[source,yaml]
283+
----
284+
apiVersion: s3.services.k8s.aws/v1alpha1
285+
kind: Bucket
286+
metadata:
287+
name: ostoy-bucket
288+
namespace: ostoy
289+
spec:
290+
name: ostoy-bucket
291+
----
292+
293+
[NOTE]
294+
====
295+
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.
296+
====
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../modules
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../snippets/

0 commit comments

Comments
 (0)