Skip to content

Instantly share code, notes, and snippets.

@binura-g
Created September 24, 2025 01:06
Show Gist options
  • Select an option

  • Save binura-g/5ce62ea53c46989623fd586459140e71 to your computer and use it in GitHub Desktop.

Select an option

Save binura-g/5ce62ea53c46989623fd586459140e71 to your computer and use it in GitHub Desktop.

Revisions

  1. binura-g created this gist Sep 24, 2025.
    58 changes: 58 additions & 0 deletions pe-crossplane-composition.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,58 @@
    apiVersion: apiextensions.crossplane.io/v1
    kind: Composition
    metadata:
    name: webapp
    spec:
    compositeTypeRef:
    apiVersion: platform.example.org/v1alpha1
    kind: WebApp
    resources:
    - name: deployment
    base:
    apiVersion: apps/v1
    kind: Deployment
    spec:
    selector:
    matchLabels:
    app: webapp
    template:
    metadata:
    labels:
    app: webapp
    spec:
    containers:
    - name: app
    image: nginx
    ports:
    - containerPort: 8080
    patches:
    - fromFieldPath: "spec.image"
    toFieldPath: "spec.template.spec.containers[0].image"
    - fromFieldPath: "spec.replicas"
    toFieldPath: "spec.replicas"

    - name: service
    base:
    apiVersion: v1
    kind: Service
    spec:
    selector:
    app: webapp
    ports:
    - port: 80
    targetPort: 8080

    - name: ingress
    base:
    apiVersion: networking.k8s.io/v1
    kind: Ingress
    spec:
    rules: []
    patches:
    - fromFieldPath: "spec.endpoints"
    toFieldPath: "spec.rules"
    transforms:
    - type: map
    map:
    host: "host"
    path: "path"