Skip to content

stuttgart-things/crossplane

Repository files navigation

stuttart-things/crossplane

crossplane configurations, apis and examples

DEV KIND CLUSTER DEPLOYMENT & CONFIGURATION OF CROSSPLANE

CREATE KIND CLUSTER
export TASK_X_REMOTE_TASKFILES=1
task --taskfile https://raw.githubusercontent.com/stuttgart-things/tasks/refs/heads/main/kubernetes/kind.yaml create-kind-cluster
task --taskfile https://raw.githubusercontent.com/stuttgart-things/tasks/refs/heads/main/kubernetes/crds.yaml kubectl-kustomize #apply+cilium
task --taskfile https://raw.githubusercontent.com/stuttgart-things/tasks/refs/heads/main/kubernetes/helm.yaml helmfile-operation #apply+cilium
CROSSPLANE DEPLOYMENT w/ DAGGER/HELMFILE
# BY TASKFILE
export TASK_X_REMOTE_TASKFILES=1
task --taskfile https://raw.githubusercontent.com/stuttgart-things/tasks/refs/heads/main/kubernetes/helm.yaml helmfile-operation #capply+crossplane
# OR BY DIRECT DAGGER CALL
dagger call -m github.com/stuttgart-things/dagger/[email protected] helmfile-operation \
  --helmfile-ref "git::https://github.com/stuttgart-things/helm.git@cicd/crossplane.yaml.gotmpl" \
  --operation apply \
  --state-values "version=2.1.3" \
  --kube-config file:///home/sthings/.kube/config \
  --progress plain -vv
ADD LOCAL CLUSTER AS KUBERNETES PROVIDER (FILEBASED)
NAMESPACE="crossplane-system"
KUBECONFIG_DIR="$HOME/.kube"

# Select kubeconfig file
KUBECONFIG_FILE=$(ls -1 "$KUBECONFIG_DIR" \
  | gum choose --header "Select kubeconfig file")

KUBECONFIG_PATH="$KUBECONFIG_DIR/$KUBECONFIG_FILE"

# Secret name
SECRET_NAME=$(gum input \
  --prompt "Secret name: " \
  --value "dev")

# Create or update secret (idempotent)
kubectl -n "$NAMESPACE" create secret generic "$SECRET_NAME" \
  --from-file=config="$KUBECONFIG_PATH" \
  --dry-run=client -o yaml \
  | kubectl apply -f -
NAMESPACE="crossplane-system"

CONFIG_NAME=$(gum input \
  --prompt "ClusterProviderConfig name: " \
  --value "dev")

SECRET_NAME=$(kubectl get secret -n "$NAMESPACE" \
  -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}' \
  | gum choose --header "Select secret")

SECRET_KEY=$(kubectl get secret "$SECRET_NAME" -n "$NAMESPACE" \
  -o json \
  | jq -r '.data | keys[]' \
  | gum choose --header "Select key from secret '$SECRET_NAME'")

if ! gum confirm "Apply ClusterProviderConfig '$CONFIG_NAME' using $SECRET_NAME:$SECRET_KEY?"; then
  echo "Aborted."
  exit 0
fi

kubectl apply -f - <<EOF
apiVersion: kubernetes.m.crossplane.io/v1alpha1
kind: ClusterProviderConfig
metadata:
  name: $CONFIG_NAME
spec:
  credentials:
    source: Secret
    secretRef:
      namespace: $NAMESPACE
      name: $SECRET_NAME
      key: $SECRET_KEY
EOF
APPLY CROSSPLANE PACKAGES
# BY TASKFILE
export TASK_X_REMOTE_TASKFILES=1
task --taskfile https://raw.githubusercontent.com/stuttgart-things/crossplane/refs/heads/main/Taskfile.yaml apply-crossplane-packages
APPLY CROSSPLANE PACKAGES
# BY TASKFILE
export TASK_X_REMOTE_TASKFILES=1
task --taskfile https://raw.githubusercontent.com/stuttgart-things/crossplane/refs/heads/main/Taskfile.yaml apply-crossplane-packages

CONFIGURATIONS

ANSIBLE-RUN
cat <<EOF | kubectl apply -f -
apiVersion: pkg.crossplane.io/v1
kind: Configuration
metadata:
  name: ansible-run
spec:
  package: ghcr.io/stuttgart-things/crossplane/ansible-run:11.0.0
EOF

DEVELOPMENT

Quick Start

# Setup standardized development environment
source .container-use/container-use.sh
cu-setup

# Access development environment
container-use checkout crossplane-development

# Test existing configurations
cu-test-vcluster
cu-test-ansible-run
cu-test-all

Development Standards

This repository follows structured development specifications:

Workflow Automation

Standardized tasks for environment management:

# Interactive environment merge
task merge-environment

# Direct environment merge
task merge-environment-auto ENV_ID=your-env-id

# Pull request workflow
task merge-environment-pr

# View all available tasks
task do

Quick Specification Access

# Load helper functions
source .container-use/container-use.sh

# View specifications
cu-spec                           # Show available specs
cu-new my-config apps            # Create new config with guidance

Available Tasks

task: Available tasks for this project:
* branch:                    Create branch from main
* check:                     Run pre-commit hooks
* commit:                    Commit + push code into branch
* do:                        Select a task to run
* pr:                        Create pull request into main
* run-pre-commit-hook:       Run the pre-commit hook script to replace .example.com with .example.com
* xplane-push:               Push crossplane package

About

crossplane configurations, apis and examples

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •