<p>I use k8s with helm 3.</p>
<p>I want for test purpose, be able to access the current cluster of current machine.</p>
<p>When I run:</p>
<pre><code>kubectl config view --raw
</code></pre>
<p>The output is like this:</p>
<pre><code>apiVersion: v1
clusters:
- cluster:
    server: https://...
  name: cluster.local
contexts:
- context:
    cluster: cluster.local
    namespace: ...
    user: kubernetes-admin
  name: kubernetes-admin@cluster.local
current-context: kubernetes-admin@cluster.local
kind: Config
preferences: {}
users:
- name: kubernetes-admin
  user:
    client-certificate-data: 
    ...
    client-key-data: 
    ....
</code></pre>
<p>For the output, I see that there that the configuration has server of name: <code>cluster.local</code>, and <code>current-context: kubernetes-admin@cluster.local</code>.</p>
<p>(Same as on ~/.kube/config file).</p>
<p>For users, there is one user called: <code>kubernetes-admin</code> with <code>client-certificate-data</code> value and <code>client-key-data</code> value. Also I see that there is a key:</p>
<p>What are <code>kubernetes-admin</code> and <code>client-certificate-data</code> stands for, and can I use them in <code>ImagePullSecret</code> section for K8S object of kind: Pod in container.</p>
<p>i.e:</p>
<p>I create a secret:</p>
<pre><code>kubectl create secret my-secret .... 
</code></pre>
<p>What to do in order to create a secret of the with certificate and not user + password?</p>
<p>and a pod (yaml file):</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: test-pod
  labels:
    name: test-pod
    app: test-pod
spec:
  imagePullSecrets:
    - name: my-secret
  containers:
    - name: test-pod
      image: &quot;my-image:1.0&quot;
      imagePullPolicy: IfNotPresent 
</code></pre>
<p>Can I create a secret use in <code>imagePullSecret</code> without provide user+password (this is no user and password - it's a certificate key / ssh).</p>
<p>For test purpose, I am using the current machine (before uploading to remote registry. Need to do some tests before that).</p>
<p>Thanks.</p>

Eitan
<p>I will contribute my knowledge as a solution for this issue.</p>
<p>There is no need to create a secret key for the current registry of local machine.</p>
<p>The current default cluster name is <code>cluster.local</code>.</p>
<p>All is needed to add an alias for the image, called: <code>cluster.local/my-image:tag</code> and use it in the yaml code.</p>
<p>That means, running:</p>
<pre><code>docker tag my-image:1.0 cluster.local/myimage:1.0
</code></pre>
<p>and in yaml:</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: test-pod
  labels:
    name: test-pod
    app: test-pod
spec:
  containers:
    - name: test-pod
      image: &quot;cluster.local/my-image:1.0&quot;
      imagePullPolicy: IfNotPresent 
</code></pre>
