Kubernetes on IBM cloud

I have IBM cloud which has Kubernetes installed and also have IBM cloud container repository.

I have to create pod will below yaml file but ending with error.

=====================
apiVersion: v1
kind: Pod
metadata:
name: mypod
spec:
containers:
- name: mypod
image: us.icr.io/think-tank-lab/think-tank-lab_dev/aranist:latest
imagePullSecrets:
- name: registry-secret

Curious what the error was, always good to share as part of the posts. Sometimes the issue is as simple as not having the correct indentation, namely “imagePullSecrets” should fall under the “spec” object.

I took your code and modified as follows to make it work (replace “_” with " ")

<–SNIP–>
apiVersion: v1
kind: Pod
metadata:
__name: mypod
spec:
__containers:
__ - name: mypod
____image: us.icr.io/think-tank-lab/think-tank-lab_dev/aranist:latest
__imagePullSecrets:
__- name: registry-secret
<–SNIP–>

Also, be sure to run in the correct namespace which is typically another cause of the issue.

cheers,
Bobby Saini

apiVersion: v1
kind: Pod
metadata:
name: mypod
spec:
containers:
- name: mypod
image: us.icr.io/think-tank-lab_dev/think-tank-lab_dev/aranist:latest
imagePullSecrets:
- name: registry-secret

  1. ibmcloud cr image-list
    us.icr.io/think-tank-lab_dev/aranist ( Image name )

  2. ibmcloud cr namespaces
    think-tank-lab_dev ( Repository name )

  3. I have namespace
    think-tank-lab

My requirement is to create pod under think-tank-lab namespace
I did not understand where should I put namespace attribute so that pod will create under think-tank-lab namespce.

Try adding the namespace under the metadata property.

apiVersion: v1
kind: Pod
metadata:
  name: mypod
  **namespace: think-tank-lab**
spec:
  containers:
  - name: mypod
    image: us.icr.io/think-tank-lab/think-tank-lab_dev/aranist:latest
  imagePullSecrets:
  - name: registry-secret

Regards,
Bobby Saini

It worked thanks for your help Bobby