Skip to content

Commit 346b5f8

Browse files
authored
Merge pull request #57063 from dfitzmau/OSDOCS-4812
OSDOCS-4812: Deploying a sample application in an AWS Local Zone environment
2 parents 98a6ab8 + fe3fa85 commit 346b5f8

File tree

4 files changed

+144
-1
lines changed

4 files changed

+144
-1
lines changed

installing/installing_aws/installing-aws-localzone.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ toc::[]
88

99
In {product-title} version {product-version}, you can install a cluster on Amazon Web Services (AWS) into an existing VPC, extending workers to the edge of the Cloud Infrastructure using AWS Local Zones.
1010

11+
After you create an Amazon Web Service (AWS) Local Zone environment, and you deploy your cluster, you can use edge worker nodes to create user workloads in Local Zone subnets.
12+
1113
AWS Local Zones are a type of infrastructure that place Cloud Resources close to the metropolitan regions. For more information, see the link:https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-local-zones[AWS Local Zones Documentation].
1214

1315
{product-title} can be installed in existing VPCs with Local Zone subnets. The Local Zone subnets can be used to extend the regular workers' nodes to the edge networks. The edge worker nodes are dedicated to running user workloads.
@@ -99,6 +101,9 @@ include::modules/installation-localzone-generate-k8s-manifest.adoc[leveloffset=+
99101

100102
include::modules/installation-launching-installer.adoc[leveloffset=+1]
101103

104+
.Next steps
105+
* xref:../../post_installation_configuration/cluster-tasks.adoc#installation-extend-edge-nodes-aws-local-zones_post-install-cluster-tasks[Creating user workloads in AWS Local Zones]
106+
102107
include::modules/cli-installing-cli.adoc[leveloffset=+1]
103108

104109
include::modules/cli-logging-in-kubeadmin.adoc[leveloffset=+1]
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * post_installation_configuration/cluster-tasks.adoc
4+
5+
ifeval::["{context}" == "installing-aws-localzone"]
6+
:localzone:
7+
endif::[]
8+
9+
:_content-type: PROCEDURE
10+
[id="installation-extend-edge-nodes-aws-local-zones_{context}"]
11+
= Creating user workloads in AWS Local Zones
12+
After you create an Amazon Web Service (AWS) Local Zone environment, and you deploy your cluster, you can use edge worker nodes to create user workloads in Local Zone subnets.
13+
14+
After the `openshift-installer` creates the cluster, the installation program automatically specifies a taint effect of `NoSchedule` to each edge worker node. This means that a scheduler does not add a new pod, or deployment, to a node if the pod does not match the specified tolerations for a taint. You can modify the taint for better control over how each node creates a workload in each Local Zone subnet.
15+
16+
The `openshift-installer` creates the compute machine set manifests file with `node-role.kubernetes.io/edge` and `node-role.kubernetes.io/worker` labels applied to each edge worker node that is located in a Local Zone subnet.
17+
18+
.Prerequisites
19+
20+
* You have access to the OpenShift CLI (`oc`).
21+
* You deployed your cluster in a Virtual Private Cloud (VPC) with defined Local Zone subnets.
22+
* You ensured that the compute machine set for the edge workers on Local Zone subnets specifies the taints for `node-role.kubernetes.io/edge`.
23+
24+
.Procedure
25+
26+
. Create a `deployment` resource YAML file for an example application to be deployed in the edge worker node that operates in a Local Zone subnet. Ensure that you specify the correct tolerations that match the taints for the edge worker node.
27+
+
28+
.Example of a configured `deployment` resource for an edge worker node that operates in a Local Zone subnet
29+
[source,yaml]
30+
----
31+
kind: Namespace
32+
apiVersion: v1
33+
metadata:
34+
name: <local_zone_application_namespace>
35+
---
36+
kind: PersistentVolumeClaim
37+
apiVersion: v1
38+
metadata:
39+
name: <pvc_name>
40+
namespace: <local_zone_application_namespace>
41+
spec:
42+
accessModes:
43+
- ReadWriteOnce
44+
resources:
45+
requests:
46+
storage: 10Gi
47+
storageClassName: gp2-csi <1>
48+
volumeMode: Filesystem
49+
---
50+
apiVersion: apps/v1
51+
kind: Deployment <2>
52+
metadata:
53+
name: <local_zone_application> <3>
54+
namespace: <local_zone_application_namespace> <4>
55+
spec:
56+
selector:
57+
matchLabels:
58+
app: <local_zone_application>
59+
replicas: 1
60+
template:
61+
metadata:
62+
labels:
63+
app: <local_zone_application>
64+
zone-group: ${ZONE_GROUP_NAME} <5>
65+
spec:
66+
securityContext:
67+
seccompProfile:
68+
type: RuntimeDefault
69+
nodeSelector: <6>
70+
machine.openshift.io/zone-group: ${ZONE_GROUP_NAME}
71+
tolerations: <7>
72+
- key: "node-role.kubernetes.io/edge"
73+
operator: "Equal"
74+
value: ""
75+
effect: "NoSchedule"
76+
containers:
77+
- image: openshift/origin-node
78+
command:
79+
- "/bin/socat"
80+
args:
81+
- TCP4-LISTEN:8080,reuseaddr,fork
82+
- EXEC:'/bin/bash -c \"printf \\\"HTTP/1.0 200 OK\r\n\r\n\\\"; sed -e \\\"/^\r/q\\\"\"'
83+
imagePullPolicy: Always
84+
name: echoserver
85+
ports:
86+
- containerPort: 8080
87+
volumeMounts:
88+
- mountPath: "/mnt/storage"
89+
name: data
90+
volumes:
91+
- name: data
92+
persistentVolumeClaim:
93+
claimName: <pvc_name>
94+
----
95+
<1> `storageClassName`: For the Local Zone configuration, you must specify `gp2-csi`.
96+
<2> `kind`: Defines the `deployment` resource.
97+
<3> `name`: Specifies the name of your Local Zone application. For example, `local-zone-demo-app-nyc-1`.
98+
<4> `namespace:` Defines the namespace for the AWS Local Zone where you want to run the user workload. For example: `local-zone-app-nyc-1a`.
99+
<5> `zone-group`: Defines the group to where a zone belongs. For example, `us-east-1-iah-1`.
100+
<6> `nodeSelector`: Targets edge worker nodes that match the specified labels.
101+
<7> `tolerations`: Sets the values that match with the `taints` defined on the `MachineSet` manifest for the Local Zone node.
102+
103+
. Create a `service` resource YAML file for the node. This resource exposes a pod from a targeted edge worker node to services that run inside your Local Zone network.
104+
+
105+
.Example of a configured `service` resource for an edge worker node that operates in a Local Zone subnet
106+
[source,yaml]
107+
----
108+
apiVersion: v1
109+
kind: Service <1>
110+
metadata:
111+
name: <local_zone_application>
112+
namespace: <local_zone_application_namespace>
113+
spec:
114+
ports:
115+
- port: 80
116+
targetPort: 8080
117+
protocol: TCP
118+
type: NodePort
119+
selector: <2>
120+
app: <local_zone_application>
121+
----
122+
<1> `kind`: Defines the `service` resource.
123+
<2> `selector:` Specifies the label type applied to managed pods.

modules/installation-localzone-generate-k8s-manifest.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// * installing/installing_aws/installing-aws-localzone.adoc
44

55
:_content-type: PROCEDURE
6-
[id="installation-localzone-generate-k8s-manifest{context}"]
6+
[id="installation-localzone-generate-k8s-manifest_{context}"]
77
= Creating the Kubernetes manifest files
88

99
Because you must modify some cluster definition files and manually start the cluster machines, you must generate the Kubernetes manifest files that the cluster needs to configure the machines.

post_installation_configuration/cluster-tasks.adoc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,21 @@ include::modules/machineset-delete-policy.adoc[leveloffset=+2]
544544

545545
include::modules/nodes-scheduler-node-selectors-cluster.adoc[leveloffset=+2]
546546

547+
include::modules/installation-extend-edge-nodes-aws-local-zones.adoc[leveloffset=+2]
548+
549+
.Next steps
550+
551+
* Optional: Use the AWS Load Balancer (ALB) Operator to expose a pod from a targeted edge worker node to services that run inside a Local Zone subnet from a public network. See xref:../networking/aws_load_balancer_operator/install-aws-load-balancer-operator.adoc#nw-installing-aws-load-balancer-operator_aws-load-balancer-operator[Installing the AWS Load Balancer Operator].
552+
553+
[role="_additional-resources"]
554+
.Additional resources
555+
556+
* xref:../installing/installing_aws/installing-aws-localzone.html[Installing a cluster using AWS Local Zones]
557+
558+
* xref:../nodes/scheduling/nodes-scheduler-taints-tolerations.adoc[Understanding taints and tolerations]
559+
560+
* xref:../logging/config/cluster-logging-tolerations.adoc[Using tolerations to control OpenShift Logging pod placement]
561+
547562
[id="post-worker-latency-profiles"]
548563
== Improving cluster stability in high latency environments using worker latency profiles
549564

0 commit comments

Comments
 (0)