<p>I am trying to set up Kubernetes in my instance on a ubuntu 22.04 virtual machine. While in the installation process i am trying to add a gpg key for intra cluster communication. After running the command:</p>
<p><code>sudo curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add</code></p>
<p>I got a message that <code>apt-key</code> add was <em>deprecated</em> and I should read the <code>apt-key(8) man</code> page. Can anyone tell me what exactly, I should type on my terminal instead of this!</p>

Moni 93
<p>I share this link.</p>
<p><a href="https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/#install-using-native-package-management" rel="nofollow noreferrer">Install using native package management</a></p>
<ol>
<li>Update the apt package index and install packages needed to use the Kubernetes apt repository:</li>
</ol>
<pre><code>sudo apt-get update
sudo apt-get install -y ca-certificates curl
</code></pre>
<ol start="2">
<li>Download the Google Cloud public signing key:</li>
</ol>
<pre><code>sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
</code></pre>
<ol start="3">
<li>Add the Kubernetes apt repository:</li>
</ol>
<pre><code>echo &quot;deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main&quot; | sudo tee /etc/apt/sources.list.d/kubernetes.list
</code></pre>
<ol start="4">
<li>Update apt package index with the new repository and install kubectl:</li>
</ol>
<pre><code>sudo apt-get update
sudo apt-get install -y kubectl
</code></pre>
