Skip to content
This repository was archived by the owner on Dec 10, 2025. It is now read-only.

Commit 28bc505

Browse files
committed
Added multiple py modules to the aks package
1 parent 98d8170 commit 28bc505

4 files changed

Lines changed: 25 additions & 3 deletions

File tree

examples/aks-cluster/cluster-function-pythonic.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ spec:
3030
volumes:
3131
- name: composites
3232
configMap:
33-
name: pythonic-composites
33+
name: pythonic-aks
3434
serviceAccountTemplate:
3535
metadata:
3636
name: function-pythonic

examples/aks-cluster/composition.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ spec:
88
kind: AzureKubernetesCluster
99
mode: Pipeline
1010
pipeline:
11+
- step: create-resourcegroup
12+
functionRef:
13+
name: function-pythonic
14+
input:
15+
apiVersion: pythonic.fn.fortra.com/v1alpha1
16+
kind: Composite
17+
composite: resourcegroup.ResourceGroupComposite
1118
- step: create-aks-cluster
1219
functionRef:
1320
name: function-pythonic

examples/aks-cluster/kustomization.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ generatorOptions:
77
configMapGenerator:
88

99
- namespace: crossplane-system
10-
name: pythonic-composites
10+
name: pythonic-aks
1111
options:
1212
labels:
13-
function-pythonic.package: 'kubernetescluster.KubernetesClusterComposite'
13+
function-pythonic.package: 'aks'
1414
files:
1515
- kubernetescluster.py
16+
- resourcegroup.py
1617

1718
resources:
1819
- composition.yaml
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from crossplane.pythonic import BaseComposite
2+
3+
class ResourceGroupComposite(BaseComposite):
4+
def compose(self):
5+
labels = {'example.crossplane.io/AzureKubernetesCluster': self.metadata.name}
6+
self.logger.info(f"Composing Azure ResourceGroup {self.spec.resourceGroupName}")
7+
8+
rg = self.resources.ResourceGroup(
9+
'azure.upbound.io/v1beta1', 'ResourceGroup'
10+
)
11+
rg.metadata.name = self.spec.resourceGroupName
12+
rg.metadata.labels = labels
13+
14+
rg.spec.forProvider.location = self.spec.location

0 commit comments

Comments
 (0)