Questions tagged [statefulset]

StatefulSets are valuable for applications that require one or more of the following.

  • Stable, unique network identifiers.
  • Stable, persistent storage.
  • Ordered, graceful deployment and scaling.
  • Ordered, graceful deletion and termination.
  • Ordered, automated rolling updates.
91 questions
0
votes
1 answer

Is there an python API function to read labels from kubernetes statefulsets?

I am trying to find an API function to read the keys and values of all the labels in a kubernetes statefulset. Can anyone point me to an example or documentation on how this can be done?
J. Ike
  • 19
  • 5
0
votes
1 answer

StatefulSets or Operators for scaling up mysql database on Kubernetes

I would like to scale up my mysql and mongo database with hpa ! I wonder if i should use Statefulsets, Operators or both. Also i can't understand the difference between StatefulSets and Operators. Could someone help me? Thank you very much!!
alex
  • 343
  • 2
  • 9
0
votes
1 answer

How to persist data in mongodb deployed on kubernetes

I have deployed mongodb pod on kubernetes and able to connect and insert the data in database. But when the pod gets restart all my data is being lost. I have created persistentvolume also for mongodb but still the data is being lost. Below are my…
SVD
  • 385
  • 4
  • 24
0
votes
0 answers

Unable to attach or mount volumes in Kubernetes

Since I updated my Digital Ocean cluster to Kubernetes 1.21, I have multiple errors mounting nfs volumes on deployments and statefulsets like this one : Unable to attach or mount volumes: unmounted volumes=[storage], unattached volumes=[storage…
0
votes
0 answers

kubernetes statefulset podAntiAffinity

bellow works fine, k8s runs one pod each node, but issue when one of nodes fails, k8s creates 2 pods in a node. Is it possible only one pod in a node? apiVersion: apps/v1 kind: StatefulSet metadata: name: testpod spec: replicas: 3 selector: …
akahhor
  • 101
  • 6
0
votes
1 answer

Kubernetes multiple stateful sets pods communication

Within same stateful set afaik you can interact between particular pods just by referencing it directly, like this - pod-{0..N-1}.my_service.my_namespace.svc.cluster.local. (some more info here:…
Ruslan Akhundov
  • 2,178
  • 4
  • 20
  • 38
0
votes
3 answers

How to delete statefulsets.apps using Kubernetes Python CoreV1API

I'm migrating helm2 releases to helm3. One of my resources is redis and it's protected from migration. I have to remove it using kubectl delete statefulsets.apps --cascade=false -nkube-system testme-redis-master I wanna use the Kubernetes python…
OLS
  • 155
  • 15
0
votes
1 answer

How to manage pod replicas while using PVC

I have an Open Source project that I deployed in Kubernetes. It has a master, data, and query pod. The data pod is used to store the data. Unfortunately, when the data pod goes down it loses all its stored data as well. So I figured, I have to use a…
CSUNNY
  • 414
  • 1
  • 7
  • 23
0
votes
1 answer

Cassandra Kubernetes Statefulset NoHostAvailableException

I have an application deployed in kubernetes, it consists of cassandra, a go client, and a java client (and other things, but they are not relevant for this discussion). We have used helm to do our deployment. We are using a stateful set and a…
Mike
  • 21
  • 2
0
votes
1 answer

Create a new volume when pod restart in a statefulset

I'm using azure aks to create a statefulset with volume using azure disk provisioner. I'm trying to find a way to write my statefulset YAML file in a way that when a pod restarts, it will get a new Volume and the old volume will be deleted. I know I…
toto
  • 1,197
  • 2
  • 15
  • 26
0
votes
1 answer

Kubernetes StatefulSets - run pod on every worker node

What is the easiest way to run a single Pod on every available worker node as part of the StatefulSet. So, a one to one mapping. Am I right to say every Pod will run on a different Node by default with a StatefulSet? In which case is it sufficient…
user568280
  • 457
  • 2
  • 5
  • 9
0
votes
2 answers

How to open a shell within Statefulset POD in Kubernetes using namespace

When it comes to PODS with: kind: Deployment the command has a following format: kubectl exec -it [# POD_NAME #] -- sh I am not sure how to accomplish the same, when I do have PODs defined using: apiVersion: apps/v1 kind: StatefulSet
Artur Drożdżyk
  • 605
  • 1
  • 6
  • 18
0
votes
1 answer

How to mount a secret to kubernetes StatefulSet

So, looking at the Kubernetes API documentation: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#statefulsetspec-v1-apps it appears that I can indeed have a volume because it uses a podspec and the podspec does have a volume…
MooreGuy
  • 13
  • 1
  • 4
0
votes
0 answers

Kubernetes: How to access a load balancer externalIP inside Pod

I have a use case where i have to deploy a distributed database using Kubernetes Statefulset. I want to access all Pods from outside cluster. There are few ways to do it, one of them is by creating Load balancer service per Pod. Now i want to inject…
Sud
  • 11
  • 2
0
votes
2 answers

Is there some way only increase statefulset's replicas and NO decrease the replicas?

I do not want to decrease the number of pods controlled by StatefulSet, and i think that decreasing pods is a dangerous operation in production env. so... , is there some way ? thx ~
adrian ding
  • 135
  • 1
  • 7