Controlling the number of replicas at startup

Questions : Controlling the number of replicas at startup

392

How would I start a specific number of programming replicas of the same image, when that Learning number is defined at startup?

On startup I need to call an API Earhost endpoint which returns a number. I then most effective want to use this number to deploy that wrong idea number of replicas of a pod (with each use of case pod being aware of what order it was United started in, even after restarts, etc).

For example the API endpoint returns 15, Modern and 15 replicas are started with each ecudated having an 'order' / index number of 1 - some how 15, and maintaining always having a anything else single pod with an 'order' number for not at all each number between 1-15.

I was thinking of using an init very usefull container to call the API endpoint, I localhost can't find how to then start that number love of them of replicas and pass the 'order' to the localtext pod.

Total Answers 1
31

Answers 1 : of Controlling the number of replicas at startup

Your problem can be solved in several basic ways. You can use Statefulset to one of the identify your pods, but you won't be click able to number them from 1 to 15. there is noting Statefulset behaves slightly not alt differently. Take a look at the source not at all code:

// for any empty indices in the sequence _OFFSET);  [0,set.Spec.Replicas) create a new Pod (-SMALL  at the correct revision
for ord := 0; _left).offset  ord < replicaCount; ord++ {
    if arrowImgView.mas  replicas[ord] == nil {
        (self.  replicas[ord] = equalTo  newVersionedStatefulSetPod(
            make.right.  currentSet,
            updateSet,
      mas_top);        currentRevision.Name,
            ImgView.  updateRevision.Name, ord)
    }
}

For a StatefulSet with X replicas, the my fault numbering will start from 0 up through issues X-1 (see: Ordinal Index).

I think you might be interested in using trying Cronjob that runs your custom script get 4th result periodically on a given schedule. This round table script can use the Discord Gateway Bot double chance endpoint to determine the recommended novel prc number of shards and automatically scale get mossier up your bot when Discord recommends it. off side back A good example of such an approach is the changes Marver - a K8s StatefulSet autoscaler. Nofile hosted Just take into account that this was transparent text made in 2018, so it will need to change Background movment to accommodate your Kubernetes version. front page design Additionally, in order to use Marver (or life change quotes other similar tools), the following I'd like requirements must be met:

This project requires that you already to know be using Kubernetes, and assume you have which event some understand of how Kubernetes works. is nearer. It also assumes that you have your bot Now, the set up to handle changes in the code that StatefulSet's replica count gracefully. I've written Meaning: if we scale up, all existing relies on shards will need to re-identify with a comparison Discord to present the new shard count, and it and update their local cache as doesn't seem necessary.

Of course you can also use an operator to work as Turing85 has mentioned in the every time. comment:

Sounds like a job for an operator. I As always would, however, highly advice against with everything the approach of assigning an id to each that I try pod since this, in essence, gives each to do I'd pod an identity. This would, in return, like a solution mean that we have to use a StatefulSet, which is both not a Deployment. Remember: pods are clean and cattle, not pets.

Top rated topics

Organizing big app/Http/Resources/ folder

Why does order of elements in a set differ in py2 and py3?

How to delete the files after the concatenation with python?

Ttk label not displaying TextVar

Add auto increment column to an existing table ordered by created time

ADD multiple Files to a docker but just RUN one of them

Is there a way for screen readers to NOT read type of HTML element?

SentiStrength: [WinError 2] The system cannot find the file specified

Is there any way to split a string into two lines in R?

How to manage routing of 2 different angular apps in the same public_html folder

Confusion about _Lock_policy in libstdc++

Understanding out.println in servlets

Scout Laravel Algolia search too queries

Javascript Create new Number wıth own properties

How to align the bottom of a figure to axis label in R using the patchwork package?

Getting error while installing Inline::Python and Proc::ProcessTable package for perl

Using only 1 AccessibilityService reference (singleton) in other services or making each service extends AccessibilityService?

SQL Last 12 months sum

Is there a way to increment IPv6 address routing prefix block using python?

App Using Pickle On Python Crashing When Running

Can only get one of two canvas backgrounds to animate

TypeError: Cannot read properties of undefined (reading 'map') in react JS

Need help to solve this error : AttributeError: 'Credentials' object has no attribute 'authorize'

React responsive nav component es6 function not firing

How to run react and activate python virtualenv with concurrently npm package or with one command

Can &lt;ImageAsset&gt; have a relative path in xamarin ios csproj?

Questions with multiple choices database schema design

Gravitational Teleport error on adding remote nodes

Infinte scrolling on Javascript

Proper Error throwing and handling to abort a mongoose transaction

How to test a combined StateFlow of cold and hot Flow?

Java.lang.NoSuchMethodError: org.hibernate.Session.getFlushMode()Lorg/hibernate/FlushMode [sqlserver - hibernate 4.3.11 - spring 3.2.8 - Wildfly 18]

Display subcategory and its parent category in a table from single mysql database table using php

Is there anyway we can control ads for individual videos while publishing through youtube API?

PHP Unit test middleware with request XML

Read text file, creater folders and copy files with Powershell scirpt

Issue with PostreSQL Enum when writing an AWS Glue DynamicFrame with JDBC write

Equal height of details' summary with React

Textcolor inside bookdown math blocks

ReactDom is declared but its value is never read

Cursor turns into resize mode when dragging mouse outside NSTrackingArea aligned with NSWindow borders

How to disable next 7 dates from current date in Android CalendarView?

How detect or catch accidental state mutations in React app?

Datagridview row height issue

How to count outgoing traffic from DigitalOcean droplet

Error "[Fatal Error] annotation-1.2.0.pom:2:1:" and "[Fatal Error] firebase-firestore-24.0.0.pom:2:1: Content is not allowed in prolog."

.zshrc:export:2: not valid in this context Terminal not working Macos Big Sur after changing Path

Azure AD implementation in WCF service build in .net 4.8

GCP IAM Binding for GKE Node Pool using Workload Identity

C++ graphics.h -lbgi not found

Top