Deploy applications on a Worker Group
Managed FKE manages workers using Worker Groups, making it convenient for users to deploy applications without having to worry about resource scaling.
Configure a manifest file to deploy an application
Example: deploying an application on a cluster with 2 Worker Groups:
Each Worker Group has one worker node:
Worker nodes are labeled to distinguish nodes and make it easy to deploy applications to worker nodes with a common label:
Worker nodes in the worker-1zx5wqdu Worker Group are labeled worker.fptcloud/pool=worker-1zx5wqdu.
You can copy the Worker Group name by clicking on the Worker Group configuration details:
When using resources to deploy applications in Kubernetes (Pod, Deployment, StatefulSet, DaemonSet, ReplicaSet), you can add a Node Affinity Rule or Node Selector in the Specification section of the configuration file:
Using Node Affinity Rule:
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment-test
labels:
app: nginx
spec:
replicas: 2
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.14.2
ports:
- containerPort: 80
resources:
requests:
memory: "700Mi"
cpu: "800m"
limits:
memory: "900Mi"
cpu: "900m"
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: worker.fptcloud/pool
operator: In
values:
- worker-1zx5wqdu
Using Node Selector:
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment-test
labels:
app: nginx
spec:
replicas: 2
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.14.2
ports:
- containerPort: 80
resources:
requests:
memory: "700Mi"
cpu: "800m"
limits:
memory: "900Mi"
cpu: "900m"
nodeSelector:
worker.fptcloud/pool: worker-1zx5wqdu
The value in the values section (Node Affinity Rule) and the nodeSelector value is the name of the Worker Group where you want to deploy the application.
Deploy an application
When deploying the nginx application using a manifest file:
If one pod is pending due to insufficient worker node resources in the pool:
The Cluster Autoscaler component on the FPT Cloud admin side automatically scales out an additional worker node in that pool to serve the pending nginx pod.
After a worker node is added to the Worker Group, the previously Pending nginx pod transitions to Running status.
When scaling the application down to use fewer pods, the available resources on worker nodes increase. When CPU and Memory utilization drops below 50% of the node's maximum capacity for 10 consecutive minutes, that node is automatically removed from the Worker Group, saving costs for the user.



