Skip to content

Commit 47d4048

Browse files
Merge pull request 'Bug fixes for Azure support | Making the UX simpler' (#247) from fix/145 into main
Reviewed-on: https://gitea.obmondo.com/EnableIT/kubeaid-bootstrap-script/pulls/247
2 parents 2f122a1 + 31c69ba commit 47d4048

29 files changed

+500
-649
lines changed

.dockerignore

Lines changed: 0 additions & 7 deletions
This file was deleted.

.github/workflows/release.yaml

Lines changed: 44 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,67 @@
11
name: Release
22

3-
# This Github Action workflow is triggered, when a new release is published.
3+
# This Github Action workflow is triggered, when a new release is created.
44
on:
55
release:
6-
types: [published]
6+
types: [created]
7+
8+
permissions:
9+
packages: write
10+
security-events: write
711

812
jobs:
9-
build_and_push_container_image:
10-
name: Build and push container image
13+
scan_sourcecode:
14+
name: Scanning sourcecode to find vulberabilities, misconfigurations and exposed secrets
1115
runs-on: ubuntu-latest
12-
permissions:
13-
packages: write
14-
security-events: write
1516
steps:
1617
- name: Checkout code
17-
uses: actions/checkout@v3
18-
19-
- name: Set up QEMU
20-
uses: docker/setup-qemu-action@v2
18+
uses: actions/checkout@v4
2119

2220
- name: Create outputs directory
23-
run: mkdir -p ./outputs/trivy
21+
run: mkdir -p /tmp/trivy
2422

25-
- name: Run Trivy vulnerability and secret scanner in fs mode
26-
uses: aquasecurity/trivy-action@master
23+
- name: Run Trivy security scan against the sourcecode
24+
id: security-scan
25+
uses: aquasecurity/[email protected]
2726
with:
2827
scan-type: fs
28+
vuln-type: library
2929
scan-ref: .
3030
trivy-config: trivy.yaml
31-
format: sarif
32-
output: ./outputs/trivy/fs.sarif
33-
34-
- name: Upload the scan result to CodeQL
35-
uses: github/codeql-action/upload-sarif@v3
36-
with:
37-
sarif_file: ./outputs/trivy/fs.sarif
38-
category: fs
39-
40-
- name: Detect IaC vulnerabilities and misconfigurations using Trivy
41-
uses: aquasecurity/trivy-action@master
42-
with:
43-
scan-type: config
44-
scan-ref: .
45-
trivy-config: trivy.yaml
46-
format: sarif
47-
output: ./outputs/trivy/iac-and-config.sarif
31+
format: table
32+
output: security-scan-result.txt
4833

49-
- name: Upload the scan result to CodeQL
50-
uses: github/codeql-action/upload-sarif@v3
51-
with:
52-
sarif_file: ./outputs/trivy/iac-and-config.sarif
53-
category: iac-and-configurations
34+
- name: Append the security scan result to the job summary
35+
run: |
36+
{
37+
echo "### 🛡️ Sourcecode security scan result :"
38+
echo ""
39+
echo '```terraform'
40+
cat security-scan-result.txt
41+
echo '```'
42+
} >> $GITHUB_STEP_SUMMARY
5443
55-
- name: Set up Docker Buildx
56-
uses: docker/setup-buildx-action@v2
44+
build_and_publish_binaries:
45+
name: Build and publish binary
46+
runs-on: ubuntu-latest
5747

58-
- name: Login to GitHub Container Registry
59-
uses: docker/[email protected]
60-
with:
61-
registry: ghcr.io
62-
username: obmondo
63-
password: ${{ secrets.GITHUB_TOKEN }}
48+
strategy:
49+
matrix:
50+
goos: [linux, darwin]
51+
goarch: [amd64, arm64]
6452

65-
- name: Build and push KubeAid Bootstrap Script AMD64 and ARM64 container images
66-
uses: docker/build-push-action@v4
67-
with:
68-
context: .
69-
file: build/docker/Dockerfile
70-
# NOTE : It takes pretty long to build container images for the ARM64 platform (even when
71-
# using QEMU).
72-
platforms: linux/amd64,linux/arm64
73-
tags: ghcr.io/obmondo/kubeaid-bootstrap-script:${{ github.event.release.tag_name }}
74-
push: true
75-
# Experimental cache exporter for GitHub Actions provided by buildx and BuildKit.
76-
# It uses the GitHub Cache API to fetch and load the Docker layer cache blobs across
77-
# builds.
78-
cache-from: type=gha
79-
cache-to: type=gha,mode=max
53+
steps:
54+
- name: Checkout code
55+
uses: actions/checkout@v4
8056

81-
- name: Scan container image for vulnerabilities
82-
uses: aquasecurity/trivy-action@master
83-
with:
84-
image-ref: ghcr.io/obmondo/kubeaid-bootstrap-script:${{ github.event.release.tag_name }}
85-
vuln-type: os,library
86-
trivy-config: trivy.yaml
87-
format: sarif
88-
output: ./outputs/trivy/container-image.sarif
57+
- name: Create outputs directory
58+
run: mkdir -p ./outputs/trivy
8959

90-
- name: Upload the container image scan result to CodeQL
91-
uses: github/codeql-action/upload-sarif@v3
60+
- uses: wangyoucao577/go-release-action@v1
9261
with:
93-
sarif_file: ./outputs/trivy/container-image.sarif
94-
category: container-image
62+
goos: ${{ matrix.goos }}
63+
goarch: ${{ matrix.goarch }}
64+
project_path: ./cmd
65+
binary_name: kubeaid-bootstrap-script-${{ matrix.goos }}-${{ matrix.goarch }}
66+
github_token: ${{ secrets.GITHUB_TOKEN }}
67+
compress_assets: OFF

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
vendor/
55

6+
build/
67
outputs/
78

89
temp/

Makefile

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ delete-provisioned-cluster-aws-dev:
7070
@go run ./cmd/ cluster delete \
7171
--configs-directory ./outputs/configs/aws/
7272

73+
.PHONY: recover-cluster-aws-dev
74+
recover-cluster-aws-dev:
75+
@go run ./cmd/ cluster recover aws \
76+
--debug \
77+
--configs-directory ./outputs/configs/aws/ \
78+
--skip-pr-workflow
79+
7380
.PHONY: sample-config-generate-azure-dev
7481
sample-config-generate-azure-dev:
7582
@go run ./cmd/ config generate azure
@@ -108,9 +115,9 @@ recover-cluster-azure-dev:
108115
--configs-directory ./outputs/configs/azure/ \
109116
--skip-pr-workflow
110117

111-
.PHONY: sample-config-generate-hetzner-dev
112-
sample-config-generate-hetzner-dev:
113-
@go run ./cmd/ config generate hetzner
118+
.PHONY: sample-config-generate-hcloud-dev
119+
sample-config-generate-hcloud-dev:
120+
@go run ./cmd/ config generate hetzner hcloud
114121

115122
.PHONY: devenv-create-hcloud-dev
116123
devenv-create-hcloud-dev:
@@ -133,6 +140,10 @@ delete-provisioned-cluster-hcloud-dev:
133140
@go run ./cmd/ cluster delete \
134141
--configs-directory ./outputs/configs/hetzner/hcloud/
135142

143+
.PHONY: sample-config-generate-hcloud-dev
144+
sample-config-generate-hetzner-bare-metal-dev:
145+
@go run ./cmd/ config generate hetzner bare-metal
146+
136147
.PHONY: devenv-create-hetzner-bare-metal-dev
137148
devenv-create-hetzner-bare-metal-dev:
138149
@go run ./cmd/ devenv create \
@@ -154,6 +165,10 @@ delete-provisioned-cluster-hetzner-bare-metal-dev:
154165
--debug \
155166
--configs-directory ./outputs/configs/hetzner/bare-metal/
156167

168+
.PHONY: sample-config-generate-hetzner-hybrid-dev
169+
sample-config-generate-hetzner-hybrid-dev:
170+
@go run ./cmd/ config generate hetzner hybrid
171+
157172
.PHONY: devenv-create-hetzner-hybrid-dev
158173
devenv-create-hetzner-hybrid-dev:
159174
@go run ./cmd/ devenv create \

README.md

Lines changed: 1 addition & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1 @@
1-
# KubeAid Bootstrap
2-
3-
Welcome to the KubeAid Bootstrap repository! This project aims to simplify the process of setting up a Kubernetes (K8s) cluster across multiple cloud providers. With KubeAid Bootstrap, you can get your cluster up and running in just 10 minutes, complete with essential tools like Keycloak, ArgoCD, Cert-Manager, and monitoring via Kube-Prometheus.
4-
5-
## Features
6-
7-
- **Multi-Cloud Support**: Easily deploy on AWS (Self-managed, EKS), Azure (AKS and self-managed), Hetzner (Cloud, Robot, and Hybrid), and local environments.
8-
- **Latest Kubernetes Version**: Always set up the latest stable version of Kubernetes.
9-
- **GitOps Workflow**: Manage your cluster configuration and deployments using GitOps principles.
10-
- **Integrated Tools**:
11-
- **Keycloak**: For identity and access management.
12-
- **ArgoCD**: For continuous delivery and GitOps.
13-
- **Cert-Manager**: For managing TLS certificates.
14-
- **Kube-Prometheus**: For monitoring and alerting.
15-
16-
## Getting Started
17-
18-
Follow these steps to set up your Kubernetes cluster:
19-
20-
### Prerequisites
21-
22-
- A cloud account for your chosen provider (AWS, Azure, Hetzner).
23-
- `kubectl` installed on your local machine.
24-
- `git` installed on your local machine.
25-
- `docker` installed on your local machine.
26-
- `jsonnet` installed on your local machine.
27-
- `kubeseal` installed on your local machine.
28-
- `k3d` installed on your local machine.
29-
- Access to a terminal or command line interface.
30-
31-
NOTE: You can also run the ./scripts/install-runtime-dependencies.sh
32-
33-
- A git repo to hold your custom settings for your cluster, [kubeaid-config](https://github.com/Obmondo/kubeaid-config)
34-
35-
### Quick Setup
36-
37-
1. **Generate the [GitHub token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token)**
38-
39-
2. **Download the compose file**:
40-
- Get the compose file
41-
```bash
42-
wget https://raw.githubusercontent.com/Obmondo/kubeaid-bootstrap-script/refs/heads/main/docker-compose.yaml
43-
```
44-
45-
3. **Generate the config**:
46-
- Run the compose to generate the config, it will drop the file in **/outputs/config**
47-
```bash
48-
docker compose run bootstrap-generate
49-
```
50-
51-
4. **Fix the config based on your requirements**:
52-
- Edit general.yaml
53-
```yaml
54-
forkURLs:
55-
kubeaidConfig: https://github.com/xxxxxxxx/kubeaid-config.git
56-
```
57-
58-
5. **Add the git username and token**:
59-
- Edit secret.yaml
60-
```yaml
61-
git:
62-
username: xxxxxxxxxx
63-
password: xxxxxxxxxx
64-
```
65-
66-
6. **Choose your provider [here](https://github.com/Obmondo/kubeaid-bootstrap-script/tree/main?tab=readme-ov-file#cloud-provider-support)**
67-
68-
## Cloud Provider Support
69-
70-
- **AWS**: Self-managed and EKS
71-
- Documentation: [docs/aws.md](docs/aws.md)
72-
73-
- **Azure**: AKS and self-managed
74-
- Documentation: [docs/azure.md](docs/azure.md)
75-
76-
- **Hetzner**: Cloud, Robot, and Hybrid
77-
- Documentation: [docs/hetzner.md](docs/hetzner.md)
78-
79-
- **Local**: Minikube or other local setups
80-
- Documentation: [docs/local.md](docs/local.md)
81-
82-
## Contributing
83-
84-
We welcome contributions!
85-
Guidelines coming soon!!
86-
87-
## License
88-
89-
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
90-
91-
## Support
92-
93-
If you encounter any issues or have questions, please open an issue in the GitHub repository or reach out to the community.
94-
95-
---
96-
97-
Get your Kubernetes cluster up and running in no time with KubeAid Bootstrap! Happy clustering! 🚀
1+
# KubeAid Bootstrap Script

build/docker/Dockerfile

Lines changed: 0 additions & 30 deletions
This file was deleted.

build/docker/Dockerfile.dev

Lines changed: 0 additions & 13 deletions
This file was deleted.

cmd/cluster/upgrade/aws.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ var AWSCmd = &cobra.Command{
1414
Short: "Trigger Kubernetes version upgrade for the provisioned AWS based cluster",
1515

1616
Run: func(cmd *cobra.Command, args []string) {
17-
core.UpgradeCluster(cmd.Context(), skipPRWorkflow, core.UpgradeClusterArgs{
18-
NewKubernetesVersion: kubernetesVersion,
17+
core.UpgradeCluster(cmd.Context(), core.UpgradeClusterArgs{
18+
SkipPRWorkflow: skipPRWorkflow,
19+
20+
NewKubernetesVersion: newKubernetesVersion,
1921

2022
CloudSpecificUpdates: aws.AWSMachineTemplateUpdates{
2123
AMIID: newAMIID,

0 commit comments

Comments
 (0)