Prompt

Need Kubernetes autoscaling rollback service discovery

Technology / Cloud Infrastructure1 observationLast seen Oct 19, 2026

Latest observation

Oct 19, 2026OpenAI APIWeb search: off

If you’re asking how to do rollback service discovery when Kubernetes autoscaling changes pods/replicas, the key idea is:

  • Do not discover pods directly
  • Always discover via a stable Kubernetes Service
  • Use a rollout strategy so old and new pods can coexist during rollback
  • If using HPA/KEDA, make sure your app can tolerate scaling events without changing its service endpoint

Recommended setup

1) Put pods behind a Service

Clients should call:

  • Service DNS name, not pod IPs
  • Example: my-app.default.svc.cluster.local

That way, when HPA scales up/down or you roll back, service discovery stays stable.

2) Use a Deployment with rolling updates

Example:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-app
spec:
  replicas: 3
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 0
      maxSurge: 1
  selector:
    matchLabels:
      app: my-app
  template:
    metadata:
      labels:
        app: my-app
    spec:
      containers:
      - name: my-app
        image: my-app:1.0.0
        ports:
        - containerPort: 8080

Rollback is then:

kubectl rollout undo deployment/my-app

3) Add readiness probes

This ensures only ready pods are added to Service endpoints.

readinessProbe:
  httpGet:
    path: /health
    port: 8080
  initialDelaySeconds: 5
  periodSeconds: 10

4) Use HPA for autoscaling

Example:

apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: my-app
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: my-app
  minReplicas: 2
  maxReplicas: 10
  metrics:
  - type: Resource
    resource:
      name: cpu
      target:
        type: Utilization
        averageUtilization: 70

HPA changes replica count only; the Service remains the same.


If you mean “rollback while service discovery is updating”

Then use one of these patterns:

Blue/Green

  • Two Deployments: my-app-blue, my-app-green
  • One Service selects the active version via labels
  • Rollback = switch Service selector back

Example Service:

apiVersion: v1
kind: Service
metadata:
  name: my-app
spec:
  selector:
    app: my-app
    version: blue
  ports:
  - port: 80
    targetPort: 8080

Rollback:

kubectl patch service my-app -p '{"spec":{"selector":{"app":"my-app","version":"blue"}}}'

Canary

  • Use Argo Rollouts / Flagger
  • Gradual traffic shifting with automatic rollback on failed metrics

Best practice for service discovery during rollback

  • Service discovery should always resolve the Service, not individual pods
  • Use readiness probes
  • Use graceful termination so terminated pods stop receiving traffic safely
  • Use PodDisruptionBudget if availability matters

Example:

apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  name: my-app-pdb
spec:
  minAvailable: 2
  selector:
    matchLabels:
      app: my-app

Quick answer

If you want rollback-safe service discovery with autoscaling:

  1. Put pods behind a Kubernetes Service
  2. Use Deployment + readinessProbe
  3. Add HPA for autoscaling
  4. Roll back with kubectl rollout undo
  5. If you need version-based switching, use Blue/Green or Argo Rollouts

If you want, I can give you:

  • a full YAML example for Deployment + Service + HPA + rollback
  • a Blue/Green rollback example
  • or a microservices service-discovery pattern using Kubernetes DNS.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.