Lab 7.1 - Manual Scaling the Loadtest Application

1. Login as the developer user

oc login -u developer -p rahasia https://api.openshift.podX.io:6443

2. Create a new project named schedule-scale

oc new-project schedule-scale

3. Create the deployment file and save it to /root/loadtest.yaml

oc create deployment loadtest --image=quay.io/redhattraining/loadtest:v1.0  \
  --dry-run=client -o yaml > /root/loadtest.yaml
cat /root/loadtest.yaml 

4. Replace the resources: {} line with the highlighted lines listed below.

vim /root/loadtest.yaml
...
    spec:
      containers:
      - image: quay.io/redhattraining/loadtest:v1.0
        name: loadtest
        resources:
          requests:
            cpu: "25m"
            memory: 25Mi
        limits:
            cpu: "100m"
            memory: 100Mi
status: {}
...

5. Create the new application using the resource file.

oc create --save-config \
 -f /root/loadtest.yaml

6. Verify that your application pod has a status of Running

oc get pods

7. Manually scale the loadtest deployment up to five pods

oc scale --replicas 5 deployment/loadtest

8. Verify that all five application pods are running

oc get pods

9. Scale the loadtest deployment back down to one pod

oc scale --replicas 1 deployment/loadtest
oc get pods

Daftar Materi