Pod autoscaling

0 votes

I am planning on setting up persistence storage in AWS using Kubernetes. I have created the YAML file to create an EBS volume in AWS, it's working fine as expected. I am able to claim volume and successfully mount to my pod (this is for single replica only).

I am able to successfully create the file.Volume also creating but my Pods is going to pending state, volume still shows available state in aws. I am not able to see any error logs over there.

Storage file:

kind: StorageClass
apiVersion: storage.k8s.io/v1beta1
metadata:
  name: mongo-ssd
provisioner: kubernetes.io/aws-ebs
parameters:
  type: gp2

Main file:

apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
    name: web2
spec:
  selector:
    matchLabels:
      app: mongodb
  serviceName: "mongodb"
  replicas: 2
  template:
    metadata:
      labels:
        app: mongodb
      annotations:
         pod.alpha.kubernetes.io/initialized: "true"
    spec:
      containers:
      - image: mongo
        name: mongodb
        ports:
        - name: web2
          containerPort: 27017
          hostPort: 27017
        volumeMounts:
        - mountPath: "/opt/couchbase/var"
          name: mypd1
  volumeClaimTemplates:
  - metadata:
      name: mypd1
      annotations:
        volume.alpha.kubernetes.io/storage-class: mongo-ssd
    spec:
      accessModes: [ "ReadWriteOnce" ]
      resources:
        requests:
          storage: 10Gi
Oct 10, 2018 in Kubernetes by lina
• 8,220 points
801 views

1 answer to this question.

0 votes
Horizontal Pod Autoscaler can scale only Deployment, Replica Set or Replication Controller. You cannot scale Stateful Sets.

The main reason is that most of the stateful applications running in Stateful Sets (such as your MongoDB) are usually not as easy to scale up / down as the stateless applications running as Deployments. tou can use some additional support logic in the application it self.
answered Oct 10, 2018 by Kalgi
• 52,350 points

Related Questions In Kubernetes

0 votes
2 answers

Using a local image to create a pod in K8s

I'm not sure but you can try ...READ MORE

answered Apr 29, 2019 in Kubernetes by Vishaka
19,717 views
0 votes
1 answer

Pod not sharing directory - Kubernetes volume Hostpath

he issue was on the volume definition, ...READ MORE

answered Aug 28, 2018 in Kubernetes by Kalgi
• 52,350 points
2,250 views
0 votes
2 answers

Pod status terminating-Kubernentes

Delete the finalizers block from resource (pod,deployment,ds ...READ MORE

answered Aug 29, 2018 in Kubernetes by Hannah
• 18,520 points
953 views
0 votes
1 answer

Pods IP address from inside a container in the pod

Make sure that your pod yaml file ...READ MORE

answered Aug 29, 2018 in Kubernetes by Kalgi
• 52,350 points
2,437 views
0 votes
1 answer

permissions related to AWS ECR

if you add allowContainerRegistry: true, kops will add those permissions ...READ MORE

answered Oct 9, 2018 in Kubernetes by Kalgi
• 52,350 points
1,396 views
+1 vote
1 answer
0 votes
1 answer

Kubernetes error syncing pod

The issue caused by the docker container ...READ MORE

answered Aug 27, 2018 in Kubernetes by Kalgi
• 52,350 points
3,767 views
0 votes
1 answer

Define pod yaml dynamically-jenkins pipeline Kubernetes

Try using jinja template engine and python ...READ MORE

answered Aug 28, 2018 in Kubernetes by Kalgi
• 52,350 points
1,399 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP