Trouble Pulling Images from Self-Hosted Private GitLab Registry in Kubeflow Pipelines on k3s/WSL2

79 Views Asked by At

I am new on Kubernetes and Kubeflow and trying to pull images from my self hosted private gitlab registry in Kubeflow Pipelines. This is my pipeline:

@container_component
def container_component_trial(sentence_count:str, output_gcs: Output[Dataset]):
    return ContainerSpec(
        image='gitex.xx:latest',
        command=[
            'python3',
            'sentence_generator_app.py',
        ],
        args=[
            '--output_path', output_gcs.path,
            '--sentence_count', sentence_count
        ]
    )

@pipeline(name='container-running-pipeline')
def my_pipeline():
    component = container_component_trial(sentence_count = "5")

compiler.Compiler().compile(
        pipeline_func=my_pipeline,
        package_path='./my_pipeline.yaml')

I am using k3s on WSL2 Ubuntu. I created secret key using this command:

kubectl create secret docker-registry gitlab-registry-secret \
> --docker-server=gitex.xx \
> --docker-username=my_username \
> --docker-password=my_password\
> --docker-email=yy@xx \
-n kubeflow

I then patched this secret to the service account, to ensure it's added to every pod created

kubectl patch serviceaccount pipeline-runner \
>   -p "{\"imagePullSecrets\": [{\"name\": \"gitlab-registry-secret\"}]}" \
> -n kubeflow

Despite this, when I trigger a pipeline run, I receive the Error: ErrImagePull error, indicating that my pods cannot pull the required images from the GitLab registry.

Additional information:

  1. I can pull images using the same credentials using docker.
  2. I can ping the gitlab host machine from a pod in my machine.

I am totally stuck at this part. Any help would be appreciated

0

There are 0 best solutions below