https://pulumi.com logo
Title
l

limited-wolf-14679

03/09/2023, 11:51 PM
Hi Guys, i am new to pulumi and trying to deploy kubeflow on gcp. I am using pulumi python and GCP...and deployed pulumi kuberntes-gcp-python and now I would like to deploy kubeflow but I am stuck. Any help ? I have tried to run the following code but no success:
# new kubeflow
kubeflow = gcp.container.Registry("kubeflow")

deployment = Deployment(
    "kubeflow-deployment",
    spec=DeploymentSpecArgs(
        replicas=1,
        selector=LabelSelectorArgs(
            match_labels={
                "app": "kubeflow",
            },
        ),
        template=PodTemplateSpecArgs(
            metadata=ObjectMetaArgs(
                labels={
                    "app": "kubeflow",
                },
            ),
            spec=PodSpecArgs(
                containers=[
                    ContainerArgs(
                        name="kubeflow",
                        image="kubeflow",
                        env=[
                            EnvVarArgs(
                                name="NAMESPACE",
                                value="kubeflow",
                            ),
                        ],
                        command=["/bin/bash"],
                        args=[
                            "-c",
                            "/opt/deploy.sh",
                        ]
                        
                    )
                ]

            )
        )
    ),
    metadata=ObjectMetaArgs(
        labels={
            "app": "kubeflow",
        }
    )
)

pulumi.export("name", deployment.metadata["name"])

# Allocate an IP to the Deployment.
app_name = "kubeflow"
app_labels = { "app": app_name }
frontend = Service(
    app_name,
    metadata={
        "labels": deployment.spec["template"]["metadata"]["labels"],
    },
    spec={
        "type":  "LoadBalancer",
        "ports": [{ "port": 80, "target_port": 80, "protocol": "TCP" }],
        "selector": app_labels,
    })

# When "done", this will print the public IP.
result = None

ingress = frontend.status.apply(lambda v: v["load_balancer"]["ingress"][0] if "load_balancer" in v else None)
if ingress is not None:
    result = ingress.apply(lambda v: v["ip"] if "ip" in v else v["hostname"])

pulumi.export("ip", result)
I am getting the following error: * the Kubernetes API server reported that "default/kubeflow-deployment-d5cb3c03" failed to fully initialize or become live: 'kubeflow-deployment-d5cb3c03' timed out waiting to be Ready * [MinimumReplicasUnavailable] Deployment does not have minimum availability. * [ProgressDeadlineExceeded] ReplicaSet "kubeflow-deployment-d5cb3c03-769cdfbd67" has timed out progressing. * Minimum number of live Pods was not attained * [Pod kubeflow-deployment-d5cb3c03-769cdfbd67-4lsjp]: containers with unready status: [kubeflow] -- [ImagePullBackOff] Back-off pulling image "kubeflow"
a

abundant-vegetable-12924

03/10/2023, 5:19 PM
I'm very much learning as well, but my intuition here would be to log into gcp and look at logs there... something within gcp seems unhappy and the deployment isn't coming up....what do the k8s logs tell you?
p

purple-electrician-80135

03/10/2023, 11:20 PM
Image pull backoff is many times due to inability to access the image repo you gave it. This could mean ingress/egress isn't setup for the subnet GKE is on to be able to access your container registry.
l

limited-wolf-14679

03/13/2023, 8:06 PM
Thank you guys...will take a look into that.