SSL installation in Click-to-deploy Reposatory in GCP

4/16/2020

I am using the click-to-deploy repository for Wordpress installation.

the is a commend in the instruction Update TLS certificate for WordPress

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:

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 -

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

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

Which cloud shell I run to write this commend so I can implement my SSL.

I try it on Cluster this is the output:Output of this commend in a cluster

-- Sushen Biswas
kubernetes
ssl
wordpress

1 Answer

4/16/2020

From the output I can tell that Your environmental value $NAMESPACE is empty.

So the command:

kubectl --namespace $NAMESPACE create secret tls ...

is the same as

kubectl --namespace create secret tls ...

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


To fix this make sure the environmental values are set up correctly.

You can check their values by using:

echo $APP_INSTANCE_NAME
echo $NAMESPACE

If they are indeed empty or different than expected use like mentioned in the guide:

export APP_INSTANCE_NAME=wordpress-1
export NAMESPACE=default

Hope it helps.

-- Piotr Malec
Source: StackOverflow