Skip to content

Instantly share code, notes, and snippets.

echo "==> Set variables..."
export REGISTRY_URL="${AWS_ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com/${REPOSITORY_NAME}/${IMAGE_NAME}"
export HELM_EXPERIMENTAL_OCI=1
echo "==> Login to ecr..."
aws ecr get-login-password --region ${AWS_REGION} | docker login --username AWS --password-stdin ${REGISTRY_URL}
echo "==> Create and deploy xpkg..."
cd compositions
kubectl crossplane build configuration --name ${IMAGE_NAME}
kubectl crossplane push configuration ${REGISTRY_URL}:${IMAGE_TAG}
@haarchri
haarchri / efs-composition.yaml
Created July 29, 2021 10:47
crossplane-composition-efs
---
apiVersion: apiextensions.crossplane.io/v1
kind: Composition
metadata:
name: example-efs
spec:
writeConnectionSecretsToNamespace: crossplane-system
compositeTypeRef:
apiVersion: platform.example.intern/v1alpha1
kind: Efs
group: kms.aws.devops.cloud
name: Key
version: v1alpha1
crd: ./.work/provider-aws/package/crds/kms.aws.crossplane.io_keys.yaml
ignore: true
compositions:
- name: key
provider: sop
default: true
apiVersion: apiextensions.crossplane.io/v1
kind: Composition
metadata:
name: eks.aws.example.com
labels:
provider: aws
spec:
writeConnectionSecretsToNamespace: crossplane-system
compositeTypeRef:
apiVersion: aws.example.com/v1alpha1
@haarchri
haarchri / aws-provider-111111111111.yaml
Last active December 17, 2021 09:47
v0.22.0-stsAssumeRole
---
apiVersion: aws.crossplane.io/v1beta1
kind: ProviderConfig
metadata:
name: aws-provider-111111111111
spec:
credentials:
source: InjectedIdentity
@haarchri
haarchri / aws-auth.yaml
Created December 14, 2021 11:25
crossplane composition aws-auth
[...]
- name: aws-auth-configmap
base:
apiVersion: kubernetes.crossplane.io/v1alpha1
kind: Object
spec:
forProvider:
manifest:
apiVersion: v1
kind: ConfigMap
apiVersion: source.toolkit.fluxcd.io/v1beta1
kind: GitRepository
metadata:
name: flux-system
namespace: flux-system
spec:
interval: 1m
url: https://github.com/fluxcd/flux2-kustomize-helm-example.git
ref:
branch: main
@haarchri
haarchri / iam.yaml
Created October 28, 2021 21:36
s3-bucket-lambda
---
apiVersion: identity.aws.crossplane.io/v1beta1
kind: IAMRole
metadata:
name: lambda-exec-role
spec:
forProvider:
description: role for lambda execution
assumeRolePolicyDocument: |
{