Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 11 additions & 4 deletions .github/crossplane-validate/extensions.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
# The Crossplane packages whose schemas CI validates deploy/ against, offline, with
# `crossplane resource validate` (scripts/validate-crossplane-schemas.sh).
#
# This is the single place the provider version is declared. Keep it equal to the
# This is the single place the provider versions are declared. Keep each equal to the
# platform's pin in devantler-tech/platform
# k8s/providers/hetzner/infrastructure/crossplane/provider-aws-iam.yaml: the `aws` tenant
# reconciles against that version. CI compares the two on every run and reports a
# k8s/providers/hetzner/infrastructure/crossplane/<the provider's file>.yaml: the `aws`
# tenant reconciles against those versions. CI compares each on every run and reports a
# mismatch as a warning on the run.
apiVersion: pkg.crossplane.io/v1
kind: Provider
metadata:
name: provider-aws-iam
spec:
package: xpkg.upbound.io/upbound/provider-aws-iam:v2.9.1
package: xpkg.upbound.io/upbound/provider-aws-iam:v2.9.4
---
apiVersion: pkg.crossplane.io/v1
kind: Provider
metadata:
name: provider-aws-sesv2
spec:
package: xpkg.upbound.io/upbound/provider-aws-sesv2:v2.9.4
39 changes: 21 additions & 18 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,27 +139,30 @@ jobs:
- name: 🧩 Validate deploy/ and prove the gate blocks
run: bash scripts/test-validate-crossplane-schemas.sh "$RUNNER_TEMP/crossplane"

- name: 🔎 Compare the provider version with the platform's pin
# Reported, not enforced: the platform moves its pin in its own repository, and a
- name: 🔎 Compare the provider versions with the platform's pins
# Reported, not enforced: the platform moves its pins in its own repository, and a
# failure here would turn every unrelated pull request red until this file follows.
# Each declared provider is compared with the platform file of the same name.
run: |
pkg='^xpkg\.upbound\.io/[a-z0-9/-]+:v[0-9]+\.[0-9]+\.[0-9]+$'
url=https://raw.githubusercontent.com/devantler-tech/platform/main/k8s/providers/hetzner/infrastructure/crossplane/provider-aws-iam.yaml
ours=$(sed -n 's/^ package: //p' .github/crossplane-validate/extensions.yaml)
if ! platform=$(curl -fsSL --retry 3 "$url" | sed -n 's/^ package: //p'); then
echo "::warning title=Provider pin not compared::could not read the platform's provider-aws-iam pin"
exit 0
fi
# Only a plain package reference is echoed, so file content cannot reach a workflow command.
if ! [[ $ours =~ $pkg && $platform =~ $pkg ]]; then
echo "::warning title=Provider pin not compared::a package line is missing or not a plain package reference"
exit 0
fi
if [ "$ours" != "$platform" ]; then
echo "::warning title=Provider pin mismatch::validated against ${ours}, but the platform runs ${platform}; update .github/crossplane-validate/extensions.yaml"
else
echo "Provider pin matches the platform: ${ours}"
fi
base=https://raw.githubusercontent.com/devantler-tech/platform/main/k8s/providers/hetzner/infrastructure/crossplane
for name in provider-aws-iam provider-aws-sesv2; do
ours=$(awk -v n="$name" '/^ name: /{cur=$2} /^ package: / && cur == n {print $2}' .github/crossplane-validate/extensions.yaml)
if ! platform=$(curl -fsSL --retry 3 "$base/$name.yaml" | sed -n 's/^ package: //p'); then
echo "::warning title=Provider pin not compared::could not read the platform's $name pin"
continue
fi
# Only a plain package reference is echoed, so file content cannot reach a workflow command.
if ! [[ $ours =~ $pkg && $platform =~ $pkg ]]; then
echo "::warning title=Provider pin not compared::a $name package line is missing or not a plain package reference"
continue
fi
if [ "$ours" != "$platform" ]; then
echo "::warning title=Provider pin mismatch::validated against ${ours}, but the platform runs ${platform}; update .github/crossplane-validate/extensions.yaml"
else
echo "Provider pin matches the platform: ${ours}"
fi
done

