@@ -196,6 +196,10 @@ func (sc *StackContainer) selector() map[string]string {
196196// "zalando.org/forward-backend", the deployment will be set to
197197// replicas 1.
198198func (sc * StackContainer ) GenerateDeployment () * appsv1.Deployment {
199+ if sc .TrafficForward () {
200+ // during traffic forwarding we do not need a deployment
201+ return nil
202+ }
199203
200204 stack := sc .Stack
201205
@@ -234,12 +238,6 @@ func (sc *StackContainer) GenerateDeployment() *appsv1.Deployment {
234238 Labels : embeddedCopy .Labels ,
235239 }
236240
237- if _ , clusterMigration := sc .Stack .Annotations [forwardBackendAnnotation ]; clusterMigration && * updatedReplicas != 0 {
238- updatedReplicas = wrapReplicas (1 )
239- sc .deploymentReplicas = 1
240- sc .stackReplicas = 1
241- }
242-
243241 deployment := & appsv1.Deployment {
244242 ObjectMeta : sc .resourceMeta (),
245243 Spec : appsv1.DeploymentSpec {
@@ -270,7 +268,7 @@ func (sc *StackContainer) GenerateHPA() (
270268 * autoscaling.HorizontalPodAutoscaler ,
271269 error ,
272270) {
273- if _ , clusterMigration := sc .Stack . Annotations [ forwardBackendAnnotation ]; clusterMigration {
271+ if sc .TrafficForward () {
274272 return nil , nil
275273 }
276274
@@ -477,7 +475,7 @@ func (sc *StackContainer) generateIngress(segment bool) (
477475 Rules : rules ,
478476 },
479477 }
480- if _ , clusterMigration := sc .Stack . Annotations [ forwardBackendAnnotation ]; clusterMigration {
478+ if sc .TrafficForward () {
481479 // see https://opensource.zalando.com/skipper/kubernetes/ingress-usage/#skipper-ingress-annotations
482480 result .Annotations ["zalando.org/skipper-backend" ] = "forward"
483481 }
0 commit comments