You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/docs/v3/guides/infra/tls_dns.md
+24-24Lines changed: 24 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,21 +7,21 @@ weight: 35
7
7
8
8
This section will describe how to enable automated TLS and DNS for your Jenkins X installation.
9
9
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.
11
11
12
12
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).
13
13
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.
15
15
16
16
To start with we are focussed on GCP but will expand to other cloud providers.
17
17
18
18
# Google Cloud Platform
19
19
20
-
## Prerequisits
20
+
## Prerequisites
21
21
22
22
- cluster created using Jenkins X [GCP Terraform getting started](/docs/v3/getting-started/gke/)
23
23
- 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)
25
25
26
26
### Cloud Infrastructure
27
27
First we will configure the cloud infrastructure requirements:
@@ -31,27 +31,27 @@ First we will configure the cloud infrastructure requirements:
31
31
32
32
To satisfy these requirements go to your infrastructure repository (contains Terraform main.tf) and add to your `values.auto.tfvars` the following:
33
33
34
-
```values.tf
34
+
```yaml
35
35
parent_domain = "foo.io"
36
36
```
37
37
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.
39
39
40
40
To use a subdomain for this cluster add the following configuration:
41
41
42
-
```values.tf
42
+
```yaml
43
43
subdomain = "bar"
44
44
```
45
45
46
46
Now apply these changes:
47
47
48
-
```
48
+
```bash
49
49
git add values.auto.tfvars
50
50
git commit -m 'feat: enable DNS cloud resources'
51
51
git push
52
52
```
53
53
54
-
```
54
+
```bash
55
55
terraform plan
56
56
terraform apply
57
57
```
@@ -64,48 +64,48 @@ You can now see your managed zone in GCP [here](https://console.cloud.google.com
64
64
Next we will configure the cluster requirements:
65
65
66
66
- 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
68
68
69
69
To satisfy these requirements go to your cluster repository (contains helmfile.yaml)
70
70
71
71
Add external-dns to your clusters helmfile.yaml `releases` section:
72
72
73
-
```
73
+
```bash
74
74
- chart: bitnami/external-dns
75
75
```
76
76
77
77
Add cert-manager to your clusters helmfile.yaml `releases` section:
78
-
```
78
+
```bash
79
79
- chart: jetstack/cert-manager
80
80
```
81
81
82
82
Next we install
83
83
- a cluster wide [Issuer](https://cert-manager.io/docs/concepts/issuer/) which tells cert-manager how to validate you own your domain
84
84
- a namespaced [Certificate](https://cert-manager.io/docs/concepts/certificate/) to request a TLS certificate for services running in the `jx` namespace
85
85
86
-
```
86
+
```bash
87
87
- chart: jx3/acme
88
-
name: tls-jx
89
-
values:
90
-
- issuer:
91
-
enabled: true
92
-
cluster: true
88
+
name: acme-jx
93
89
```
94
90
95
91
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.
96
92
97
93
Now install the `acme` chart into any namespace you require TLS, e.g.
98
-
```
94
+
```bash
99
95
- chart: jx3/acme
100
96
name: tls-jx-staging
101
97
namespace: jx-staging
98
+
102
99
- chart: jx3/acme
103
100
name: tls-jx-production
104
101
namespace: jx-production
105
102
```
106
103
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
109
109
ingress:
110
110
domain: bar.foo.io
111
111
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
120
120
121
121
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.
122
122
123
-
```
123
+
```bash
124
124
jx gitops helmfile resolve
125
125
```
126
126
127
-
```
127
+
```bash
128
128
git add values.auto.tfvars
129
129
git commit -m 'feat: enable DNS cloud resources'
130
130
git push
131
131
```
132
132
133
133
Now tail the admin logs and wait for the job to complete
0 commit comments