generated from crossplane/function-template-go
-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathcomposition-k8s.yaml
More file actions
69 lines (69 loc) · 1.9 KB
/
composition-k8s.yaml
File metadata and controls
69 lines (69 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
apiVersion: apiextensions.crossplane.io/v1
kind: Composition
metadata:
name: example-k8s-resources
spec:
compositeTypeRef:
apiVersion: example.crossplane.io/v1
kind: XR
mode: Pipeline
pipeline:
- step: create-k8s-resources
functionRef:
name: function-go-templating
input:
apiVersion: gotemplating.fn.crossplane.io/v1beta1
kind: GoTemplate
source: Inline
inline:
template: |
---
apiVersion: v1
kind: Service
metadata:
name: example-service
annotations:
gotemplating.fn.crossplane.io/composition-resource-name: service
spec:
type: ClusterIP
selector:
app: example
ports:
- port: 80
targetPort: 8080
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: example-deployment
annotations:
gotemplating.fn.crossplane.io/composition-resource-name: deployment
spec:
replicas: 3
selector:
matchLabels:
app: example
template:
metadata:
labels:
app: example
spec:
containers:
- name: app
image: nginx:latest
ports:
- containerPort: 8080
---
apiVersion: v1
kind: ConfigMap
metadata:
name: example-config
annotations:
gotemplating.fn.crossplane.io/composition-resource-name: config
data:
config.yaml: |
key: value
# This function will automatically detect readiness using resource-specific health checks
- step: automatically-detect-ready-composed-resources
functionRef:
name: function-auto-ready