Skip to content

Commit 4cff1d7

Browse files
committed
📝 Update README
1 parent b5d5ed9 commit 4cff1d7

File tree

11 files changed

+343
-0
lines changed

11 files changed

+343
-0
lines changed

.chglog/CHANGELOG.tpl.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Change Log
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
{{ if .Versions -}}
6+
<a name="unreleased"></a>
7+
## [Unreleased]
8+
{{ if .Unreleased.CommitGroups -}}
9+
{{ range .Unreleased.CommitGroups -}}
10+
### {{ .Title }}
11+
{{ range .Commits -}}
12+
{{/* SKIPPING RULES - START */ -}}
13+
{{- if not (hasPrefix .Subject "Updated CHANGELOG") -}}
14+
{{- if not (contains .Subject "[ci skip]") -}}
15+
{{- if not (contains .Subject "[skip ci]") -}}
16+
{{- if not (hasPrefix .Subject "Merge pull request ") -}}
17+
{{- if not (hasPrefix .Subject "Added CHANGELOG") -}}
18+
{{- /* SKIPPING RULES - END */ -}}
19+
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
20+
{{/* SKIPPING RULES - START */ -}}
21+
{{ end -}}
22+
{{ end -}}
23+
{{ end -}}
24+
{{ end -}}
25+
{{ end -}}
26+
{{/* SKIPPING RULES - END */ -}}
27+
{{ end }}
28+
{{ end -}}
29+
{{ else }}
30+
{{ range .Unreleased.Commits -}}
31+
{{/* SKIPPING RULES - START */ -}}
32+
{{- if not (hasPrefix .Subject "Updated CHANGELOG") -}}
33+
{{- if not (contains .Subject "[ci skip]") -}}
34+
{{- if not (contains .Subject "[skip ci]") -}}
35+
{{- if not (hasPrefix .Subject "Merge pull request ") -}}
36+
{{- if not (hasPrefix .Subject "Added CHANGELOG") -}}
37+
{{- /* SKIPPING RULES - END */ -}}
38+
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
39+
{{/* SKIPPING RULES - START */ -}}
40+
{{ end -}}
41+
{{ end -}}
42+
{{ end -}}
43+
{{ end -}}
44+
{{ end -}}
45+
{{/* SKIPPING RULES - END */ -}}
46+
{{ end }}
47+
{{ end -}}
48+
{{ end -}}
49+
50+
{{ range .Versions }}
51+
<a name="{{ .Tag.Name }}"></a>
52+
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }}
53+
{{ if .CommitGroups -}}
54+
{{ range .CommitGroups -}}
55+
### {{ .Title }}
56+
{{ range .Commits -}}
57+
{{/* SKIPPING RULES - START */ -}}
58+
{{- if not (hasPrefix .Subject "Updated CHANGELOG") -}}
59+
{{- if not (contains .Subject "[ci skip]") -}}
60+
{{- if not (contains .Subject "[skip ci]") -}}
61+
{{- if not (hasPrefix .Subject "Merge pull request ") -}}
62+
{{- if not (hasPrefix .Subject "Added CHANGELOG") -}}
63+
{{- /* SKIPPING RULES - END */ -}}
64+
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
65+
{{/* SKIPPING RULES - START */ -}}
66+
{{ end -}}
67+
{{ end -}}
68+
{{ end -}}
69+
{{ end -}}
70+
{{ end -}}
71+
{{/* SKIPPING RULES - END */ -}}
72+
{{ end }}
73+
{{ end -}}
74+
{{ else }}
75+
{{ range .Commits -}}
76+
{{/* SKIPPING RULES - START */ -}}
77+
{{- if not (hasPrefix .Subject "Updated CHANGELOG") -}}
78+
{{- if not (contains .Subject "[ci skip]") -}}
79+
{{- if not (contains .Subject "[skip ci]") -}}
80+
{{- if not (hasPrefix .Subject "Merge pull request ") -}}
81+
{{- if not (hasPrefix .Subject "Added CHANGELOG") -}}
82+
{{- /* SKIPPING RULES - END */ -}}
83+
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
84+
{{/* SKIPPING RULES - START */ -}}
85+
{{ end -}}
86+
{{ end -}}
87+
{{ end -}}
88+
{{ end -}}
89+
{{ end -}}
90+
{{/* SKIPPING RULES - END */ -}}
91+
{{ end }}
92+
{{ end -}}
93+
94+
{{- if .NoteGroups -}}
95+
{{ range .NoteGroups -}}
96+
### {{ .Title }}
97+
{{ range .Notes }}
98+
{{ .Body }}
99+
{{ end }}
100+
{{ end -}}
101+
{{ end -}}
102+
{{ end -}}
103+
104+
{{- if .Versions }}
105+
[Unreleased]: {{ .Info.RepositoryURL }}/compare/{{ $latest := index .Versions 0 }}{{ $latest.Tag.Name }}...HEAD
106+
{{ range .Versions -}}
107+
{{ if .Tag.Previous -}}
108+
[{{ .Tag.Name }}]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}
109+
{{ end -}}
110+
{{ end -}}
111+
{{ end -}}

