mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
236 lines
5.2 KiB
Plaintext
236 lines
5.2 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * rosa_learning/deploying_application_workshop/learning-lab-overview.adoc
|
|
:_mod-docs-content-type: REFERENCE
|
|
[id="learning-lab-overview-lab-resources_{context}"]
|
|
= Lab resources
|
|
|
|
[role="_abstract"]
|
|
The following materials are used throughout this lab tutorial.
|
|
|
|
* link:https://github.com/openshift-cs/ostoy[OSToy application source code]
|
|
* 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.
|
|
==== |