Skip to content

Commit 5d4d866

Browse files
committed
update readme
1 parent be5834d commit 5d4d866

1 file changed

Lines changed: 47 additions & 27 deletions

File tree

README.md

Lines changed: 47 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Deploy help:
3030
``` bash
3131
hubploy deploy --help
3232
usage: hubploy deploy [-h] [--namespace NAMESPACE] [--set SET] [--set-string SET_STRING] [--version VERSION] [--timeout TIMEOUT] [--force] [--atomic]
33-
[--cleanup-on-fail] [--dry-run] [--image-overrides IMAGE_OVERRIDES [IMAGE_OVERRIDES ...]]
33+
[--cleanup-on-fail] [--dry-run] [--encrypted-key]
3434
deployment chart {develop,staging,prod}
3535

3636
positional arguments:
@@ -46,52 +46,72 @@ options:
4646
--set SET Helm option: set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
4747
--set-string SET_STRING
4848
Helm option: set STRING values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)
49-
--version VERSION Helm option: specify a version constraint for the chart version to use. This constraint can be a specific tag (e.g. 1.1.1) or it may reference a
50-
valid range (e.g. ^2.0.0). If this is not specified, the latest version is used.
49+
--version VERSION Helm option: specify a version constraint for the chart version to use. This constraint can be a specific tag (e.g. 1.1.1) or it may reference a valid range (e.g. ^2.0.0). If this is not specified, the latest version is used.
5150
--timeout TIMEOUT Helm option: time in seconds to wait for any individual Kubernetes operation (like Jobs for hooks, etc). Defaults to 300 seconds.
5251
--force Helm option: force resource updates through a replacement strategy.
53-
--atomic Helm option: if set, upgrade process rolls back changes made in case of failed upgrade. The --wait flag will be set automatically if --atomic is
54-
used.
52+
--atomic Helm option: if set, upgrade process rolls back changes made in case of failed upgrade. The --wait flag will be set automatically if --atomic is used.
5553
--cleanup-on-fail Helm option: allow deletion of new resources created in this upgrade when upgrade fails.
56-
--dry-run Dry run the helm upgrade command. This also renders the chart to STDOUT. This is not allowed to be used in a CI environment due to secrets being
57-
displayed in plain text, and the script will exit. To enable this option, set a local environment variable HUBPLOY_LOCAL_DEBUG=true
58-
--keyless Authenticate with Application Default Credentials instead of the service_key in hubploy.yaml, which is ignored. Needs workload identity
59-
federation in CI, or 'gcloud auth application-default login' locally. gcloud provider only.
54+
--dry-run Dry run the helm upgrade command. This also renders the chart to STDOUT. This is not allowed to be used in a CI environment due to secrets being displayed in plain text, and the script will exit. To enable this option, set a local environment variable HUBPLOY_LOCAL_DEBUG=true
55+
--encrypted-key, -K Use an encrypted service account key for GCP authentication. This is defined as service_key in hubploy.yaml. If this is not specified, the default GCP credentials will be used.
6056
```
6157
62-
## Keyless GCP authentication
58+
## Authentication
6359
64-
The `gcloud` provider normally decrypts the service account key named by
65-
`service_key` in `hubploy.yaml`, then activates it, which changes the machine's
66-
active gcloud login for the duration of the deploy.
60+
### GCP
6761
68-
`--keyless` skips all of that. It mints a token from [Application Default
69-
Credentials][adc], reads the cluster endpoint and CA cert from the GKE API, and
70-
writes its own kubeconfig. No key, no gcloud, no global state to put back.
62+
#### Keyless
7163
72-
[adc]: https://cloud.google.com/docs/authentication/application-default-credentials
64+
For logging in to GCP, `hubploy` mints a short-lived token from [Application
65+
Default Credentials](https://cloud.google.com/docs/authentication/application-default-credentials),
66+
reads the cluster endpoint and CA cert from the GKE API, and writes its own
67+
kubeconfig.
7368
74-
``` bash
75-
hubploy deploy --keyless <deployment> <chart> <environment>
76-
```
77-
78-
In CI, authenticate with workload identity federation first:
69+
In CI/CD, authenticate with workload identity federation first:
7970
8071
``` yaml
8172
- uses: google-github-actions/auth@v3
8273
with:
8374
workload_identity_provider: ${{ vars.WORKLOAD_IDENTITY_PROVIDER }}
8475
service_account: ${{ vars.DEPLOY_SA }}
8576

86-
- run: hubploy deploy --keyless <deployment> hub prod
77+
- run: hubploy deploy <deployment> <hub chart> <environment>
8778
```
8879
89-
Locally, log in once:
80+
For local deploy runs, be sure you're logged in:
9081
9182
``` bash
9283
gcloud auth application-default login
9384
```
9485
95-
`service_key` is ignored under `--keyless`, so one `hubploy.yaml` serves both
96-
paths and going back to the key means dropping the flag. Passing `--keyless`
97-
with a non-gcloud provider is an error.
86+
Note: If you happen to have encrypted keys defined in `hubploy.yaml`, they will
87+
be ignored by default.
88+
89+
#### Encrypted Keys
90+
91+
If you want to use encrypted keys on disk, the `gcloud` provider will decrypt
92+
the service account key named by `service_key` in `hubploy.yaml`. The service
93+
account is then activated, which changes the machine's active gcloud login for
94+
the duration of the deploy.
95+
96+
To use encrypted key authentication, pass the `--encrypted-key/-K` flags after
97+
`deploy` on the CLI.
98+
99+
``` bash
100+
hubploy deploy -K <deployment> <hub chart> <environment>
101+
```
102+
103+
### AWS
104+
105+
Currently, you can use either the AWS environment variables or an encrypted key.
106+
107+
For the environment variables, ensure that the following are present and current:
108+
109+
``` bash
110+
AWS_ACCESS_KEY_ID
111+
AWS_SECRET_ACCESS_KEY
112+
AWS_SESSION_TOKEN
113+
```
114+
115+
### Azure
116+
117+
Azure authentication is handled purely with an encrypted file.

0 commit comments

Comments
 (0)