Skip to content

Commit 577c918

Browse files
Merge pull request #124 from pluralsh/marcin/prod-4388-refactor-plural-up-to-no-longer-use-git-crypt
feat: Refactor plural up to no longer use git crypt
2 parents 6d56fa4 + 394244c commit 577c918

11 files changed

Lines changed: 262 additions & 97 deletions

File tree

.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@ override.tf.json
3333
.terraformrc
3434
terraform.rc
3535

36-
test/helm-values
37-
3836
# IDE
3937
.idea/
4038

41-
**/values.secret.yaml
39+
**/values.secret.yaml
40+
41+
# Temporary files used during bootstrap
42+
temp/

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,9 @@ Our defaults are meant to be tweaked, feel free to reference the documentation o
2222
A plural installation repo will have a folder structure like this:
2323

2424
```
25-
helm-values/ # git-crypted helm values to be used to bootstrap your setup. Avoid editing unless necessary
25+
helm/ # helm values files
2626
- ${app}.yaml # value overrides
2727
- ${app}-defaults.yaml # default values we generate on install
28-
29-
helm/ # helm values files that are meant to be user-editable, used for setup of many common components
3028
- *.yaml{.liquid} # `.liquid` extension signifies the helm values file can be templated
3129
3230
bootstrap/ # setup for apps within your cluster fleet, this is the root service-of-services that bootstraps everything recursively
@@ -40,6 +38,8 @@ terraform/
4038
- - clusters
4139
- - - {cloud} # we've crafted some reusable modules for setting up clusters on most major clouds, feel free to use these in stacks or wherever
4240
- ${app}/ - submodule for individual app's terraform
41+
42+
temp/ # a temp folder used during bootstrap that is gitignored
4343
```
4444

4545
You're free to extend this as you'd like, although if you use the plural marketplace that structure will be expected. You can also deploy services w/ manifests in other repos, this is meant to serve as a base to define the core infrastructure and get you started in a sane way.
@@ -113,7 +113,7 @@ spec:
113113
namespace: infra
114114
git:
115115
ref: main
116-
folder: helm-values # or wherever else you want to store the helm values
116+
folder: helm # or wherever else you want to store the helm values
117117
helm:
118118
version: 6.31.4
119119
chart: externaldns
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
ownerEmail: {{ "{{ configuration.ownerEmail }}" }}
2+
3+
{{ if not .Cloud }}
4+
external-dns:
5+
extraArgs:
6+
plural-cluster: {{ .Cluster }}
7+
plural-provider: {{ .Provider }}
8+
domainFilters:
9+
- {{ .Subdomain }}
10+
11+
dnsSolver:
12+
webhook:
13+
groupName: acme.plural.sh
14+
solverName: plural-solver
15+
config:
16+
cluster: {{ .Cluster }}
17+
provider: {{ .Provider }}
18+
19+
pluralToken: {{ "{{ configuration.pluralToken }}" }}
20+
21+
acmeEAB:
22+
kid: {{ "{{ configuration.acmeEABKid }}" }}
23+
secret: {{ "{{ configuration.acmeEABSecret }}" }}
24+
{{ end }}
25+
26+
{{ if .Cloud }}
27+
external-dns:
28+
enabled: false
29+
30+
plural-certmanager-webhook:
31+
enabled: false
32+
33+
operator:
34+
enabled: false
35+
36+
application:
37+
enabled: false
38+
39+
plural:
40+
enabled: false
41+
42+
ingress-nginx:
43+
enabled: false
44+
ingress-nginx-private:
45+
enabled: false
46+
{{ end }}
47+
48+
{{ if and (eq .Provider "aws") (not .Cloud) }}
49+
ingress-nginx:
50+
controller:
51+
service:
52+
annotations:
53+
service.beta.kubernetes.io/aws-load-balancer-scheme: internet-facing
54+
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: tcp
55+
service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: 'true'
56+
service.beta.kubernetes.io/aws-load-balancer-type: external
57+
service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: ip
58+
service.beta.kubernetes.io/aws-load-balancer-proxy-protocol: "*"
59+
service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: '3600'
60+
config:
61+
compute-full-forwarded-for: 'true'
62+
use-forwarded-headers: 'true'
63+
use-proxy-protocol: 'true'
64+
ingress-nginx-private:
65+
controller:
66+
service:
67+
annotations:
68+
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: tcp
69+
service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: 'true'
70+
service.beta.kubernetes.io/aws-load-balancer-type: external
71+
service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: ip
72+
service.beta.kubernetes.io/aws-load-balancer-proxy-protocol: "*"
73+
service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: '3600'
74+
config:
75+
compute-full-forwarded-for: 'true'
76+
use-forwarded-headers: 'true'
77+
use-proxy-protocol: 'true'
78+
{{ end }}