ci-required-checks:
name: CI - Required Checks
Expand Down
6 changes: 4 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ It mirrors the `devantler-tech/.github` repo's `github-config` tenant pattern.
- **Layout:** all managed resources live under `deploy/`, referenced from
`deploy/kustomization.yaml`. Keep manifests namespace-agnostic (the platform-side
tenant Kustomization injects the namespace).
- **What this tenant may own:** today, only the account's GitHub Actions OIDC identity
provider (`OpenIDConnectProvider`). The platform decides which AWS resource kinds are
- **What this tenant may own:** the account's GitHub Actions OIDC identity provider
(`OpenIDConnectProvider`), and company Email's SES domain identity and its MAIL FROM
domain (`EmailIdentity`, `EmailIdentityMailFromAttributes`). The SMTP sending identity
(IAM user, policy and access key) is platform-owned. The platform decides which AWS resource kinds are
active and which of them this tenant may write. The EKS CI `Role` and its permissions
boundary stay platform-owned on purpose, because the cap on what that identity may create
lives inside the `Role`.
Expand Down
24 changes: 24 additions & 0 deletions deploy/email/email-identity-mail-from-attributes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# A custom MAIL FROM domain for the company mail identity, so the envelope
# sender is under the mailbox domain and SPF aligns for DMARC. Its MX and SPF
# records are published by the DNS owner. Until they resolve, SES falls back to
# its own MAIL FROM domain (UseDefaultValue), so mail keeps flowing and DMARC
# still passes through the aligned DKIM signature.
apiVersion: sesv2.aws.m.upbound.io/v1beta1
kind: EmailIdentityMailFromAttributes
metadata:
name: company-mail-domain
annotations:
crossplane.io/external-name: devantler.tech
spec:
managementPolicies:
- Observe
- Create
- Update
- LateInitialize
forProvider:
region: eu-central-1
mailFromDomain: bounce.devantler.tech
behaviorOnMxFailure: UseDefaultValue
providerConfigRef:
kind: ProviderConfig
name: default
24 changes: 24 additions & 0 deletions deploy/email/email-identity.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# The company mail domain as an SES identity, verified by Easy DKIM. SES signs
# every relayed message with this domain's 2048-bit key; the three DKIM tokens
# appear in status.atProvider.dkimSigningAttributes.tokens and are published as
# CNAME records by the DNS owner. Delete is omitted so a prune can never
# remove the identity that outbound company mail depends on.
apiVersion: sesv2.aws.m.upbound.io/v1beta1
kind: EmailIdentity
metadata:
name: company-mail-domain
annotations:
crossplane.io/external-name: devantler.tech
spec:
managementPolicies:
- Observe
- Create
- Update
- LateInitialize
forProvider:
region: eu-central-1
dkimSigningAttributes:
nextSigningKeyLength: RSA_2048_BIT
providerConfigRef:
kind: ProviderConfig
name: default
13 changes: 13 additions & 0 deletions deploy/email/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Company Email's outbound relay (devantler-tech/platform#5481): the Amazon SES
# domain identity that signs relayed mail with Easy DKIM, and its custom MAIL
# FROM domain so SPF aligns with the mailbox domain for DMARC.
#
# This repository owns only these two SES resources, which grant no AWS
# permission to anyone. The SMTP sending identity (IAM user, policy and access
# key) is owned by devantler-tech/platform, for the same reason the EKS CI role
# is: what caps a credential must not be editable by this public artifact.
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- email-identity.yaml
- email-identity-mail-from-attributes.yaml
1 change: 1 addition & 0 deletions deploy/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- eks-ci/
- email/
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved

Loading