.chglog/config.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
style: github
2+
template: CHANGELOG.tpl.md
3+
info:
4+
title: CHANGELOG
5+
repository_url: https://github.com/terraform-aws-modules/terraform-aws-vpc
6+
options:
7+
header:
8+
pattern: "^(.*)$"
9+
pattern_maps:
10+
- Subject

.github/workflows/pre-commit.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Pre-Commit
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
# Min Terraform version(s)
11+
getDirectories:
12+
name: Get root directories
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
- name: Install Python
18+
uses: actions/setup-python@v2
19+
- name: Build matrix
20+
id: matrix
21+
run: |
22+
DIRS=$(python -c "import json; import glob; print(json.dumps([x.replace('/versions.tf', '') for x in glob.glob('./**/versions.tf', recursive=True)]))")
23+
echo "::set-output name=directories::$DIRS"
24+
outputs:
25+
directories: ${{ steps.matrix.outputs.directories }}
26+
27+
preCommitMinVersions:
28+
name: Min TF validate
29+
needs: getDirectories
30+
runs-on: ubuntu-latest
31+
strategy:
32+
matrix:
33+
directory: ${{ fromJson(needs.getDirectories.outputs.directories) }}
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@v2
37+
- name: Install Python
38+
uses: actions/setup-python@v2
39+
- name: Terraform min/max versions
40+
id: minMax
41+
uses: clowdhaus/terraform-min-max@v1.0.2
42+
with:
43+
directory: ${{ matrix.directory }}
44+
- name: Install Terraform v${{ steps.minMax.outputs.minVersion }}
45+
uses: hashicorp/setup-terraform@v1
46+
with:
47+
terraform_version: ${{ steps.minMax.outputs.minVersion }}
48+
- name: Install pre-commit dependencies
49+
run: pip install pre-commit
50+
- name: Execute pre-commit
51+
# Run only validate pre-commit check on min version supported
52+
if: ${{ matrix.directory != '.' }}
53+
run: pre-commit run terraform_validate --color=always --show-diff-on-failure --files ${{ matrix.directory }}/*
54+
- name: Execute pre-commit
55+
# Run only validate pre-commit check on min version supported
56+
if: ${{ matrix.directory == '.' }}
57+
run: pre-commit run terraform_validate --color=always --show-diff-on-failure --files $(ls *.tf)
58+
59+
# Max Terraform version
60+
getBaseVersion:
61+
name: Module max TF version
62+
runs-on: ubuntu-latest
63+
steps:
64+
- name: Checkout
65+
uses: actions/checkout@v2
66+
- name: Terraform min/max versions
67+
id: minMax
68+
uses: clowdhaus/terraform-min-max@v1.0.2
69+
outputs:
70+
minVersion: ${{ steps.minMax.outputs.minVersion }}
71+
maxVersion: ${{ steps.minMax.outputs.maxVersion }}
72+
73+
preCommitMaxVersion:
74+
name: Max TF pre-commit
75+
runs-on: ubuntu-latest
76+
needs: getBaseVersion
77+
strategy:
78+
fail-fast: false
79+
matrix:
80+
version:
81+
- ${{ needs.getBaseVersion.outputs.maxVersion }}
82+
steps:
83+
- name: Checkout
84+
uses: actions/checkout@v2
85+
- name: Install Python
86+
uses: actions/setup-python@v2
87+
- name: Install Terraform v${{ matrix.version }}
88+
uses: hashicorp/setup-terraform@v1
89+
with:
90+
terraform_version: ${{ matrix.version }}
91+
- name: Install pre-commit dependencies
92+
run: |
93+
pip install pre-commit
94+
curl -Lo ./terraform-docs.tar.gz https://github.com/terraform-docs/terraform-docs/releases/download/v0.13.0/terraform-docs-v0.13.0-$(uname)-amd64.tar.gz && tar -xzf terraform-docs.tar.gz && chmod +x terraform-docs && sudo mv terraform-docs /usr/bin/
95+
curl -L "$(curl -s https://api.github.com/repos/terraform-linters/tflint/releases/latest | grep -o -E "https://.+?_linux_amd64.zip")" > tflint.zip && unzip tflint.zip && rm tflint.zip && sudo mv tflint /usr/bin/
96+
- name: Execute pre-commit
97+
# Run all pre-commit checks on max version supported
98+
if: ${{ matrix.version == needs.getBaseVersion.outputs.maxVersion }}
99+
run: pre-commit run --color=always --show-diff-on-failure --all-files

.pre-commit-config.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
repos:
2+
- repo: git://github.com/antonbabenko/pre-commit-terraform
3+
rev: v1.50.0
4+
hooks:
5+
- id: terraform_fmt
6+
- id: terraform_validate
7+
- id: terraform_docs
8+
- id: terraform_tflint
9+
args:
10+
- "--args=--only=terraform_deprecated_interpolation"
11+
- "--args=--only=terraform_deprecated_index"
12+
- "--args=--only=terraform_unused_declarations"
13+
- "--args=--only=terraform_comment_syntax"
14+
- "--args=--only=terraform_documented_outputs"
15+
- "--args=--only=terraform_documented_variables"
16+
- "--args=--only=terraform_typed_variables"
17+
- "--args=--only=terraform_module_pinned_source"
18+
- "--args=--only=terraform_naming_convention"
19+
- "--args=--only=terraform_required_version"
20+
- "--args=--only=terraform_required_providers"
21+
- "--args=--only=terraform_standard_module_structure"
22+
- "--args=--only=terraform_workspace_remote"
23+
- repo: git://github.com/pre-commit/pre-commit-hooks
24+
rev: v3.4.0
25+
hooks:
26+
- id: check-merge-conflict

CHANGELOG.md

Whitespace-only changes.

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,30 @@
11
# Kind Cluster
2+
3+
Terraform module which creates Kubernetes Cluster resources on KIND (Kubernetes in Docker).
4+
5+
## Usage
6+
7+
### Basic Cluster Configuration
8+
9+
```hcl
10+
module "kind_cluster" {
11+
source = "pepodev/cluster/kind"
12+
version = "~> 0.1"
13+
14+
cluster_name = "kubernetes-problems"
15+
enable_metrics_server = true
16+
enable_loadbalancer = true
17+
}
18+
```
19+
20+
## Examples
21+
22+
- [Simple Cluster](examples/simple-kubernetes-cluster)
23+
- [Multiple Node Cluster](multi-node-kubernetes-cluster)
24+
- [API Metrics Server](examples/metrics-api-server)
25+
- [Nginx Ingress Controller](examples/nginx-ingress-controller)
26+
- [Node Mount](examples/node-mount)
27+
28+
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
29+
## Requirements
30+
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
module "kind_cluster" {
2+
source = "../../"
3+
4+
cluster_name = "kubernetes-problems"
5+
enable_metrics_server = true
6+
enable_loadbalancer = false
7+
8+
nodes = [
9+
{
10+
role = "control-plan"
11+
kubeadm_config_patches = []
12+
extra_port_mappings = null
13+
},
14+
{
15+
role = "control-plan"
16+
kubeadm_config_patches = []
17+
extra_port_mappings = null
18+
},
19+
{
20+
role = "control-plan"
21+
kubeadm_config_patches = []
22+
extra_port_mappings = null
23+
},
24+
{
25+
role = "worker"
26+
kubeadm_config_patches = []
27+
extra_port_mappings = null
28+
},
29+
{
30+
role = "worker"
31+
kubeadm_config_patches = []
32+
extra_port_mappings = null
33+
},
34+
{
35+
role = "worker"
36+
kubeadm_config_patches = []
37+
extra_port_mappings = null
38+
}
39+
]
40+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
terraform {
2+
required_providers {
3+
helm = {
4+
source = "hashicorp/helm"
5+
version = "~> 2.3"
6+
}
7+
kubernetes = {
8+
source = "hashicorp/kubernetes"
9+
version = "~> 2.4"
10+
}
11+
}
12+
}
13+
14+
provider "helm" {
15+
kubernetes {
16+
host = module.kind_cluster.endpoint
17+
client_certificate = module.kind_cluster.client_certificate
18+
client_key = module.kind_cluster.client_key
19+
cluster_ca_certificate = module.kind_cluster.cluster_ca_certificate
20+
}
21+
}
22+
23+
provider "kubernetes" {
24+
host = module.kind_cluster.endpoint
25+
client_certificate = module.kind_cluster.client_certificate
26+
client_key = module.kind_cluster.client_key
27+
cluster_ca_certificate = module.kind_cluster.cluster_ca_certificate
28+
}

0 commit comments

Comments
 (0)