From 31aa10ec3342a967bbc7f285733a7627e6bcb8e9 Mon Sep 17 00:00:00 2001 From: Kam D Kasravi Date: Sun, 10 Mar 2019 10:09:00 -0700 Subject: [PATCH] fixes 'kfctl generated yaml fails validation #2653' --- kubeflow/argo/argo.libsonnet | 18 +-- kubeflow/argo/tests/argo_test.jsonnet | 18 +-- kubeflow/common/ambassador.libsonnet | 32 ++--- kubeflow/common/tests/ambassador_test.jsonnet | 111 +++++++++--------- .../pipeline/pipeline-viewercrd.libsonnet | 1 - 5 files changed, 90 insertions(+), 90 deletions(-) diff --git a/kubeflow/argo/argo.libsonnet b/kubeflow/argo/argo.libsonnet index bc1b6921371..17c56cc8cdc 100644 --- a/kubeflow/argo/argo.libsonnet +++ b/kubeflow/argo/argo.libsonnet @@ -35,10 +35,10 @@ local workflowController = { apiVersion: "extensions/v1beta1", kind: "Deployment", - labels: { - app: "workflow-controller", - }, metadata: { + labels: { + app: "workflow-controller", + }, name: "workflow-controller", namespace: params.namespace, }, @@ -168,6 +168,12 @@ resources: {}, terminationMessagePath: "/dev/termination-log", terminationMessagePolicy: "File", + readinessProbe: { + httpGet: { + path: "/", + port: 8001, + }, + }, }, ], dnsPolicy: "ClusterFirst", @@ -177,12 +183,6 @@ serviceAccount: "argo-ui", serviceAccountName: "argo-ui", terminationGracePeriodSeconds: 30, - readinessProbe: { - httpGet: { - path: "/", - port: 8001, - }, - }, }, }, }, diff --git a/kubeflow/argo/tests/argo_test.jsonnet b/kubeflow/argo/tests/argo_test.jsonnet index 41d5b77a07d..1c6d581b65f 100644 --- a/kubeflow/argo/tests/argo_test.jsonnet +++ b/kubeflow/argo/tests/argo_test.jsonnet @@ -51,10 +51,10 @@ local testCases = [ expected: { apiVersion: "extensions/v1beta1", kind: "Deployment", - labels: { - app: "workflow-controller", - }, metadata: { + labels: { + app: "workflow-controller", + }, name: "workflow-controller", namespace: "kubeflow", }, @@ -182,18 +182,18 @@ local testCases = [ image: "argoproj/argoui:v2.2.0", imagePullPolicy: "IfNotPresent", name: "argo-ui", + readinessProbe: { + httpGet: { + path: "/", + port: 8001, + }, + }, resources: {}, terminationMessagePath: "/dev/termination-log", terminationMessagePolicy: "File", }, ], dnsPolicy: "ClusterFirst", - readinessProbe: { - httpGet: { - path: "/", - port: 8001, - }, - }, restartPolicy: "Always", schedulerName: "default-scheduler", securityContext: {}, diff --git a/kubeflow/common/ambassador.libsonnet b/kubeflow/common/ambassador.libsonnet index f110647de32..e85ce1b3eaa 100644 --- a/kubeflow/common/ambassador.libsonnet +++ b/kubeflow/common/ambassador.libsonnet @@ -145,7 +145,7 @@ ambassadorRoleBinding:: ambassadorRoleBinding, local ambassadorDeployment = { - apiVersion: "extensions/v1beta1", + apiVersion: "apps/v1beta1", kind: "Deployment", metadata: { name: "ambassador", @@ -174,15 +174,17 @@ }, ], image: params.ambassadorImage, - livenessProbe: { - httpGet: { - path: "/ambassador/v0/check_alive", - port: 8877, + name: "ambassador", + resources: { + limits: { + cpu: 1, + memory: "400Mi", + }, + requests: { + cpu: "200m", + memory: "100Mi", }, - initialDelaySeconds: 30, - periodSeconds: 30, }, - name: "ambassador", readinessProbe: { httpGet: { path: "/ambassador/v0/check_ready", @@ -191,15 +193,13 @@ initialDelaySeconds: 30, periodSeconds: 30, }, - resources: { - limits: { - cpu: 1, - memory: "400Mi", - }, - requests: { - cpu: "200m", - memory: "100Mi", + livenessProbe: { + httpGet: { + path: "/ambassador/v0/check_alive", + port: 8877, }, + initialDelaySeconds: 30, + periodSeconds: 30, }, }, ], diff --git a/kubeflow/common/tests/ambassador_test.jsonnet b/kubeflow/common/tests/ambassador_test.jsonnet index c5474c86285..98b5a00b971 100644 --- a/kubeflow/common/tests/ambassador_test.jsonnet +++ b/kubeflow/common/tests/ambassador_test.jsonnet @@ -159,71 +159,72 @@ local testCases = [ }, { actual: instance.parts.ambassadorDeployment, - expected: { - apiVersion: "extensions/v1beta1", - kind: "Deployment", - metadata: { - name: "ambassador", - namespace: "kubeflow", - }, - spec: { - replicas: 3, - template: { - metadata: { - labels: { - service: "ambassador", + expected: + { + apiVersion: "apps/v1beta1", + kind: "Deployment", + metadata: { + name: "ambassador", + namespace: "kubeflow", + }, + spec: { + replicas: 3, + template: { + metadata: { + labels: { + service: "ambassador", + }, + namespace: "kubeflow", }, - namespace: "kubeflow", - }, - spec: { - containers: [ - { - env: [ - { - name: "AMBASSADOR_NAMESPACE", - valueFrom: { - fieldRef: { - fieldPath: "metadata.namespace", + spec: { + containers: [ + { + env: [ + { + name: "AMBASSADOR_NAMESPACE", + valueFrom: { + fieldRef: { + fieldPath: "metadata.namespace", + }, }, }, + ], + image: "quay.io/datawire/ambassador:0.37.0", + livenessProbe: { + httpGet: { + path: "/ambassador/v0/check_alive", + port: 8877, + }, + initialDelaySeconds: 30, + periodSeconds: 30, }, - ], - image: "quay.io/datawire/ambassador:0.37.0", - livenessProbe: { - httpGet: { - path: "/ambassador/v0/check_alive", - port: 8877, - }, - initialDelaySeconds: 30, - periodSeconds: 30, - }, - name: "ambassador", - readinessProbe: { - httpGet: { - path: "/ambassador/v0/check_ready", - port: 8877, - }, - initialDelaySeconds: 30, - periodSeconds: 30, - }, - resources: { - limits: { - cpu: 1, - memory: "400Mi", + name: "ambassador", + readinessProbe: { + httpGet: { + path: "/ambassador/v0/check_ready", + port: 8877, + }, + initialDelaySeconds: 30, + periodSeconds: 30, }, - requests: { - cpu: "200m", - memory: "100Mi", + resources: { + limits: { + cpu: 1, + memory: "400Mi", + }, + requests: { + cpu: "200m", + memory: "100Mi", + }, }, }, - }, - ], - restartPolicy: "Always", - serviceAccountName: "ambassador", + ], + restartPolicy: "Always", + serviceAccountName: "ambassador", + }, }, }, }, - }, }, ]; diff --git a/kubeflow/pipeline/pipeline-viewercrd.libsonnet b/kubeflow/pipeline/pipeline-viewercrd.libsonnet index 544d3abb85f..21038931d33 100644 --- a/kubeflow/pipeline/pipeline-viewercrd.libsonnet +++ b/kubeflow/pipeline/pipeline-viewercrd.libsonnet @@ -31,7 +31,6 @@ app: app_label, }, name: viewer_controller_role, - namespace: namespace, }, rules: [ {