Skip to content

Conversation

@maelvls
Copy link
Member

@maelvls maelvls commented Feb 16, 2021

Closes #21

The Marketplace requires us to give a "Deploy documentation URL" that details the steps for installing the solution from the command line.

I took a lot of inspiration from the Unleash Enterprise solution (which is a paid offering). Our own CLI deploy documentation will probably look like something similar to their README.md.

⚠️ If we want to be able to share the CLI doc URL, we must set this repo as public

Signed-off-by: Maël Valais [email protected]

@maelvls maelvls marked this pull request as draft February 16, 2021 18:23
@maelvls maelvls added this to the initial-release milestone Feb 16, 2021
The Marketplace requires us to give a "Deploy documentation URL" that
details the steps for installing the solution from the command line.

Signed-off-by: Maël Valais <[email protected]>
@maelvls maelvls force-pushed the add-cli-instructions branch from eceb144 to 441c97d Compare February 17, 2021 08:06
@maelvls
Copy link
Member Author

maelvls commented Feb 17, 2021

Update:

  • As detailed in the Marketplace doc, the CLI instructions I wrote will not create RBAC or service accounts except for the google-cas-issuer service account since it is required for a subsequent step in the README
  • I took all my inspiration from the Unleash Enterprise readme

Copy link
Member

@wallrj wallrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Part 1

Comment on lines +105 to +108
The [workload
identity](https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity)
must be enabled on your cluster. To create a cluster that has _workload
identity_ feature enabled, run the following command:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The [workload
identity](https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity)
must be enabled on your cluster. To create a cluster that has _workload
identity_ feature enabled, run the following command:
The [workload
identity](https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity) feature
must be enabled on your cluster. To create a cluster that has _workload
identity_ feature enabled, run the following command:

README.md Outdated
Comment on lines 166 to 168
Choose an instance name and
[namespace](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/)
for the application. In most cases, you can use the `default` namespace.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Choose an instance name and
[namespace](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/)
for the application. In most cases, you can use the `default` namespace.
Choose an instance name and
[namespace](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/)
for the application.

I don't think we want users to install cert-manager in the default namespace.
cert-manager will use it's namespace to determine where to look for secrets for cluster scoped ClusterIssuers.
cert-manager usually lives in cert-manager.

But at the same time I don't know whether it's appropriate to also install cas-issuer and preflight agent in that namespace.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, this wording was for Unleash Enterprise and in their case they did recommend the app to be running on a standalone cluster.

In the case of Jetstack Secure for cert-manager, running it in default is a bad idea 😅

README.md Outdated
TAG="1.1.0-gcm.1" # stable tag (recommended)
TAG="1.1.0" # moving tag, targets cert-manager 1.1.0
TAG="1.1" # moving tag, targets cert-manager 1.1
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would confuse me. How should I decide which tag to use? I would need to set the image pull policy to always and to do kubectl rollout restart on cert-manager, preflight, cas-issuer deployments in order to get the latest versions from the moving-target tags.

Perhaps we should remove any reference to those moving target tags until we figure out the correct upgrade process.

README.md Outdated
```

The available tags are listed on the [Marketplace Container
Registry](marketplace.gcr.io/jetstack-public/jetstack-secure-for-cert-manager).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, what should the user do with this info?
Instead, shall we hard code a version tag for now into this README and create a git tag, and link to that tag from the GCM page?
When we release a new version of jsp-gcm, we update the README with the latest tag, and update the GCM page with the link to that tag.

Ignore these comments if they don't make sense.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I thinnk i didnt't think twice while writing this; I am not helping the user pick the right version here

I'll remove this link for now and let's figure out a way to let users know which version they should pick later.

```shell
APP_INSTANCE_NAME=jetstack-secure-1
NAMESPACE=default
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a command / instruction, to create the namespace

Comment on lines 170 to 173
```shell
APP_INSTANCE_NAME=jetstack-secure-1
NAMESPACE=default
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```shell
APP_INSTANCE_NAME=jetstack-secure-1
NAMESPACE=default
```
```shell
APP_INSTANCE_NAME=jetstack-secure-1
NAMESPACE=default
kubectl create namespace "${NAMESPACE}" || true

