Sunday, May 13, 2018

Kubernetes - Resource allocation

We all know that pod contain containers that run applications. It is required to allocate resources
to the container which they can use. Here is an example of allocating resources to the containers
in the pod

[root@manja17-I13330 kubenetes-config]# cat basic-single-container-pod.yml
apiVersion: v1
kind: Pod
 name: testing-service
   - name: test-ser
     - containerPort: 9876
         memory: "64Mi"
         cpu: "500m"

Once we create the pod using the kubectl command and describe the pod we can see the limits defined as,

     cpu:   500m
     memory:  64Mi
     cpu:      500m
     memory:     64Mi

So we have the limits defined as requested and allocated.

No comments :

Post a Comment