Skip to content

refactor(addon): switch to universal addon #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 54 commits into from
May 20, 2025
Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
f7bc273
refactor: switch to universal addon
matejhasul Apr 14, 2025
8132c3a
feat(modules): remove modules dir
matejhasul Apr 14, 2025
7fdbd96
feat(addons): remove oidc
matejhasul Apr 16, 2025
9088ecc
fixup! feat(addons): remove oidc
matejhasul Apr 16, 2025
65199f9
feat(main): initial setup of main
matejhasul Apr 16, 2025
d048715
fix(setup): remove renovate config
matejhasul Apr 25, 2025
6eb1d7b
fixup! fix(setup): remove renovate config
matejhasul Apr 25, 2025
af3aed9
feat(ci): install kubectl
matejhasul Apr 25, 2025
5e936ee
feat(iam): add default irsa policy
matejhasul Apr 25, 2025
8f5dfa0
fix(doc): fix docs after fucked-up rebase
matejhasul Apr 25, 2025
14affe2
fix(ci): remove renovate config
matejhasul Apr 28, 2025
13d0b51
fix(main): change addon name
matejhasul Apr 28, 2025
408a58b
feat(iam): load default policy with datasource instead of file
matejhasul Apr 28, 2025
64cec47
feat(iam): make aws partition configurable
matejhasul Apr 28, 2025
c16d55a
fix(iam): rename default_policy to iam
matejhasul Apr 28, 2025
3270903
feat(pod identity): plumb pod identity
matejhasul Apr 28, 2025
3e7d34f
fix(pod identity): change default value for service_account_namespace
matejhasul Apr 29, 2025
094644b
feat(pod identity): use similiar variables as in addon-irsa
matejhasul Apr 29, 2025
abb4b77
feat(pod identity): finally make all the conditions work
matejhasul Apr 30, 2025
199fcdb
refactor(pod identity): make resources names consistent
matejhasul Apr 30, 2025
58a83b6
doc(examples): fix examples
matejhasul Apr 30, 2025
d0f0972
fix(addon-irsa): fix processing of irsa_additional_policies
matejhasul Apr 30, 2025
38acbd1
refactor(pod-identity): rename pod_identity.tf to pod-identity.tf
matejhasul May 5, 2025
f24fa26
refactor(pod-identity): prefix local vars in pod-identity.tf
matejhasul May 5, 2025
fe8d30b
fix(pod-identity): remove try for service_account_name
matejhasul May 5, 2025
9a6dbdb
refactor(pod-identity): remove redundant () for pod_identity_policy_e…
matejhasul May 5, 2025
6480685
fix(pod-identity): use try() to set pod_identy_policy to empty string…
matejhasul May 5, 2025
5e07875
fix(iam): add local var for irsa_policy_enabled
matejhasul May 5, 2025
3696af8
fix(main): do not explicitely set helm_chart_name
matejhasul May 5, 2025
02a1ce8
fix(main): use try() to set empty string to irsa_policy if null
matejhasul May 5, 2025
305e135
fix(main): use irsa_policy_enabled from locals
matejhasul May 5, 2025
bff1d7c
feat(irsa): add migrations for irsa
matejhasul May 5, 2025
8d3289e
feat(addon): add migration resources
matejhasul May 5, 2025
64e7ac7
feat(examples): Make examples work
matejhasul May 5, 2025
5a91358
feat(pod-identity): use pod identity from irsa module
matejhasul May 6, 2025
cd2b0f8
fix(pod identity): fix conditions
matejhasul May 6, 2025
48d4498
fixup! fix(pod identity): fix conditions
matejhasul May 6, 2025
22dbf86
fix(pod identity): set pod_identity_policy_enabled to true by default.
matejhasul May 9, 2025
bc8d705
feat(addon): add moved blocks to ease migration
matejhasul May 9, 2025
fbf4f6e
refactor(irsa): make tflint happy
matejhasul May 9, 2025
2106b0c
fix(iam): fix condition for irsa policy
matejhasul May 9, 2025
ba9d7b4
fix(migrations): use old name for irsa-related resources
matejhasul May 12, 2025
557dde4
fix(migrations): removed indexes from moved blocks
matejhasul May 12, 2025
1aa2946
fix(variables): update variables from latest universal-addon
matejhasul May 12, 2025
cb45c62
fix(universal-addon): use univeral addon from specific commit
matejhasul May 12, 2025
cb01bd2
fix(migrations): add moved blocks for all installation methods
matejhasul May 13, 2025
5f17695
fix(ci): use github workflows from universal addon
matejhasul May 14, 2025
e1c07e9
fix(ci): remove renovate from gh workflow
matejhasul May 14, 2025
848a95e
fix(variables): add clusterName to values
matejhasul May 14, 2025
3c214c8
fix(main): update null handling for *_policy
matejhasul May 15, 2025
ff48ebb
fix(doc): add link to lb-controller repo
matejhasul May 16, 2025
3e5fc6e
fix(docs): add repo link to main.tf
matejhasul May 16, 2025
17b393b
fix(docs): remove empty line
matejhasul May 16, 2025
728ff9b
fix(examples): remove extra line
matejhasul May 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: pre-commit