Comment on lines 240 to 242
```shell
kubectl apply -f "${APP_INSTANCE_NAME}_manifest.yaml" --namespace "${NAMESPACE}"
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The manifest contains various references to kube-system which clashes with the namespace given to kubectl

$ kubectl apply -f "${APP_INSTANCE_NAME}_manifest.yaml" --namespace "${NAMESPACE}"
...
the namespace from the provided object "kube-system" does not match the namespace "jetstack-secure". You must pass '--namespace=kube-system' to perform this operation.
the namespace from the provided object "kube-system" does not match the namespace "jetstack-secure". You must pass '--namespace=kube-system' to perform this operation.
the namespace from the provided object "kube-system" does not match the namespace "jetstack-secure". You must pass '--namespace=kube-system' to perform this operation.
the namespace from the provided object "kube-system" does not match the namespace "jetstack-secure". You must pass '--namespace=kube-system' to perform this operation.

@maelvls
Copy link
Member Author

maelvls commented Feb 17, 2021

Done! I moved our own doc to docs/TESTING-DEPLOYER.md so there is no confusion between the CLI instructions and the UI-specific deployer stuff

@maelvls maelvls marked this pull request as ready for review February 17, 2021 12:19
Copy link
Member

@wallrj wallrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good to me @maelvls

You've put a lot of work in to this!

Some of the instructions failed for me, but perhaps that's down to my version of gcloud or my Linux environment.

Please answer or address the comments below, and then I'll add a lgtm

README.md Outdated
Comment on lines 256 to 259
The Certificate Authority Service is a highly available, scalable Google Cloud
service that enables you to simplify, automate, and customize the
deployment, management, and security of private certificate authorities
(CA).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The Certificate Authority Service is a highly available, scalable Google Cloud
service that enables you to simplify, automate, and customize the
deployment, management, and security of private certificate authorities
(CA).
[Google Certificate Authority Service][] is a highly available, scalable Google Cloud
service that enables you to simplify, automate, and customize the
deployment, management, and security of private certificate authorities
(CA).
[Google Certificate Authority Service]: https://cloud.google.com/certificate-authority-service/

Comment on lines 267 to 270
```sh
gcloud beta privateca roots create my-ca --location $LOCATION --subject="CN=root,O=my-ca"
gcloud beta privateca subordinates create my-sub-ca --issuer=my-ca --location $LOCATION --subject="CN=intermediate,O=my-ca,OU=my-sub-ca"
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```sh
gcloud beta privateca roots create my-ca --location $LOCATION --subject="CN=root,O=my-ca"
gcloud beta privateca subordinates create my-sub-ca --issuer=my-ca --location $LOCATION --subject="CN=intermediate,O=my-ca,OU=my-sub-ca"
```
```sh
LOCATION=europe-west1
gcloud beta privateca roots create my-ca --location ${LOCATION} --subject="CN=root,O=my-ca"
gcloud beta privateca subordinates create my-sub-ca --issuer=my-ca --location ${LOCATION} --issuer-location ${LOCATION} --subject="CN=intermediate,O=my-ca,OU=my-sub-ca"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I got this error message:

[richard@drax jsp-gcm]$ gcloud beta privateca subordinates create my-sub-ca  --issuer=my-ca --location ${LOCATION} --subject="CN=intermediate,O=my-ca,OU=my-sub-ca"
ERROR: (gcloud.beta.privateca.subordinates.create) Error parsing [issuer].
The [Issuer] resource is not properly specified.
Failed to find attribute [location]. The attribute can be set in the following ways: 
- provide the argument `--issuer-location` on the command line
- set the property `privateca/location`

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And even with that extra --issuer-location ... argument, I now get this error:

[richard@drax jsp-gcm]$ gcloud beta privateca subordinates create my-sub-ca  --issuer=my-ca --location ${LOCATION} --issuer-location ${LOCATION} --subject="CN=intermediate,O=my-ca,OU=my-sub-ca"
WARNING: CA Service is currently in preview.

Please remember that all resources created during preview will be deleted
when CA service transitions to General Availability (GA). Relying on these
certificate authorities for production traffic is discouraged.
Creating Certificate Authority....done.                                                                                                                                                                                                  
Activating CA....failed.                                                                                                                                                                                                                 
ERROR: (gcloud.beta.privateca.subordinates.create) Could not verify certificate with chain: Chain violates pathlength restriction. Pathlength 0 on cert CN=root,O=my-ca with CA length 1

Perhaps we should just link to Google CAS Issuer installation instructions instead of recreating them here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah... I agree, I'll just give a link to the official documentation.

The new command would be:

LOCATION=europe-west1
gcloud beta privateca roots create example-root-ca \
  --location ${LOCATION} \
  --reusable-config "example-intermediate-ca-pathlen-0" \
  --subject="CN=Example Root CA 1, O=Example LLC"
gcloud beta privateca subordinates create example-ca-1 \
  --issuer=example-root-ca \
  --issuer-location ${LOCATION} \
  --reusable-config "example-intermediate-ca-pathlen-0" \
  --subject="CN=Example Intermediate CA, O=Example LLC"

I think the subject validation appeared recently maybe? Do they have some form of CHANGELOG for the Google CAS service btw? @jakexks

README.md Outdated
Comment on lines 351 to 352
This is the repository that holds the configuration for our Google
Marketplace solution, [jetstack-secure-for-cert-manager][].
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This is the repository that holds the configuration for our Google
Marketplace solution, [jetstack-secure-for-cert-manager][].

This is in the wrong place.

README.md Outdated

## Technical considerations

**Retagging cert-manager images:**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we remove all this stuff now? It may confuse the user who visits this repo looking for GCM CLI instructions.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good idea; I moved it to docs/TESTING-DEPLOYER.md, does it make sense? I also added a note about the "deployer" being only for the UI stuff

acmesolver:
image:
repository: marketplace.gcr.io/jetstack-public/jetstack-secure-for-cert-manager/cert-manager-acmesolver
tag:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tag:
tag: 1.1.0-gcm.1

Is this supposed to have the same tag as other images?

@maelvls
Copy link
Member Author

maelvls commented Feb 17, 2021

Looks liike some objects have no namespace field which means they get created in the default namespace:

Screenshot 2021-02-17 at 15 12 28

The "cert-manager" namespace made sense for cert-manager itself but we
are now talking about "jetstack-secure"

Signed-off-by: Maël Valais <[email protected]>
@maelvls maelvls force-pushed the add-cli-instructions branch from d760637 to 331daad Compare February 17, 2021 14:35
@maelvls maelvls force-pushed the add-cli-instructions branch from 331daad to 65b645b Compare February 17, 2021 14:38
wallrj and others added 4 commits February 17, 2021 14:43
@maelvls maelvls force-pushed the add-cli-instructions branch from 1a31d10 to 212bbbb Compare February 17, 2021 16:58
Copy link
Member

@wallrj wallrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@jetstack-bot jetstack-bot merged commit 7e19d08 into main Feb 17, 2021
@maelvls maelvls deleted the add-cli-instructions branch November 3, 2021 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Write CLI instructions (this issue holds all the screenshots that are in the README.md and in docs/*.md)

4 participants