Since you are working with multiples namespaces, you need to use a FQDN for reach your services:

When you create a Service, it creates a corresponding DNS entry. This entry is of the form <service-name>.<namespace-name>.svc.cluster.local, which means that if a container just uses <service-name> it will resolve to the service which is local to a namespace. This is useful for using the same configuration across multiple namespaces such as Development, Staging and Production. If you want to reach across namespaces, you need to use the fully qualified domain name (FQDN)

In your case: service1.svc.myapp.svc.cluster.local

Secondly the name of initontainer should match the name of services I am looking up??

No. The initContainer name doesn’t matter in this field, you could use what you want.

In your case it should work:

        - name: my-init
          image: busybox:1.28
          command: ['sh', '-c', 'until nslookup service1.svc.myapp.svc.cluster.local; do echo waiting for service1.svc.myapp.svc.cluster.local; sleep 10; done;']


Understanding namespaces and DNS