Skip to content

Commit 23067df

Browse files
docs: add documentation for installing Coder on Azure with Kubernetes (#16216)
closes #16074 [preview](https://coder.com/docs/@16074-azure-app-gateway/install/kubernetes/kubernetes-azure-app-gateway) --------- Co-authored-by: M Atif Ali <atif@coder.com> Co-authored-by: EdwardAngert <17991901+EdwardAngert@users.noreply.github.com>
1 parent cba99a1 commit 23067df

File tree

3 files changed

+187
-4
lines changed

3 files changed

+187
-4
lines changed

docs/install/kubernetes.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,13 +284,17 @@ coder:
284284

285285
### Azure
286286

287-
In certain enterprise environments, the
288-
[Azure Application Gateway](https://learn.microsoft.com/en-us/azure/application-gateway/ingress-controller-overview)
289-
was needed. The Application Gateway supports:
287+
Certain enterprise environments require the
288+
[Azure Application Gateway](https://learn.microsoft.com/en-us/azure/application-gateway/ingress-controller-overview).
289+
The Application Gateway supports:
290290

291291
- Websocket traffic (required for workspace connections)
292292
- TLS termination
293293

294+
Follow our doc on
295+
[how to deploy Coder on Azure with an Application Gateway](./kubernetes/kubernetes-azure-app-gateway.md)
296+
for an example.
297+
294298
## Troubleshooting
295299

296300
You can view Coder's logs by getting the pod name from `kubectl get pods` and
Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
# Deploy Coder on Azure with an Application Gateway
2+
3+
In certain enterprise environments, the [Azure Application Gateway](https://learn.microsoft.com/en-us/azure/application-gateway/ingress-controller-overview) is required.
4+
5+
These steps serve as a proof-of-concept example so that you can get Coder running with Kubernetes on Azure. Your deployment might require a separate Postgres server or signed certificates.
6+
7+
The Application Gateway supports:
8+
9+
- Websocket traffic (required for workspace connections)
10+
- TLS termination
11+
12+
Refer to Microsoft's documentation on how to [enable application gateway ingress controller add-on for an existing AKS cluster with an existing application gateway](https://learn.microsoft.com/en-us/azure/application-gateway/tutorial-ingress-controller-add-on-existing).
13+
The steps here follow the Microsoft tutorial for a Coder deployment.
14+
15+
## Deploy Coder on Azure with an Application Gateway
16+
17+
1. Create Azure resource group:
18+
19+
```sql
20+
az group create --name myResourceGroup --location eastus
21+
```
22+
23+
1. Create AKS cluster:
24+
25+
```sql
26+
az aks create --name myCluster --resource-group myResourceGroup --network-plugin azure --enable-managed-identity --generate-ssh-keys
27+
```
28+
29+
1. Create public IP:
30+
31+
```sql
32+
az network public-ip create --name myPublicIp --resource-group myResourceGroup --allocation-method Static --sku Standard
33+
```
34+
35+
1. Create VNet and subnet:
36+
37+
```sql
38+
az network vnet create --name myVnet --resource-group myResourceGroup --address-prefix 10.0.0.0/16 --subnet-name mySubnet --subnet-prefix 10.0.0.0/24
39+
```
40+
41+
1. Create Azure application gateway, attach VNet, subnet and public IP:
42+
43+
```sql
44+
az network application-gateway create --name myApplicationGateway --resource-group myResourceGroup --sku Standard_v2 --public-ip-address myPublicIp --vnet-name myVnet --subnet mySubnet --priority 100
45+
```
46+
47+
1. Get app gateway ID:
48+
49+
```sql
50+
appgwId=$(az network application-gateway show --name myApplicationGateway --resource-group myResourceGroup -o tsv --query "id")
51+
```
52+
53+
1. Enable app gateway ingress to AKS cluster:
54+
55+
```sql
56+
az aks enable-addons --name myCluster --resource-group myResourceGroup --addon ingress-appgw --appgw-id $appgwId
57+
```
58+
59+
1. Get AKS node resource group:
60+
61+
```sql
62+
nodeResourceGroup=$(az aks show --name myCluster --resource-group myResourceGroup -o tsv --query "nodeResourceGroup")
63+
```
64+
65+
1. Get AKS VNet name:
66+
67+
```sql
68+
aksVnetName=$(az network vnet list --resource-group $nodeResourceGroup -o tsv --query "[0].name")
69+
```
70+
71+
1. Get AKS VNet ID:
72+
73+
```sql
74+
aksVnetId=$(az network vnet show --name $aksVnetName --resource-group $nodeResourceGroup -o tsv --query "id")
75+
```
76+
77+
1. Peer VNet to AKS VNet:
78+
79+
```sql
80+
az network vnet peering create --name AppGWtoAKSVnetPeering --resource-group myResourceGroup --vnet-name myVnet --remote-vnet $aksVnetId --allow-vnet-access
81+
```
82+
83+
1. Get app gateway VNet ID:
84+
85+
```sql
86+
appGWVnetId=$(az network vnet show --name myVnet --resource-group myResourceGroup -o tsv --query "id")
87+
```
88+
89+
1. Peer AKS VNet to app gateway VNet:
90+
91+
```sql
92+
az network vnet peering create --name AKStoAppGWVnetPeering --resource-group $nodeResourceGroup --vnet-name $aksVnetName --remote-vnet $appGWVnetId --allow-vnet-access
93+
```
94+
95+
1. Get AKS credentials:
96+
97+
```sql
98+
az aks get-credentials --name myCluster --resource-group myResourceGroup
99+
```
100+
101+
1. Create Coder namespace:
102+
103+
```shell
104+
kubectl create ns coder
105+
```
106+
107+
1. Deploy non-production PostgreSQL instance to AKS cluster:
108+
109+
```shell
110+
helm repo add bitnami https://charts.bitnami.com/bitnami
111+
helm install coder-db bitnami/postgresql \
112+
--namespace coder \
113+
--set auth.username=coder \
114+
--set auth.password=coder \
115+
--set auth.database=coder \
116+
--set persistence.size=10Gi
117+
```
118+
119+
1. Create the PostgreSQL secret:
120+
121+
```shell
122+
kubectl create secret generic coder-db-url -n coder --from-literal=url="postgres://coder:coder@coder-db-postgresql.coder.svc.cluster.local:5432/coder?sslmode=disable"
123+
```
124+
125+
1. Deploy Coder to AKS cluster:
126+
127+
```shell
128+
helm repo add coder-v2 https://helm.coder.com/v2
129+
helm install coder coder-v2/coder \
130+
--namespace coder \
131+
--values values.yaml \
132+
--version 2.18.5
133+
```
134+
135+
1. Clean up Azure resources:
136+
137+
```sql
138+
az group delete --name myResourceGroup
139+
az group delete --name MC_myResourceGroup_myCluster_eastus
140+
```
141+
142+
1. Deploy the gateway - this needs clarification
143+
144+
1. After you deploy the gateway, add the following entries to Helm's `values.yaml` file before you deploy Coder:
145+
146+
```yaml
147+
service:
148+
enable: true
149+
type: ClusterIP
150+
sessionAffinity: None
151+
externalTrafficPolicy: Cluster
152+
loadBalancerIP: ""
153+
annotations: {}
154+
httpNodePort: ""
155+
httpsNodePort: ""
156+
157+
ingress:
158+
enable: true
159+
className: "azure-application-gateway"
160+
host: ""
161+
wildcardHost: ""
162+
annotations: {}
163+
tls:
164+
enable: false
165+
secretName: ""
166+
wildcardSecretName: ""
167+
```

docs/manifest.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,14 @@
9191
"title": "Kubernetes",
9292
"description": "Install Coder on Kubernetes",
9393
"path": "./install/kubernetes.md",
94-
"icon_path": "./images/icons/kubernetes.svg"
94+
"icon_path": "./images/icons/kubernetes.svg",
95+
"children": [
96+
{
97+
"title": "Deploy Coder on Azure with an Application Gateway",
98+
"description": "Deploy Coder on Azure with an Application Gateway",
99+
"path": "./install/kubernetes/kubernetes-azure-app-gateway.md"
100+
}
101+
]
95102
},
96103
{
97104
"title": "Rancher",
@@ -926,6 +933,11 @@
926933
"description": "Federating Coder to Azure",
927934
"path": "./tutorials/azure-federation.md"
928935
},
936+
{
937+
"title": "Deploy Coder on Azure with an Application Gateway",
938+
"description": "Deploy Coder on Azure with an Application Gateway",
939+
"path": "./install/kubernetes/kubernetes-azure-app-gateway.md"
940+
},
929941
{
930942
"title": "Scanning Workspaces with JFrog Xray",
931943
"description": "Integrate Coder with JFrog Xray",

0 commit comments

Comments
 (0)