forked from cloud-ark/kubeplus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wordpress-service-composition.yaml
59 lines (59 loc) · 2.25 KB
/
wordpress-service-composition.yaml
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
apiVersion: workflows.kubeplus/v1alpha1
kind: ResourceComposition
metadata:
name: wordpress-service-composition
spec:
# newResource defines the new CRD to be installed define a workflow.
newResource:
resource:
kind: WordpressService
group: platformapi.kubeplus
version: v1alpha1
plural: wordpressservices
# URL of the Helm chart that contains Kubernetes resources that represent a workflow.
chartURL: https://github.com/cloud-ark/k8s-workshop/blob/master/wordpress-deployment-chart/wordpress-chart-0.0.3.tgz?raw=true
chartName: wordpress-chart
# respolicy defines the resource policy to be applied to instances of the specified custom resource.
respolicy:
apiVersion: workflows.kubeplus/v1alpha1
kind: ResourcePolicy
metadata:
name: wordpress-service-policy
spec:
resource:
kind: WordpressService
group: platformapi.kubeplus
version: v1alpha1
policy:
# Add following requests and limits for the first container of all the Pods that are related via
# owner reference relationship to instances of resources specified above.
podconfig:
limits:
cpu: 200m
memory: 2Gi
requests:
cpu: 100m
memory: 1Gi
nodeSelector: values.nodeName
quota:
requests.cpu: 100m
requests.memory: 1Gi
limits.cpu: 200m
limits.memory: 2Gi
# resmonitor identifies the resource instances that should be monitored for CPU/Memory/Storage.
# All the Pods that are related to the resource instance through either ownerReference relationship, or all the relationships
# (ownerReference, label, annotation, spec properties) are considered in calculating the statistics.
# The generated output is in Prometheus format.
resmonitor:
apiVersion: workflows.kubeplus/v1alpha1
kind: ResourceMonitor
metadata:
name: wordpress-service-monitor
spec:
resource:
kind: WordpressService
group: platformapi.kubeplus
version: v1alpha1
# This attribute indicates that Pods that are reachable through all the relationships should be used
# as part of calculating the monitoring statistics.
monitorRelationships: all