Skip to content

Commit a0cbfb9

Browse files
authored
Don't bother with keys for dev (canada-ca#1775)
This commit switches to using https for retrieving the repo instead of ssh since it's public anyway.
1 parent 306f789 commit a0cbfb9

8 files changed

Lines changed: 22 additions & 35 deletions

File tree

deploy/README.md

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,6 @@ The Tracker project uses [Flux](https://fluxcd.io/), to enable [pull based](http
44

55
The directory here is laid out to allow the patching of a basic flux install. It is based on [the example](https://docs.fluxcd.io/en/1.18.0/tutorials/get-started-kustomize.html) in the documentation.
66

7-
## Creating credentials for Flux
8-
9-
Tracker uses SSH deploy keys, and uses kustomize to [generate secrets](https://github.com/kubernetes-sigs/kustomize/blob/master/examples/secretGeneratorPlugin.md#secret-values-from-local-files). To create the keys, use the following commands.
10-
11-
```bash
12-
ssh-keygen -q -N "" -C "flux-read-only" -f ./deploy/creds/readonly/identity
13-
ssh-keyscan github.com > ./deploy/creds/readonly/known_hosts
14-
```
15-
16-
With keys in hand, take the output of `cat deploy/creds/readonly/identity.pub` and [add a new deploy key](https://github.com/canada-ca/tracker/settings/keys/new) to the Tracker repo. Obviously only select "Allow write access" if you are creating a read/write key to allow Flux to automate deployments. Typically we'd only want read/write in production, and everything else using read.
17-
187
## Testing config changes
198

209
Config changes can be pretty high impact, so trying it out somewhere is pretty useful. To that end, we have a few ways to bring up a "non-prod" version of the app; basically, using a self signed cert and requesting its own IP address.
@@ -51,11 +40,16 @@ kustomize build deploy/aks | kubectl apply -f -
5140

5241
Deploying to prod is a little anticlimactic. You'll want some read/write credentials for Flux so that it can [update our config](https://toolkit.fluxcd.io/components/image/imageupdateautomations/#update-strategy) with new image tags, but everything else is the same.
5342

43+
Tracker uses SSH deploy keys to allow those updates, and uses kustomize to [generate secrets](https://github.com/kubernetes-sigs/kustomize/blob/master/examples/secretGeneratorPlugin.md#secret-values-from-local-files). To create the keys, use the following commands.
44+
5445
```bash
5546
ssh-keygen -q -N "" -C "flux-read-write" -f ./deploy/creds/readwrite/identity
5647
ssh-keyscan github.com > ./deploy/creds/readwrite/known_hosts
5748
```
5849

50+
[Add the new deploy key](https://github.com/canada-ca/tracker/settings/keys/new) to the Tracker repo, and select "Allow write access".
51+
After that it's basically the same:
52+
5953
```bash
6054
kustomize build platform/creds/prod | kubectl apply -f -
6155
kustomize build app/creds/prod | kubectl apply -f -

deploy/aks/kustomization.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,3 @@ resources:
55
patchesStrategicMerge:
66
- app-kustomization.yaml
77
- platform-kustomization.yaml
8-
components:
9-
- ../creds/readonly

deploy/bases/tracker-repo.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,5 @@ spec:
88
interval: 1m0s
99
ref:
1010
branch: master
11-
secretRef:
12-
name: flux-credentials
13-
url: ssh://git@github.com/canada-ca/tracker
11+
url: https://github.com/canada-ca/tracker
1412

deploy/creds/readonly/kustomization.yaml

Lines changed: 0 additions & 13 deletions
This file was deleted.

deploy/gke/kustomization.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ resources:
55
- api-image-policy.yaml
66
- frontend-image-policy.yaml
77
- update-automation.yaml
8-
components:
9-
- ../creds/readwrite
8+
patches:
9+
- path: tracker-repo.yaml

deploy/gke/tracker-repo.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
apiVersion: source.toolkit.fluxcd.io/v1beta1
3+
kind: GitRepository
4+
metadata:
5+
name: tracker
6+
namespace: flux-system
7+
spec:
8+
interval: 1m0s
9+
ref:
10+
branch: master
11+
secretRef:
12+
name: flux-credentials
13+
url: ssh://git@github.com/canada-ca/tracker
14+

deploy/minikube/kustomization.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,3 @@ resources:
55
patchesStrategicMerge:
66
- app-kustomization.yaml
77
- platform-kustomization.yaml
8-
components:
9-
- ../creds/readonly

deploy/test/kustomization.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,3 @@ resources:
55
patchesStrategicMerge:
66
- app-kustomization.yaml
77
- platform-kustomization.yaml
8-
components:
9-
- ../creds/readonly

0 commit comments

Comments
 (0)