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
To manage a Kubernetes cluster, use the Kubernetes command-line client, kubectl. kubectl is already installed if you use Azure Cloud Shell.
152
+
Install az aks CLI locally using the az aks install-cli command
153
153
154
-
1. Install az aks CLI locally using the az aks install-cli command
155
-
156
-
```bash
157
-
if! [ -x"$(command -v kubectl)" ];then az aks install-cli;fi
158
-
```
154
+
```bash
155
+
if! [ -x"$(command -v kubectl)" ];then az aks install-cli;fi
156
+
```
159
157
160
-
2. Configure kubectl to connect to your Kubernetes cluster using the az aks get-credentials command. The following command:
158
+
##Configure kubectl to connect to your Kubernetes cluster using the az aks get-credentials command. The following command:
161
159
162
-
- Downloads credentials and configures the Kubernetes CLI to use them.
163
-
- Uses ~/.kube/config, the default location for the Kubernetes configuration file. Specify a different location for your Kubernetes configuration file using --file argument.
160
+
- Downloads credentials and configures the Kubernetes CLI to use them.
161
+
- Uses ~/.kube/config, the default location for the Kubernetes configuration file. Specify a different location for your Kubernetes configuration file using --file argument.
164
162
165
-
> [!WARNING]
166
-
> This will overwrite any existing credentials with the same entry
163
+
> [!WARNING]
164
+
> This will overwrite any existing credentials with the same entry
167
165
168
-
```bash
169
-
az aks get-credentials --resource-group $MY_RESOURCE_GROUP_NAME --name $MY_AKS_CLUSTER_NAME --overwrite-existing
170
-
```
166
+
```bash
167
+
az aks get-credentials --resource-group $MY_RESOURCE_GROUP_NAME --name $MY_AKS_CLUSTER_NAME --overwrite-existing
168
+
```
171
169
172
-
3. Verify the connection to your cluster using the kubectl get command. This command returns a list of the cluster nodes.
170
+
##Verify the connection to your cluster using the kubectl get command. This command returns a list of the cluster nodes.
173
171
174
-
```bash
175
-
kubectl get nodes
176
-
```
172
+
```bash
173
+
kubectl get nodes
174
+
```
177
175
178
176
## Install NGINX Ingress Controller
179
177
@@ -437,11 +435,7 @@ spec:
437
435
app: store-front
438
436
type: LoadBalancer
439
437
EOF
440
-
```
441
-
442
-
To deploy this app, run the following command
443
438
444
-
```bash
445
439
kubectl apply -f azure-vote-start.yml
446
440
```
447
441
@@ -463,48 +457,10 @@ while [[ $(date -u +%s) -le $endtime ]]; do
At this point in the tutorial you have an AKS web app with NGINX as the Ingress controller and a custom domain you can use to access your application. The next step is to add an SSL certificate to the domain so that users can reach your application securely via HTTPS.
@@ -515,96 +471,75 @@ In order to add HTTPS we are going to use Cert Manager. Cert Manager is an open
515
471
516
472
1. In order to install cert-manager, we must first create a namespace to run it in. This tutorial will install cert-manager into the cert-manager namespace. It is possible to run cert-manager in a different namespace, although you will need to make modifications to the deployment manifests.
517
473
518
-
```bash
519
-
kubectl create namespace cert-manager
520
-
```
521
-
522
-
2. We can now install cert-manager. All resources are included in a single YAML manifest file. This can be installed by running the following:
3. Add the certmanager.k8s.io/disable-validation: "true" label to the cert-manager namespace by running the following. This will allow the system resources that cert-manager requires to bootstrap TLS to be created in its own namespace.
477
+
# We can now install cert-manager. All resources are included in a single YAML manifest file. This can be installed by running the following:
#Add the certmanager.k8s.io/disable-validation: "true" label to the cert-manager namespace by running the following. This will allow 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 creation, packaging, configuration, and deployment of applications and services to Kubernetes clusters.
537
488
538
489
Cert-manager provides Helm charts as a first-class method of installation on Kubernetes.
539
490
540
-
1. Add the Jetstack Helm repository
541
-
542
-
This repository is the only supported source of cert-manager charts. There are some other mirrors and copies across the internet, but those are entirely unofficial and could present a security risk.
543
-
544
-
```bash
545
-
helm repo add jetstack https://charts.jetstack.io
546
-
```
491
+
```bash
492
+
# Add the Jetstack Helm repository
493
+
# This repository is the only supported source of cert-manager charts. There are some other mirrors and copies across the internet, but those are entirely unofficial and could present a security risk.
547
494
548
-
2. Update local Helm Chart repository cache
495
+
helm repo add jetstack https://charts.jetstack.io
549
496
550
-
```bash
551
-
helm repo update
552
-
```
497
+
# Update local Helm Chart repository cache
498
+
helm repo update
553
499
554
-
3. Install Cert-Manager addon via helm by running the following:
500
+
# Install Cert-Manager addon via helm by running the following
# ClusterIssuers are Kubernetes resources that represent certificate authorities (CAs) that are able to 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.
504
+
# The issuer we are using can be found in the `cluster-issuer-prod.yml file`
505
+
506
+
cat <<EOF > cluster-issuer-prod.yml
507
+
apiVersion: cert-manager.io/v1
508
+
kind: ClusterIssuer
509
+
metadata:
510
+
name: letsencrypt-prod
511
+
spec:
512
+
acme:
513
+
# You must replace this email address with your own.
514
+
# Let's Encrypt will use this to contact you about expiring
515
+
# certificates, and issues related to your account.
516
+
email: $SSL_EMAIL_ADDRESS
517
+
# ACME server URL for Let’s Encrypt’s prod environment.
518
+
# The staging environment will not issue trusted certificates but is
519
+
# used to ensure that the verification process is working properly
ClusterIssuers are Kubernetes resources that represent certificate authorities (CAs) that are able to 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.
563
-
The issuer we are using can be found in the `cluster-issuer-prod.yml file`
564
-
565
-
```bash
566
-
cat <<EOF > cluster-issuer-prod.yml
567
-
apiVersion: cert-manager.io/v1
568
-
kind: ClusterIssuer
569
-
metadata:
570
-
name: letsencrypt-prod
571
-
spec:
572
-
acme:
573
-
# You must replace this email address with your own.
574
-
# Let's Encrypt will use this to contact you about expiring
575
-
# certificates, and issues related to your account.
576
-
email: $SSL_EMAIL_ADDRESS
577
-
# ACME server URL for Let’s Encrypt’s prod environment.
578
-
# The staging environment will not issue trusted certificates but is
579
-
# used to ensure that the verification process is working properly
0 commit comments