diff --git a/scenarios/aws/eks/run.go b/scenarios/aws/eks/run.go index 0b2aeb287..b707feb27 100644 --- a/scenarios/aws/eks/run.go +++ b/scenarios/aws/eks/run.go @@ -38,9 +38,11 @@ func Run(ctx *pulumi.Context) error { return err } - if _, err := vpa.DeployCRD(&awsEnv, cluster.KubeProvider); err != nil { + vpaCrd, err := vpa.DeployCRD(&awsEnv, cluster.KubeProvider) + if err != nil { return err } + dependsOnVPA := utils.PulumiDependsOn(vpaCrd) if awsEnv.InitOnly() { return nil @@ -110,11 +112,11 @@ func Run(ctx *pulumi.Context) error { // Deploy testing workload if awsEnv.TestingWorkloadDeploy() { - if _, err := nginx.K8sAppDefinition(&awsEnv, cluster.KubeProvider, "workload-nginx", "", true, utils.PulumiDependsOn(workloadWithCRDDeps...)); err != nil { + if _, err := nginx.K8sAppDefinition(&awsEnv, cluster.KubeProvider, "workload-nginx", "", true, utils.PulumiDependsOn(workloadWithCRDDeps...), dependsOnVPA); err != nil { return err } - if _, err := redis.K8sAppDefinition(&awsEnv, cluster.KubeProvider, "workload-redis", true, utils.PulumiDependsOn(workloadWithCRDDeps...)); err != nil { + if _, err := redis.K8sAppDefinition(&awsEnv, cluster.KubeProvider, "workload-redis", true, utils.PulumiDependsOn(workloadWithCRDDeps...), dependsOnVPA); err != nil { return err } diff --git a/scenarios/aws/kindvm/run.go b/scenarios/aws/kindvm/run.go index f58e2cb39..6a919d559 100644 --- a/scenarios/aws/kindvm/run.go +++ b/scenarios/aws/kindvm/run.go @@ -69,9 +69,11 @@ func Run(ctx *pulumi.Context) error { return err } - if _, err := vpa.DeployCRD(&awsEnv, kindKubeProvider); err != nil { + vpaCrd, err := vpa.DeployCRD(&awsEnv, kindKubeProvider) + if err != nil { return err } + dependsOnVPA := utils.PulumiDependsOn(vpaCrd) var dependsOnCrd pulumi.ResourceOption @@ -203,11 +205,11 @@ spec: // Deploy testing workload if awsEnv.TestingWorkloadDeploy() { - if _, err := nginx.K8sAppDefinition(&awsEnv, kindKubeProvider, "workload-nginx", "", true, dependsOnCrd); err != nil { + if _, err := nginx.K8sAppDefinition(&awsEnv, kindKubeProvider, "workload-nginx", "", true, dependsOnCrd, dependsOnVPA); err != nil { return err } - if _, err := redis.K8sAppDefinition(&awsEnv, kindKubeProvider, "workload-redis", true, dependsOnCrd); err != nil { + if _, err := redis.K8sAppDefinition(&awsEnv, kindKubeProvider, "workload-redis", true, dependsOnCrd, dependsOnVPA); err != nil { return err }