on:
workflow_dispatch:
pull_request:
branches:
- main
- master

permissions:
contents: read

concurrency:
group: pre-commit-${{ github.ref }}
cancel-in-progress: false

env:
# renovate: datasource=github-releases depName=asdf-vm/asdf
ASDF_VERSION: 31e8c93004abd76253d186b8896785895069749b # v0.15.0 # pragma: allowlist secret

jobs:
pre-commit:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- name: Setup ASDF
uses: asdf-vm/actions/setup@05e0d2ed97b598bfce82fd30daf324ae0c4570e6 # v3.0.2

- name: Cache ASDF
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
id: asdf-cache
with:
# https://github.com/asdf-vm/asdf/blob/master/.gitignore
path: |
~/.asdf/installs
~/.asdf/plugins
~/.asdf/shims
key: ${{ runner.os }}-asdf-${{ hashFiles('.tool-versions') }}
restore-keys: ${{ runner.os }}-asdf-

- name: Install ASDF
uses: asdf-vm/actions/install@05e0d2ed97b598bfce82fd30daf324ae0c4570e6 # v3.0.2
if: ${{ steps.asdf-cache.outputs.cache-hit != 'true' }}
with:
asdf_branch: ${{ env.ASDF_VERSION }}

- name: Reshim installed ASDF tools
shell: bash
run: asdf reshim

- name: Cache pip
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ~/.cache/pip/
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt', '.pre-commit-config.yaml') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install pip dependencies
run: pip install -r requirements.txt

- name: Run pre-commit
run: pre-commit run --show-diff-on-failure --color=always --all-files
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required for zizmor
52 changes: 0 additions & 52 deletions .github/workflows/pre-commit.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
name: Release Drafter

permissions:
contents: write
pull-requests: read
name: Release drafter

on:
push:
Expand All @@ -11,13 +7,21 @@ on:
- master

pull_request:
types: [opened, reopened, synchronize, labeled]
types:
- opened
- reopened
- synchronize
- labeled

permissions:
contents: write
pull-requests: read

jobs:
update_release_draft:
runs-on: ubuntu-22.04
release-drafter:
runs-on: ubuntu-24.04
steps:
- uses: release-drafter/release-drafter@v5
- uses: release-drafter/release-drafter@b1476f6e6eb133afa41ed8589daba6dc69b4d3f5 # v6.1.0
with:
config-name: RELEASE_DRAFTER.yml
env:
Expand Down
96 changes: 96 additions & 0 deletions .github/workflows/template-sync.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Template sync

on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *' # every day at midnight

permissions: {}

concurrency:
group: pre-commit
cancel-in-progress: false

env:
# renovate: datasource=github-releases depName=asdf-vm/asdf
ASDF_VERSION: 31e8c93004abd76253d186b8896785895069749b # v0.15.0 # pragma: allowlist secret

jobs:
universal-addon:
if: github.repository != 'lablabs/terraform-aws-eks-universal-addon'
runs-on: ubuntu-24.04
steps:
- name: Generate GitHub App token
id: template-sync-app-token
uses: actions/create-github-app-token@3ff1caaa28b64c9cc276ce0a02e2ff584f3900c5 # v2.0.2
with:
app-id: ${{ secrets.LARA_TEMPLATE_SYNC_APP_ID }}
private-key: ${{ secrets.LARA_TEMPLATE_SYNC_APP_PRIVATE_KEY }}
repositories: ${{ github.event.repository.name }}
owner: ${{ github.repository_owner }}

- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
token: ${{ steps.template-sync-app-token.outputs.token }} # needed for private repositories
persist-credentials: false

- name: Sync universal-addon template
uses: AndreasAugustin/actions-template-sync@bcb94410a4f1dffdfe5eaabc8234c3b8e76ebc5b # v2.5.1
with:
source_gh_token: ${{ steps.template-sync-app-token.outputs.token }}
source_repo_path: lablabs/terraform-aws-eks-universal-addon
upstream_branch: main

target_gh_token: ${{ steps.template-sync-app-token.outputs.token }}

git_remote_pull_params: --allow-unrelated-histories --squash --strategy=recursive --no-tags -X theirs

pr_labels: kind/sync
pr_branch_name_prefix: "feat/universal-addon-sync"
pr_title: "feat(sync): sync universal-addon changes"
pr_commit_msg: "feat(sync): sync universal-addon changes"

is_pr_cleanup: true

