AKS-Construction/README.md

92 строки
7.8 KiB
Markdown
Исходник Обычный вид История

2021-06-22 14:55:45 +03:00
# AKS-Construction
2021-06-22 14:42:33 +03:00
2021-06-28 13:30:55 +03:00
`Status: This project is currently a Work in Progress.`
2021-06-22 14:55:45 +03:00
This project provides a comprehensive, flexible templating approach to creating Azure Kubernetes Service clusters and related Azure services.
It unifies guidance provided by the [AKS Secure Baseline](https://docs.microsoft.com/en-us/azure/architecture/reference-architectures/containers/aks/secure-baseline-aks), [Cloud Adoption Framework](https://azure.microsoft.com/en-gb/cloud-adoption-framework/) and [Enterprise-Scale](https://github.com/Azure/Enterprise-Scale) by providing tangible artifacts to deploy Azure resources from CLI or CI/CD systems.
2021-06-22 14:42:33 +03:00
2021-09-01 14:06:58 +03:00
The guiding principal we have with this project is to focus on the the *downstream use* of the project (see [releases](https://github.com/Azure/Aks-Construction/releases)). As such, these are our specific practices.
1. Converge on a single bicep template, which can easily be consumed as a module (see [here](https://github.com/Azure/Aks-Construction/blob/main/samples/SampleAppMain.bicep) for an example)
1. The number of "manual" steps will always be low, if it can go in the bicep code - it should. Seperate cli commands & manual steps whilst good for readability are not optimal for a reliable, automated deployment in your CI/CD.
1. Use *parameters* in the template to augment capability for different environment deployments
1. Test quality through CI/CD pipelines that also serve as samples/docs
2021-09-15 19:55:43 +03:00
1. Focus on AKS and supporting services, drawing the line at solving the problems of Developer workstations / Jumpboxes / CI Build Agents / Certificate Authorities / Etc
2021-09-01 14:06:58 +03:00
2021-06-22 14:55:45 +03:00
## Components
2021-06-22 14:42:33 +03:00
2021-06-29 10:12:07 +03:00
### GUI experience
2021-09-15 18:44:29 +03:00
To help guide your AKS configuration, use the [Deployment Helper](https://azure.github.io/Aks-Construction/), which will provide a set of parameters and scripts to make deployment simple. The deployment helper provides links to the official Microsoft documentation to help provide additional context for each feature.
2021-06-29 12:01:50 +03:00
2021-06-29 10:12:07 +03:00
[![preview screenshot of the helper wizard](helper_preview.png)](https://azure.github.io/Aks-Construction/)
2021-06-22 14:55:45 +03:00
2021-09-15 18:44:29 +03:00
### IaC - Bicep code files
2021-06-22 14:55:45 +03:00
2021-09-15 18:44:29 +03:00
IaC (Infrastructure as Code) code files have been modularised into their component areas. [Main.bicep](bicep/main.bicep) references them and they are expected to be present in the same directory. The Deployment Helper leverages an Arm json compiled version of all the bicep files.
2021-09-15 19:21:30 +03:00
### DevOps - GitHub Actions
2021-09-15 18:44:29 +03:00
2021-09-15 18:53:42 +03:00
A number of [GitHub actions](https://github.com/Azure/Aks-Construction/tree/main/.github/workflows) are used in the repo that run on push/pr/schedules. These can be copied into your own repo and customised for your CI/CD pipeline.
![preview screenshot of the helper wizard](ghastages.png)
Different action workflow files showcase different complexities of CI/CD practices which are summarised below.
2021-09-15 18:44:29 +03:00
1. [Deployment Verification](https://github.com/Azure/Aks-Construction/blob/ed15a8945ab019bd86469c366df85e6d59aeb8ab/.github/workflows/ByoVnetCI.yml#L100)
1. [Deployment What-If](https://github.com/Azure/Aks-Construction/blob/ed15a8945ab019bd86469c366df85e6d59aeb8ab/.github/workflows/ByoVnetCI.yml#L111)
1. [Deployment What-If Pester Testing](https://github.com/Azure/Aks-Construction/blob/ed15a8945ab019bd86469c366df85e6d59aeb8ab/.github/workflows/ByoVnetCI.yml#L141)
1. [Bicep Deployment](https://github.com/Azure/Aks-Construction/blob/ed15a8945ab019bd86469c366df85e6d59aeb8ab/.github/workflows/ByoVnetCI.yml#L189)
1. [Post Deployment AddOns](https://github.com/Azure/Aks-Construction/blob/ed15a8945ab019bd86469c366df85e6d59aeb8ab/.github/workflows/ByoVnetPrivateCI.yml#L194)
1. [Verify Deployment Configuration](https://github.com/Azure/Aks-Construction/blob/ed15a8945ab019bd86469c366df85e6d59aeb8ab/.github/workflows/ByoVnetCI.yml#L261)
1. [Deploy Test workload](https://github.com/Azure/Aks-Construction/blob/ed15a8945ab019bd86469c366df85e6d59aeb8ab/.github/workflows/ByoVnetPrivateCI.yml#L230)
1. [Verify Test workload](https://github.com/Azure/Aks-Construction/blob/ed15a8945ab019bd86469c366df85e6d59aeb8ab/.github/workflows/ByoVnetPrivateCI.yml#L278)
1. [Run App Security Scan](https://github.com/Azure/Aks-Construction/blob/ed15a8945ab019bd86469c366df85e6d59aeb8ab/.github/workflows/StandardCI.yml#L269)
2021-06-24 19:53:01 +03:00
| Config | CI Status | Notes
|--------|-----------|------|
| [ESLZ Byo peered vnet](.github/workflows_dep/AksDeploy-ByoVnet.parameters.json) | [![ByoVnetCI](https://github.com/Azure/Aks-Construction/actions/workflows/ByoVnetCI.yml/badge.svg?branch=main)](https://github.com/Azure/Aks-Construction/actions/workflows/ByoVnetCI.yml) | Takes full resource id's as parameters for existing subnets |
2021-06-29 12:01:50 +03:00
| [ESLZ Byo private vnet](.github/workflows_dep/AksDeploy-ByoVnetPrivate.parameters.json) | [![ByoVNetPrivateCI](https://github.com/Azure/Aks-Construction/actions/workflows/ByoVnetPrivateCI.yml/badge.svg)](https://github.com/Azure/Aks-Construction/actions/workflows/ByoVnetPrivateCI.yml)| as per ByoVnet, but Private |
2021-06-25 18:59:17 +03:00
| [ESLZ Sandbox](.github/workflows_dep/AksDeploy-Basic.parameters.json) | [![AksStandardCI](https://github.com/Azure/Aks-Construction/actions/workflows/StandardCI.yml/badge.svg)](https://github.com/Azure/Aks-Construction/actions/workflows/StandardCI.yml) | Deploys it's own network using default CIDRs |
2021-06-24 19:53:01 +03:00
2021-09-15 19:13:12 +03:00
## Getting Started
### Basic
If this is the first time you're using the project, follow these steps.
1. Use the [Deployment Helper](https://azure.github.io/Aks-Construction/) to guide your AKS configuration.
1. Run the commands in the *Provision Environment* tab to create your AKS Environment in your Azure subscription
1. Run the commands in the *Post Configuration* tab to complete your implementation
1. [Connect to your AKS Cluster](https://docs.microsoft.com/en-us/azure/aks/kubernetes-walkthrough#connect-to-the-cluster), and deploy your applications as you see fit.
### Mature
If you're looking to use this project as part of your deployments, follow these steps.
2021-06-22 14:55:45 +03:00
2021-09-15 19:13:12 +03:00
1. Use the [Deployment Helper](https://azure.github.io/Aks-Construction/) to guide your AKS configuration.
1. Capture the parameters on the *Template Parameters File* tab to a file - this is your configuration
1. Check the *Post Configuration* tab for any commands and save them to a file
1. Grab the [latest release](https://github.com/Azure/Aks-Construction/releases) of the bicep code
1. In your CI/CD system, either using one of the GitHub Action Workflow files as a base, or by coding it yourself - initiate a deployment of the bicep code, using your parameter file
1. In your CI/CD system, deploy your application(s) to the AKS cluster
2021-06-22 14:42:33 +03:00
## Contributing
This project welcomes contributions and suggestions. Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
## Trademarks
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft
trademarks or logos is subject to and must follow
[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
Any use of third-party trademarks or logos are subject to those third-party's policies.