Skip to content

Commit 9425526

Browse files
idm_25.2.1_release (#245)
1 parent c1ee9e9 commit 9425526

File tree

53 files changed

+752
-547
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+752
-547
lines changed

docs-source/content/idm-products/oam/configure-ingress/_index.md

Lines changed: 132 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -70,30 +70,91 @@ Use helm to install NGINX.
7070
Update Complete. ⎈ Happy Helming!⎈
7171
```
7272

73+
### Create a Kubernetes namespace for NGINX
74+
75+
Create a Kubernetes namespace for the NGINX deployment by running the following command:
76+
77+
```
78+
kubectl create namespace <namespace>
79+
```
80+
81+
For example:
82+
83+
```
84+
kubectl create namespace mynginxns
85+
```
86+
87+
The output will look similar to the following:
88+
89+
```
90+
namespace/mynginxns created
91+
```
92+
7393

7494
### Generate a SSL Certificate
7595

7696
This section should only be followed if you want to configure your ingress for SSL.
7797

78-
1. Generate a private key and certificate signing request (CSR) using a tool of your choice. Send the CSR to your certificate authority (CA) to generate the certificate.
98+
For production environments it is recommended to use a commercially available certificate, traceable to a trusted Certificate Authority.
99+
100+
For sandbox environments, you can generate your own self-signed certificates.
101+
102+
**Note**: Using self-signed certificates you will get certificate errors when accessing the ingress controller via a browser.
103+
104+
#### Using a Third Party CA for Generating Certificates
105+
106+
If you are configuring the ingress controller to use SSL, you must use a wildcard certificate to prevent issues with the Common Name (CN) in the certificate. A wildcard certificate is a certificate that protects the primary domain and it's sub-domains. It uses a wildcard character (*) in the CN, for example `*.yourdomain.com`.
107+
108+
How you generate the key and certificate signing request for a wildcard certificate will depend on your Certificate Authority. Contact your Certificate Authority vendor for details.
109+
110+
In order to configure the ingress controller for SSL you require the following files:
111+
112+
+ The private key for your certificate, for example `oam.key`.
113+
+ The certificate, for example oam.crt in PEM format.
114+
+ The trusted certificate authority (CA) certificate, for example `rootca.crt` in PEM format.
115+
+ If there are multiple trusted CA certificates in the chain, you need all the certificates in the chain, for example `rootca1.crt`, `rootca2.crt` etc.
116+
117+
Once you have received the files, perform the following steps:
118+
119+
1. On the administrative host, create a `$WORKDIR>/ssl` directory and navigate to the folder:
120+
121+
```
122+
mkdir $WORKDIR>/ssl
123+
cd $WORKDIR>/ssl
124+
```
125+
126+
1. Copy the files listed above to the `$WORKDIR>/ssl` directory.
79127

80-
If you want to use a certificate for testing purposes you can generate a self signed certificate using openssl:
128+
1. If your CA has multiple certificates in a chain, create a `bundle.pem` that contains all the CA certificates:
129+
130+
```
131+
cat rootca.pem rootca1.pem rootca2.pem >>bundle.pem
132+
```
133+
134+
#### Using Self-Signed Certificates
135+
136+
1. On the administrative host, create a `$WORKDIR>/ssl` directory and navigate to the folder:
137+
138+
```
139+
mkdir $WORKDIR>/ssl
140+
cd $WORKDIR>/ssl
141+
```
142+
143+
1. Run the following command to create the self-signed certificate:
81144

82145
```bash
83146
$ mkdir <workdir>/ssl
84147
$ cd <workdir>/ssl
85-
$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout tls.key -out tls.crt -subj "/CN=<nginx-hostname>"
148+
$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout oam.key -out oam.crt -subj "/CN=<hostname>"
86149
```
87150

88151
For example:
89152

90153
```bash
91154
$ mkdir /scratch/OAMK8S/ssl
92155
$ cd /scratch/OAMK8S/ssl
93-
$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout tls.key -out tls.crt -subj "/CN=masternode.example.com"
156+
$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout oam.key -out oam.crt -subj "/CN=oam.example.com"
94157
```
95-
96-
**Note**: The `CN` should match the host.domain of the master node in order to prevent hostname problems during certificate verification.
97158

98159
The output will look similar to the following:
99160

@@ -104,17 +165,22 @@ This section should only be followed if you want to configure your ingress for S
104165
writing new private key to 'tls.key'
105166
-----
106167
```
107-
108-
2. Create a secret for SSL by running the following command:
168+
169+
### Create a Kubernetes Secret for SSL
170+
171+
172+
Run the following command to create a Kubernetes secret for SSL:
109173

110174
```bash
111-
$ kubectl -n oamns create secret tls <domain_uid>-tls-cert --key <workdir>/tls.key --cert <workdir>/tls.crt
175+
$ kubectl -n mynginxns create secret tls <domain_uid>-tls-cert --key $WORKDIR>/ssl/oam.key --cert $WORKDIR>/ssl/oam.crt
112176
```
113177

178+
**Note**: If you have multiple CA certificates in the chain use `--cert <workdir>/bundle.crt`.
179+
114180
For example:
115181

116182
```bash
117-
$ kubectl -n oamns create secret tls accessdomain-tls-cert --key /scratch/OAMK8S/ssl/tls.key --cert /scratch/OAMK8S/ssl/tls.crt
183+
$ kubectl -n mynginxns create secret tls accessdomain-tls-cert --key /scratch/OAMK8S/ssl/oam.key --cert /scratch/OAMK8S/ssl/oam.crt
118184
```
119185

120186
The output will look similar to the following:
@@ -124,11 +190,11 @@ This section should only be followed if you want to configure your ingress for S
124190
```
125191

126192

127-
### Create an ingress controller
193+
### Install the ingress controller
128194

129-
In this section you create an ingress controller.
195+
In this section you install the ingress controller.
130196

131-
If you can connect directly to the master node IP address from a browser, then install NGINX with the `--set controller.service.type=NodePort` parameter.
197+
If you can connect directly to a worker node IP address from a browser, then install NGINX with the `--set controller.service.type=NodePort` parameter.
132198

133199
If you are using a Managed Service for your Kubernetes cluster, for example Oracle Kubernetes Engine (OKE) on Oracle Cloud Infrastructure (OCI), and connect from a browser to the Load Balancer IP address, then use the `--set controller.service.type=LoadBalancer` parameter. This instructs the Managed Service to setup a Load Balancer to direct traffic to the NGINX ingress.
134200

@@ -142,12 +208,22 @@ The following sections show how to install the ingress with SSL or without SSL.
142208
1. To configure the ingress controller to use SSL, run the following command:
143209

144210
```bash
145-
$ helm install nginx-ingress -n <domain_namespace> --set controller.service.nodePorts.http=<http_port> --set controller.service.nodePorts.https=<https_port> --set controller.extraArgs.default-ssl-certificate=<domain_namespace>/<ssl_secret> --set controller.service.type=<type> --set controller.config.use-forwarded-headers=true --set controller.config.enable-underscores-in-headers=true --set controller.admissionWebhooks.enabled=false stable/ingress-nginx
211+
$ helm install nginx-ingress \
212+
-n <domain_namespace> \
213+
--set controller.service.nodePorts.http=<http_port> \
214+
--set controller.service.nodePorts.https=<https_port> \
215+
--set controller.extraArgs.default-ssl-certificate=<domain_namespace>/<ssl_secret> \
216+
--set controller.service.type=<type> \
217+
--set controller.config.use-forwarded-headers=true \
218+
--set controller.config.enable-underscores-in-headers=true \
219+
--set controller.admissionWebhooks.enabled=false \
220+
stable/ingress-nginx \
221+
--version 4.7.2
146222
```
147223

148224
where:
149225

150-
+ `<domain_namespace>` is your namespace, for example `oamns`.
226+
+ `<domain_namespace>` is your namespace, for example `mynginxns`.
151227
+ `<http_port>` is the HTTP port that you want the controller to listen on, for example `30777`.
152228
+ `<https_port>` is the HTTPS port that you want the controller to listen on, for example `30443`.
153229
+ `<type>` is the controller type. If using NodePort set to `NodePort`. If using a managed service set to `LoadBalancer`. If using `LoadBalancer` remove `--set controller.service.nodePorts.http=<http_port>` and `--set controller.service.nodePorts.https=<https_port>`.
@@ -157,7 +233,16 @@ The following sections show how to install the ingress with SSL or without SSL.
157233
For example:
158234

159235
```bash
160-
$ helm install nginx-ingress -n oamns --set controller.service.nodePorts.http=30777 --set controller.service.nodePorts.https=30443 --set controller.extraArgs.default-ssl-certificate=oamns/accessdomain-tls-cert --set controller.service.type=NodePort --set controller.config.use-forwarded-headers=true --set controller.config.enable-underscores-in-headers=true --set controller.admissionWebhooks.enabled=false stable/ingress-nginx --version 4.7.2
236+
$ helm install nginx-ingress -n mynginxns \
237+
--set controller.service.nodePorts.http=30777 \
238+
--set controller.service.nodePorts.https=30443 \
239+
--set controller.extraArgs.default-ssl-certificate=mynginxns/accessdomain-tls-cert \
240+
--set controller.service.type=NodePort \
241+
--set controller.config.use-forwarded-headers=true \
242+
--set controller.config.enable-underscores-in-headers=true \
243+
--set controller.admissionWebhooks.enabled=false \
244+
stable/ingress-nginx \
245+
--version 4.7.2
161246
```
162247

163248

@@ -167,7 +252,7 @@ The following sections show how to install the ingress with SSL or without SSL.
167252
NAME: nginx-ingress
168253
LAST DEPLOYED: <DATE>
169254
170-
NAMESPACE: oamns
255+
NAMESPACE: mynginxns
171256
STATUS: deployed
172257
REVISION: 1
173258
TEST SUITE: None
@@ -176,7 +261,7 @@ The following sections show how to install the ingress with SSL or without SSL.
176261
Get the application URL by running these commands:
177262
export HTTP_NODE_PORT=30777
178263
export HTTPS_NODE_PORT=30443
179-
export NODE_IP=$(kubectl --namespace oamns get nodes -o jsonpath="{.items[0].status.addresses[1].address}")
264+
export NODE_IP=$(kubectl --namespace mynginxns get nodes -o jsonpath="{.items[0].status.addresses[1].address}")
180265
181266
echo "Visit http://$NODE_IP:$HTTP_NODE_PORT to access your application via HTTP."
182267
echo "Visit https://$NODE_IP:$HTTPS_NODE_PORT to access your application via HTTPS."
@@ -228,19 +313,35 @@ The following sections show how to install the ingress with SSL or without SSL.
228313
1. To configure the ingress controller without SSL, run the following command:
229314

230315
```bash
231-
$ helm install nginx-ingress -n <domain_namespace> --set controller.service.nodePorts.http=<http_port> --set controller.service.type=NodePort --set controller.config.use-forwarded-headers=true --set controller.config.enable-underscores-in-headers=true --set controller.admissionWebhooks.enabled=false stable/ingress-nginx
316+
$ helm install nginx-ingress \
317+
-n <domain_namespace> \
318+
--set controller.service.nodePorts.http=<http_port> \
319+
--set controller.service.type=NodePort \
320+
--set controller.config.use-forwarded-headers=true \
321+
--set controller.config.enable-underscores-in-headers=true \
322+
--set controller.admissionWebhooks.enabled=false \
323+
stable/ingress-nginx
324+
--version 4.7.2
232325
```
233326

234327
where:
235328

236-
+ `<domain_namespace>` is your namespace, for example `oamns`.
329+
+ `<domain_namespace>` is your namespace, for example `mynginxns`.
237330
+ `<http_port>` is the HTTP port that you want the controller to listen on, for example `30777`.
238331
+ `<type>` is the controller type. If using NodePort set to `NodePort`. If using a managed service set to `LoadBalancer`. If using `LoadBalancer` remove `--set controller.service.nodePorts.http=<http_port>`.
239332

240333
For example:
241334

242335
```bash
243-
$ helm install nginx-ingress -n oamns --set controller.service.nodePorts.http=30777 --set controller.service.type=NodePort --set controller.config.use-forwarded-headers=true --set controller.config.enable-underscores-in-headers=true --set controller.admissionWebhooks.enabled=false stable/ingress-nginx --version 4.7.2
336+
$ helm install nginx-ingress \
337+
-n mynginxns \
338+
--set controller.service.nodePorts.http=30777 \
339+
--set controller.service.type=NodePort \
340+
--set controller.config.use-forwarded-headers=true \
341+
--set controller.config.enable-underscores-in-headers=true \
342+
--set controller.admissionWebhooks.enabled=false \
343+
stable/ingress-nginx \
344+
--version 4.7.2
244345
```
245346

246347
The output will look similar to the following:
@@ -249,16 +350,16 @@ The following sections show how to install the ingress with SSL or without SSL.
249350
NAME: nginx-ingress
250351
LAST DEPLOYED: <DATE>
251352
252-
NAMESPACE: oamns
353+
NAMESPACE: mynginxns
253354
STATUS: deployed
254355
REVISION: 1
255356
TEST SUITE: None
256357
NOTES:
257358
The nginx-ingress controller has been installed.
258359
Get the application URL by running these commands:
259360
export HTTP_NODE_PORT=30777
260-
export HTTPS_NODE_PORT=$(kubectl --namespace oamns get services -o jsonpath="{.spec.ports[1].nodePort}" nginx-ingress-ingress-nginx-controller)
261-
export NODE_IP=$(kubectl --namespace oamns get nodes -o jsonpath="{.items[0].status.addresses[1].address}")
361+
export HTTPS_NODE_PORT=$(kubectl --namespace mynginxns get services -o jsonpath="{.spec.ports[1].nodePort}" nginx-ingress-ingress-nginx-controller)
362+
export NODE_IP=$(kubectl --namespace mynginxns get nodes -o jsonpath="{.items[0].status.addresses[1].address}")
262363
263364
echo "Visit http://$NODE_IP:$HTTP_NODE_PORT to access your application via HTTP."
264365
echo "Visit https://$NODE_IP:$HTTPS_NODE_PORT to access your application via HTTPS."
@@ -483,7 +584,7 @@ The following sections show how to install the ingress with SSL or without SSL.
483584
NAME CLASS HOSTS ADDRESS PORTS AGE
484585
oamadmin-ingress nginx admin.example.com 80 14s
485586
oamruntime-ingress nginx runtime.example.com 80 14s
486-
```
587+
```
487588
488589
1. Run the following command to check the ingress:
489590
@@ -631,7 +732,7 @@ The following sections show how to install the ingress with SSL or without SSL.
631732
$ curl -v http://${HOSTNAME}:${PORT}/oamconsole
632733
```
633734
634-
The `${HOSTNAME}:${PORT}` to use depends on the value set for `hostName.enabled`. If `hostName.enabled: false` use the hostname and port where the ingress controller is installed, for example `http://masternode.example.com:30777`.
735+
The `${HOSTNAME}:${PORT}` to use depends on the value set for `hostName.enabled`. If `hostName.enabled: false` use the hostname and port where the ingress controller is installed, for example `http://oam.example.com:30777`.
635736
636737
If using `hostName.enabled: true` then you can only access via the admin hostname, for example `https://admin.example.com/oamconsole`. **Note**: You can only access via the admin URL if it is currently accessible and routing correctly to the ingress host and port.
637738
@@ -640,14 +741,14 @@ The following sections show how to install the ingress with SSL or without SSL.
640741
641742
642743
```bash
643-
$ curl -v http://masternode.example.com:30777/oamconsole
744+
$ curl -v http://oam.example.com:30777/oamconsole
644745
```
645746

646747
The output will look similar to the following. You should receive a `302 Moved Temporarily` message:
647748

648749
```
649750
> GET /oamconsole HTTP/1.1
650-
> Host: masternode.example:30777
751+
> Host: oam.example:30777
651752
> User-Agent: curl/7.61.1
652753
> Accept: */*
653754
>
@@ -656,17 +757,17 @@ The following sections show how to install the ingress with SSL or without SSL.
656757
< Content-Type: text/html
657758
< Content-Length: 333
658759
< Connection: keep-alive
659-
< Location: http://masternode.example.com:30777/oamconsole/
760+
< Location: http://oam.example.com:30777/oamconsole/
660761
< X-Content-Type-Options: nosniff
661762
< X-Frame-Options: DENY
662763
<
663764
<html><head><title>302 Moved Temporarily</title></head>
664765
<body bgcolor="#FFFFFF">
665766
<p>This document you requested has moved
666767
temporarily.</p>
667-
<p>It's now at <a href="http://masternode.example.com:30777/oamconsole/">http://masternode.example.com:30777/oamconsole/</a>.</p>
768+
<p>It's now at <a href="http://oam.example.com:30777/oamconsole/">http://oam.example.com:30777/oamconsole/</a>.</p>
668769
</body></html>
669-
* Connection #0 to host doc-master.lcma.susengdev2phx.oraclevcn.com left intact
770+
* Connection #0 to host oam.example.com left intact
670771
```
671772

672773
#### Verify that you can access the domain URLs

0 commit comments

Comments
 (0)