- name: Setup ASDF
uses: asdf-vm/actions/setup@05e0d2ed97b598bfce82fd30daf324ae0c4570e6 # v3.0.2

- name: Cache ASDF
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
id: asdf-cache
with:
# https://github.com/asdf-vm/asdf/blob/master/.gitignore
path: |
~/.asdf/installs
~/.asdf/plugins
~/.asdf/shims
key: ${{ runner.os }}-asdf-${{ hashFiles('.tool-versions') }}
restore-keys: ${{ runner.os }}-asdf-

- name: Install ASDF
uses: asdf-vm/actions/install@05e0d2ed97b598bfce82fd30daf324ae0c4570e6 # v3.0.2
if: ${{ steps.asdf-cache.outputs.cache-hit != 'true' }}
with:
asdf_branch: ${{ env.ASDF_VERSION }}

- name: Reshim installed ASDF tools
shell: bash
run: asdf reshim

- name: Cache pip
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ~/.cache/pip/
key: ${{ runner.os }}-pip-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Update README.md
run: pre-commit run --show-diff-on-failure --color=always terraform_docs --all-files || true

- name: Commit and push README.md
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4
with:
add: README.md
message: "docs: update README.md"
51 changes: 27 additions & 24 deletions .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,42 +11,45 @@ on:
- master

jobs:
versionExtract:
extract-version:
name: Extract min/max Terraform versions
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- name: Extract Terraform min/max versions
id: minMax
uses: clowdhaus/terraform-min-max@main
id: terraform-min-max
uses: clowdhaus/terraform-min-max@f489335873df04c3ce04b5e73f385a726d910039 # v1.3.2
with:
directory: .
outputs:
minVersion: ${{ steps.minMax.outputs.minVersion }}
maxVersion: ${{ steps.minMax.outputs.maxVersion }}
minVersion: ${{ steps.terraform-min-max.outputs.minVersion }}
maxVersion: ${{ steps.terraform-min-max.outputs.maxVersion }}

terraform-validate:
runs-on: ubuntu-22.04
needs: versionExtract
runs-on: ubuntu-24.04
needs: extract-version
strategy:
matrix:
tf_ver:
- ${{ needs.versionExtract.outputs.minVersion }}
- ${{ needs.versionExtract.outputs.maxVersion }}

- ${{ needs.extract-version.outputs.minVersion }}
- ${{ needs.extract-version.outputs.maxVersion }}
steps:
- uses: actions/checkout@v3
- uses: hashicorp/setup-terraform@v2
with:
terraform_version: ${{ matrix.tf_ver }}

- name: Terraform Init
id: init
run: terraform init

- name: Terraform Validate
id: validate
run: terraform validate
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
with:
terraform_version: ${{ matrix.tf_ver }}

- name: Terraform Init
run: terraform init

- name: Terraform Validate
run: terraform validate
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,3 @@ override.tf.json
# Ignore CLI configuration files
.terraformrc
terraform.rc

.terraform.lock.hcl
49 changes: 33 additions & 16 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,49 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
args: ["--markdown-linebreak-ext=md"]
- id: check-merge-conflict
- id: detect-aws-credentials
args: ['--allow-missing-credentials']
args: ["--allow-missing-credentials"]
- id: detect-private-key
- id: end-of-file-fixer

- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.83.1
rev: v1.96.3
hooks:
- id: terraform_fmt
- id: terraform_tflint
args:
- --args=--config=__GIT_WORKING_DIR__/.tflint.hcl
- id: terraform_validate
- id: terraform_checkov
args:
- '--args=--skip-check CKV_TF_1' #CKV_TF_1: "Ensure Terraform module sources use a commit hash"
- id: terraform_docs
args:
- '--args=--config=.terraform-docs.yml'
- id: terraform_validate
- id: terraform_fmt
- id: terraform_providers_lock
args:
- --hook-config=--mode=only-check-is-current-lockfile-cross-platform
- --args=-platform=darwin_amd64
- --args=-platform=darwin_arm64
- --args=-platform=linux_amd64
- id: terraform_tflint
args:
- --args=--config=__GIT_WORKING_DIR__/.tflint.hcl
- id: terraform_checkov
args:
- "--args=--quiet --skip-check CKV_TF_1" #CKV_TF_1: "Ensure Terraform module sources use a commit hash"
- id: terraform_docs
args:
- "--args=--config=.terraform-docs.yml"

- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
rev: v1.5.0
hooks:
- id: detect-secrets
args: ['--baseline', '.secrets.baseline']
args: ["--baseline", ".secrets.baseline"]
exclude: terraform.tfstate

- repo: local
hooks:
- id: sync-variables
name: Sync module variables
entry: ./scripts/sync-variables.py
language: system
types: [python]
always_run: true
pass_filenames: false
Loading
Loading