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: scenarios/azure-databases-docs/articles/mysql/flexible-server/tutorial-deploy-wordpress-on-aks.md
+49-82Lines changed: 49 additions & 82 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -121,14 +121,10 @@ Results:
121
121
122
122
Azure Database for MySQL flexible server is a managed service that you can use to run, manage, and scale highly available MySQL servers in the cloud. Create an Azure Database for MySQL flexible server instance with the [az mysql flexible-server create](/cli/azure/mysql/flexible-server) command. A server can contain multiple databases. The following command creates a server using service defaults and variable values from your Azure CLI's local context:
@@ -266,22 +262,22 @@ To manage a Kubernetes cluster, use [kubectl](https://kubernetes.io/docs/referen
266
262
if! [ -x"$(command -v kubectl)" ];then az aks install-cli;fi
267
263
```
268
264
269
-
Next, configure `kubectl` to connect to your Kubernetes cluster using the [az aks get-credentials](/cli/azure/aks#az-aks-get-credentials) command. This command downloads credentials and configures the Kubernetes CLI to use them. The command uses `~/.kube/config`, the default location for the [Kubernetes configuration file](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/). You can specify a different location for your Kubernetes configuration file using the **--file** argument.
265
+
## Load credentials
270
266
271
-
> [!WARNING]
272
-
> This command will overwrite any existing credentials with the same entry.
267
+
Next, configure `kubectl` to connect to your Kubernetes cluster using the [az aks get-credentials](/cli/azure/aks#az-aks-get-credentials) command. This command downloads credentials and configures the Kubernetes CLI to use them. The command uses `~/.kube/config`, the default location for the [Kubernetes configuration file](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/). You can specify a different location for your Kubernetes configuration file using the **--file** argument.
273
268
274
269
```bash
275
270
az aks get-credentials --resource-group $MY_RESOURCE_GROUP_NAME --name $MY_AKS_CLUSTER_NAME --overwrite-existing
276
271
```
277
272
273
+
## Verify Connection
278
274
To verify the connection to your cluster, use the [kubectl get](https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#get) command to return a list of the cluster nodes.
279
275
280
276
```bash
281
277
kubectl get nodes
282
278
```
283
279
284
-
## Install NGINX ingress controller
280
+
## Setup FQDN
285
281
286
282
You can configure your ingress controller with a static public IP address. The static public IP address remains if you delete your ingress controller. The IP address doesn't remain if you delete your AKS cluster.
287
283
When you upgrade your ingress controller, you must pass a parameter to the Helm release to ensure the ingress controller service is made aware of the load balancer that will be allocated to it. For the HTTPS certificates to work correctly, use a DNS label to configure a fully qualified domain name (FQDN) for the ingress controller IP address. Your FQDN should follow this form: $MY_DNS_LABEL.AZURE_REGION_NAME.cloudapp.azure.com.
Next, you add the ingress-nginx Helm repository, update the local Helm Chart repository cache, and install ingress-nginx addon via Helm. You can set the DNS label with the **--set controller.service.annotations."service\.beta\.kubernetes\.io/azure-dns-label-name"="<DNS_LABEL>"** parameter either when you first deploy the ingress controller or later. In this example, you specify your own public IP address that you created in the previous step with the **--set controller.service.loadBalancerIP="<STATIC_IP>" parameter**.
295
293
296
294
```bash
@@ -312,60 +310,37 @@ At this point in the tutorial, you have an AKS web app with NGINX as the ingress
312
310
### Set Up Cert Manager
313
311
314
312
To add HTTPS, we're going to use Cert Manager. Cert Manager is an open source tool for obtaining and managing SSL certificates for Kubernetes deployments. Cert Manager obtains certificates from popular public issuers and private issuers, ensures the certificates are valid and up-to-date, and attempts to renew certificates at a configured time before they expire.
315
-
316
313
1. In order to install cert-manager, we must first create a namespace to run it in. This tutorial installs cert-manager into the cert-manager namespace. You can run cert-manager in a different namespace, but you must make modifications to the deployment manifests.
317
-
318
-
```bash
319
-
kubectl create namespace cert-manager
320
-
```
321
-
322
314
2. We can now install cert-manager. All resources are included in a single YAML manifest file. Install the manifest file with the following command:
3. Add the `certmanager.k8s.io/disable-validation: "true"` label to the cert-manager namespace by running the following. This allows the system resources that cert-manager requires to bootstrap TLS to be created in its own namespace.
Helm is a Kubernetes deployment tool for automating the creation, packaging, configuration, and deployment of applications and services to Kubernetes clusters.
337
-
338
326
Cert-manager provides Helm charts as a first-class method of installation on Kubernetes.
339
-
340
327
1. Add the Jetstack Helm repository. This repository is the only supported source of cert-manager charts. There are other mirrors and copies across the internet, but those are unofficial and could present a security risk.
4. Apply the certificate issuer YAML file. ClusterIssuers are Kubernetes resources that represent certificate authorities (CAs) that can generate signed certificates by honoring certificate signing requests. All cert-manager certificates require a referenced issuer that is in a ready condition to attempt to honor the request. You can find the issuer we're in the `cluster-issuer-prod.yml file`.
363
331
364
-
```bash
365
-
export SSL_EMAIL_ADDRESS="$(az account show --query user.name --output tsv)"
For this tutorial, we're using an existing Helm chart for WordPress built by Bitnami. The Bitnami Helm chart uses a local MariaDB as the database, so we need to override these values to use the app with Azure Database for MySQL. You can override the values and the custom settings the `helm-wp-aks-values.yaml` file.
@@ -455,10 +423,7 @@ To access your WordPress site from outside the cluster follow the steps below:
455
423
456
424
## Browse your AKS deployment secured via HTTPS
457
425
458
-
Run the following command to get the HTTPS endpoint for your application:
459
-
460
-
> [!NOTE]
461
-
> It often takes 2-3 minutes for the SSL certificate to propagate and about 5 minutes to have all WordPress POD replicas ready and the site to be fully reachable via https.
426
+
Wait for the cluster to setup. It often takes 2-3 minutes for the SSL certificate to propagate and about 5 minutes to have all WordPress POD replicas ready and the site to be fully reachable via https.
462
427
463
428
```bash
464
429
runtime="5 minute"
@@ -474,6 +439,7 @@ while [[ $(date -u +%s) -le $endtime ]]; do
474
439
done
475
440
```
476
441
442
+
## Verify Site works
477
443
Check that WordPress content is delivered correctly using the following command:
0 commit comments