-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
78 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"cSpell.words": [ | ||
"bitnami", | ||
"crds", | ||
"fluxcd", | ||
"Kustomization", | ||
"kustomize", | ||
"podinfo", | ||
"poshcode", | ||
"traefik", | ||
"valuesfrom" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# PoshCode k8s Cluster | ||
|
||
This repo has a full bicep deployment for a Kubernetes Cluster, including a github workflow to deploy it, and full yaml to configure all the applications on it. | ||
|
||
There are two parts: | ||
|
||
1. The **infrastructure** deployment, written in Azure Bicep | ||
2. The **GitOps configuration** (in yaml, in the `clusters`, `system`, and `apps` folders) | ||
|
||
## Infrastructure Deployment | ||
|
||
I've written my own template for deploying AKS, and it's in the `Infrastructure` folder. It's written in [Azure Bicep](https://docs.microsoft.com/en-us/azure/azure-resource-manager/bicep/overview), and is relatively opinionated, since we're using Flux for GitOps. | ||
|
||
### Prerequisites | ||
|
||
1. Enable some pre-release features in your Azure tenant | ||
2. Create a resource group in Azure | ||
3. Create a service account in Azure for automation | ||
4. Create secrets in github for authentication as that service account | ||
|
||
See [Initialize-Azure](./Initialize-Azure.ps1)` for details. You might call it like this: | ||
|
||
```PowerShell | ||
./Initialize-Azure -baseName $name | ||
``` | ||
|
||
### Deploying | ||
|
||
Basically, you're going to run something like this, except we have a [workflow for that](.github/workflows/deploy.yaml). | ||
|
||
|
||
```PowerShell | ||
$Deployment = @{ | ||
Name = "aks-$(Get-Date -f yyyyMMddThhmmss)" | ||
ResourceGroupName = "rg-$name" | ||
TemplateFile = ".\infrastructure\Cluster.bicep" | ||
TemplateParameterObject = @{ | ||
baseName = "$name" | ||
adminId = (Get-AzADGroup -Filter "DisplayName eq 'AksAdmins'").Id | ||
} | ||
} | ||
New-AzResourceGroupDeployment @Deployment | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ spec: | |
path: ./apps | ||
prune: true | ||
wait: true | ||
|
||
commonMetadata: | ||
annotations: | ||
poshcode.org/tenant: sre-team |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters