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,100 points
34 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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
• 35,800 points

Related Questions In Kubernetes

0 votes
2 answers
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
• 35,800 points
154 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
• 14,080 points
42 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
• 35,800 points
29 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
• 35,800 points
30 views
0 votes
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
• 35,800 points
451 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
• 35,800 points
105 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.