<p>I am using the click-to-deploy repository for Wordpress installation.</p>

<p>the is a commend in the instruction <a href="https://github.com/GoogleCloudPlatform/click-to-deploy/blob/master/k8s/wordpress/README.md#update-tls-certificate-for-wordpress" rel="nofollow noreferrer">Update TLS certificate for WordPress</a></p>

<blockquote>
  <p>If you want to update the certificate that the application uses, copy
  the new certificate and key pair in to the /tmp/tls.crt, and
  /tmp/tls.key files, and execute the following command:</p>
</blockquote>

<pre><code>kubectl --namespace $NAMESPACE create secret tls $APP_INSTANCE_NAME-tls \
  --cert=/tmp/tls.crt --key=/tmp/tls.key --dry-run -o yaml | kubectl apply -f -
</code></pre>

<p>I saw so many video references and articles. they Use One VM and for that, they can start there shell very easily. </p>

<p>I am using Kubernaties it has three VM and if I run this command it will destroy the container infrastructure.</p>

<p><strong>Which cloud shell I run to write this commend so I can implement my SSL.</strong></p>

<p>I try it on Cluster this is the output:<a href="https://i.stack.imgur.com/7WXlr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7WXlr.png" alt="Output of this commend in a cluster"></a></p>

Sushen Biswas
<p>From the output I can tell that Your environmental value <code>$NAMESPACE</code> is empty.</p>

<p>So the command:</p>

<pre><code>kubectl --namespace $NAMESPACE create secret tls ...
</code></pre>

<p>is the same as </p>

<pre><code>kubectl --namespace create secret tls ...
</code></pre>

<p>this is why Your output said <code>unknown command "secret" for "kubectl"</code> the flag <code>--namespace</code> used up word <code>create</code> as its value because <code>$NAMESPACE</code> was empty.</p>

<hr>

<p>To fix this make sure the environmental values are set up correctly.</p>

<p>You can check their values by using:</p>

<pre><code>echo $APP_INSTANCE_NAME
echo $NAMESPACE
</code></pre>

<p>If they are indeed empty or different than expected use like mentioned in the <a href="https://github.com/GoogleCloudPlatform/click-to-deploy/blob/master/k8s/wordpress/README.md#prepare-the-environment-1" rel="nofollow noreferrer">guide</a>:</p>

<pre><code>export APP_INSTANCE_NAME=wordpress-1
export NAMESPACE=default
</code></pre>

<p>Hope it helps.</p>
