Skip to content

Commit 7418e72

Browse files
rawlingsjjenkins-x-bot
authored andcommitted
chore: add upgrading infrastructure section
1 parent e0335bf commit 7418e72

File tree

4 files changed

+54
-29
lines changed

4 files changed

+54
-29
lines changed

content/en/docs/v3/guides/infra/cloud-config.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ This section contains links to the various readmes that will help you configure
1313

1414
Jenkins X cluster git repositories use cloud specific Terraform modules you can use to configure your cloud resources.
1515

16-
[GCP](https://github.com/jenkins-x/terraform-google-jx#inputs)
16+
* <a href="https://github.com/jenkins-x/terraform-google-jx#inputs" class="btn bg-primary text-light">GCP</a>
1717

18-
[AWS](https://github.com/jenkins-x/terraform-aws-eks-jx#inputs)
18+
* <a href="https://github.com/jenkins-x/terraform-aws-eks-jx#inputs" class="btn bg-primary text-light">AWS</a>
1919

20-
[Azure](https://github.com/jenkins-x/terraform-azurerm-jx#inputs)
20+
* <a href="https://github.com/jenkins-x/terraform-azurerm-jx#inputs" class="btn bg-primary text-light">Azure</a>

content/en/docs/v3/guides/infra/google_cloud_dns.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ Go to [Google Domains](https://domains.google.com/registrar) and purchase a doma
1414

1515
Create a DNS zone which will contain the managed DNS records.
1616

17-
```
17+
```bash
1818
gcloud dns managed-zones create "foo-io" \
1919
--dns-name "foo.io." \
2020
--description "Automatically managed zone by kubernetes.io/external-dns" \
2121
--project foo
2222
```
2323

2424
Make a note of the nameservers that were assigned to your new zone.
25-
```
25+
```bash
2626
gcloud dns record-sets list \
2727
--zone "foo-io" \
2828
--name "foo.io." \

content/en/docs/v3/guides/infra/tls_dns.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@ weight: 35
77

88
This section will describe how to enable automated TLS and DNS for your Jenkins X installation.
99

10-
To achive this we will use a couple of open source projects to help enable automated DNS for applications you
10+
To achive this we will use a couple of open source projects to help enable automated DNS for your applications.
1111

1212
For this guide we are going to assume you own a domain called `foo.io` which is managed by Google Cloud DNS, if it is not see [configure cloud dns to manage a domain](/docs/v3/guides/infra/google_cloud_dns).
1313

14-
Jenkins X services will have URLs like `https://hook-jx.bar.foo.io`. The jx-requirement.yaml `namespaceSubDomain:` of `-jx` refers to the Kubernetes namespace the service is running in, this helps avoid clashes of the same application running in different namespaces in the same cluster.
14+
Jenkins X services will have URLs like `https://hook-jx.bar.foo.io`. The jx-requirements.yml `namespaceSubDomain:` of `-jx` refers to the Kubernetes namespace the service is running in, this helps avoid clashes of the same application running in different namespaces in the same cluster.
1515

1616
To start with we are focussed on GCP but will expand to other cloud providers.
1717

1818
# Google Cloud Platform
1919

20-
## Prerequisits
20+
## Prerequisites
2121

2222
- cluster created using Jenkins X [GCP Terraform getting started](/docs/v3/getting-started/gke/)
2323
- own a domain, we will use [Google Domains](https://domains.google.com/registrar/) in this guide but any provider will work
24-
- latest Jenkins X [upgrade](/docs/v3/guides/upgrade)
24+
- latest Jenkins X CLI, Infrastructure and Cluster git repository updates [upgrade](/docs/v3/guides/upgrade)
2525

2626
### Cloud Infrastructure
2727
First we will configure the cloud infrastructure requirements:
@@ -31,27 +31,27 @@ First we will configure the cloud infrastructure requirements:
3131

3232
To satisfy these requirements go to your infrastructure repository (contains Terraform main.tf) and add to your `values.auto.tfvars` the following:
3333

34-
```values.tf
34+
```yaml
3535
parent_domain = "foo.io"
3636
```
3737

38-
Most people prefer to use a subdomain for a specific installation rather than purchasing one domain per cluster. For example in a multi cluster setup you will probably want the same parent domain but each cluster using a differnt subdomain like development.foo.io, staging.foo.io and foo.io.
38+
Most people prefer to use a subdomain for a specific installation rather than purchasing one domain per cluster. For example in a multi cluster setup you will probably want all using the same parent domain but two clusters using a different subdomain like development.foo.io, staging.foo.io leaving production using just the parent domain foo.io.
3939

4040
To use a subdomain for this cluster add the following configuration:
4141

42-
```values.tf
42+
```yaml
4343
subdomain = "bar"
4444
```
4545

4646
Now apply these changes:
4747

48-
```
48+
```bash
4949
git add values.auto.tfvars
5050
git commit -m 'feat: enable DNS cloud resources'
5151
git push
5252
```
5353

54-
```
54+
```bash
5555
terraform plan
5656
terraform apply
5757
```
@@ -64,48 +64,48 @@ You can now see your managed zone in GCP [here](https://console.cloud.google.com
6464
Next we will configure the cluster requirements:
6565

6666
- Install [external-dns](https://github.com/kubernetes-sigs/external-dns#externaldns) - Kubernetes controller which watches for new Kubernetes Ingress resources and creates A records in Google Cloud DNS which will propogate globally across the internet
67-
- Install [cert-manager](https://cert-manager.io/docs/) - Kuberbetes controller which watches for requests to ask [Let's Encrypt](https://letsencrypt.org/) to issue a new wildcard TLS certificate for your domain and will manage this including renewals
67+
- Install [cert-manager](https://cert-manager.io/docs/) - Kubernetes controller which watches for requests to ask [Let's Encrypt](https://letsencrypt.org/) to issue a new wildcard TLS certificate for your domain and will manage this including renewals
6868

6969
To satisfy these requirements go to your cluster repository (contains helmfile.yaml)
7070

7171
Add external-dns to your clusters helmfile.yaml `releases` section:
7272

73-
```
73+
```bash
7474
- chart: bitnami/external-dns
7575
```
7676

7777
Add cert-manager to your clusters helmfile.yaml `releases` section:
78-
```
78+
```bash
7979
- chart: jetstack/cert-manager
8080
```
8181

8282
Next we install
8383
- a cluster wide [Issuer](https://cert-manager.io/docs/concepts/issuer/) which tells cert-manager how to validate you own your domain
8484
- a namespaced [Certificate](https://cert-manager.io/docs/concepts/certificate/) to request a TLS certificate for services running in the `jx` namespace
8585

86-
```
86+
```bash
8787
- chart: jx3/acme
88-
name: tls-jx
89-
values:
90-
- issuer:
91-
enabled: true
92-
cluster: true
88+
name: acme-jx
9389
```
9490

9591
Cert-manager will use the cluster issuer to request a TLS certificate for each namespaces [Certificate](https://cert-manager.io/docs/concepts/certificate/) found. The advantage here is that the same wildcard certificate is cached and reused for multiple namespaces reducing the risk of being [rate limited](https://letsencrypt.org/docs/rate-limits/) by Lets Encrypt.
9692

9793
Now install the `acme` chart into any namespace you require TLS, e.g.
98-
```
94+
```bash
9995
- chart: jx3/acme
10096
name: tls-jx-staging
10197
namespace: jx-staging
98+
10299
- chart: jx3/acme
103100
name: tls-jx-production
104101
namespace: jx-production
105102
```
106103

107-
The domain from setting up your infrastructure in step one should appear in the `jx-requirements.yaml` of you cluster git repo. Next configure your TLS options, update your `jx-requirements.yaml` with
108-
```
104+
The domain from setting up your infrastructure in step one should appear in the `jx-requirements.yml` of you cluster git repo. Next configure your TLS options, update your `jx-requirements.yml` with below.
105+
106+
__NOTE__ this is the top level `ingress:` section and __NOT__ in the `environments:` section:
107+
108+
```bash
109109
ingress:
110110
domain: bar.foo.io
111111
externalDNS: false # this is unused and will be deprecated
@@ -120,18 +120,18 @@ When first installing set `tls.production=false` so you use the Lets Encrtpt sta
120120

121121
Jenkins X uses a version stream to rollout tested versions of images, charts and default configuration. The `jx-boot` job will apply these versions to your helmfile but you can also run the step yourself to see the defaults.
122122

123-
```
123+
```bash
124124
jx gitops helmfile resolve
125125
```
126126

127-
```
127+
```bash
128128
git add values.auto.tfvars
129129
git commit -m 'feat: enable DNS cloud resources'
130130
git push
131131
```
132132

133133
Now tail the admin logs and wait for the job to complete
134-
```
134+
```bash
135135
jx admin logs
136136
```
137137

content/en/docs/v3/guides/upgrade.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,31 @@ To upgrade jx subcommand plugins run:
1717
jx upgrade plugins
1818
```
1919

20+
## Infrastructure
21+
22+
If you have used one of the Jenkins X Terraform Git repositories to create and manage your cloud resources then you have two options.
23+
24+
### Terraform manual apply
25+
26+
If you are running the Terraform apply commands yourself then from your infrastructure Git repository run:
27+
```
28+
export TF_VAR_jx_bot_username=[your bot username]
29+
export TF_VAR_jx_bot_token=[your bot token]
30+
terraform get -update
31+
terraform plan
32+
terraform apply
33+
```
34+
35+
### Terraform Cloud
36+
If you are using [Terraform Cloud](https://www.terraform.io/) then from your infrastructure Git repository run:
37+
38+
```
39+
terraform get -update
40+
git commit -a -m 'chore: upgrade cloud infra'
41+
git push
42+
```
43+
Terraform Cloud should trigger automatically and apply the updates, view the log in Terraform Cloud.
44+
2045

2146
## Cluster
2247

0 commit comments

Comments
 (0)