charts/runtime/values.yaml.tpl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
ownerEmail: {{ .Config.Email }}
2+
13
{{ if not .Cloud }}
24
external-dns:
35
extraArgs:
@@ -14,7 +16,6 @@ dnsSolver:
1416
cluster: {{ .Cluster }}
1517
provider: {{ .Provider }}
1618

17-
ownerEmail: {{ .Config.Email }}
1819
pluralToken: {{ .Config.Token }}
1920

2021
acmeEAB:
@@ -23,10 +24,6 @@ acmeEAB:
2324
{{ end }}
2425

2526
{{ if .Cloud }}
26-
27-
ownerEmail: {{ .Config.Email }}
28-
29-
3027
external-dns:
3128
enabled: false
3229

helm/runtime.yaml

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

setup/cert-manager.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ metadata:
66
spec:
77
namespace: cert-manager
88
git:
9-
folder: helm-values
9+
folder: helm
1010
ref: [[ or .Context.Branch "main" ]]
1111
repositoryRef:
1212
kind: GitRepository

setup/console.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,21 @@ metadata:
66
spec:
77
namespace: plrl-console
88
git:
9-
folder: helm-values
9+
folder: helm
1010
ref: [[ or .Context.Branch "main" ]]
1111
repositoryRef:
1212
kind: GitRepository
1313
name: infra
1414
namespace: infra
15+
configurationRef:
16+
name: console-config
17+
namespace: infra
1518
helm:
1619
version: "0.x.x"
1720
chart: console
1821
url: https://pluralsh.github.io/console
1922
valuesFiles:
20-
- console.yaml
23+
- console.yaml.liquid
2124
clusterRef:
2225
kind: Cluster
2326
name: mgmt

setup/runtime.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,21 @@ metadata:
66
spec:
77
namespace: plural-runtime
88
git:
9-
folder: helm-values
9+
folder: helm
1010
ref: [[ or .Context.Branch "main" ]]
1111
repositoryRef:
1212
kind: GitRepository
1313
name: infra
1414
namespace: infra
15+
configurationRef:
16+
name: runtime-config
17+
namespace: infra
1518
helm:
1619
version: "0.x.x"
1720
chart: runtime
1821
url: https://pluralsh.github.io/bootstrap
1922
valuesFiles:
20-
- runtime.yaml
23+
- runtime.yaml.liquid
2124
clusterRef:
2225
kind: Cluster
2326
name: mgmt

templates/providers/bootstrap/gcp.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ terraform {
3535

3636
data "google_client_config" "default" {}
3737

38+
provider "kubernetes" {
39+
alias = "bootstrap"
40+
host = module.mgmt.cluster.endpoint
41+
cluster_ca_certificate = base64decode(module.mgmt.cluster.ca_certificate)
42+
token = data.google_client_config.default.access_token
43+
}
44+
3845
provider "helm" {
3946
kubernetes {
4047
host = module.mgmt.cluster.endpoint

0 commit comments

Comments
 (0)