Skip to content

Commit 5066c94

Browse files
committed
fix: adding missing files
1 parent 41fa335 commit 5066c94

10 files changed

+490
-38
lines changed

addons/fluxcd/parameter.cue

+26
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,38 @@ parameter: {
99
onlyHelmComponents: *false | bool
1010
//+usage=advanced options for Helm Controller
1111
helmControllerOptions?: [...string]
12+
//+usage=advanced options for Helm Controller
13+
helmControllerResourceLimits?: {}
14+
//+usage=advanced options for Helm Controller
15+
helmControllerResourceRequests?: {}
1216
//+usage=advanced options for Source Controller
1317
sourceControllerOptions?: [...string]
18+
//+usage=advanced options for Source Controller
19+
sourceControllerResourceLimits?: {}
20+
//+usage=advanced options for Source Controller
21+
sourceControllerResourceRequests?: {}
1422
//+usage=advanced options for Kustomize Controller
1523
kustomizeControllerOptions?: [...string]
24+
//+usage=advanced options for Kustomize Controller
25+
kustomizeControllerResourceLimits?: {}
26+
//+usage=advanced options for Kustomize Controller
27+
kustomizeControllerResourceRequests?: {}
1628
//+usage=advanced options for Image Reflector Controller
1729
imageReflectorControllerOptions?: [...string]
30+
//+usage=advanced options for Image Reflector Controller
31+
imageReflectorControllerResourceLimits?: {}
32+
//+usage=advanced options for Image Reflector Controller
33+
imageReflectorControllerResourceRequests?: {}
1834
//+usage=advanced options for Image Automation Controller
1935
imageAutomationControllerOptions?: [...string]
36+
//+usage=advanced options for Image Automation Controller
37+
imageAutomationControllerResourceLimits?: {}
38+
//+usage=advanced options for Image Automation Controller
39+
imageAutomationControllerResourceRequests?: {}
40+
//+usage=advanced options for Notification Controller
41+
notificationControllerOptions?: [...string]
42+
//+usage=advanced options for Notification Controller
43+
notificationControllerResourceLimits?: {}
44+
//+usage=advanced options for Notification Controller
45+
notificationControllerResourceRequests?: {}
2046
}

addons/fluxcd/resources/components/args.cue

+4
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ controllerArgs: [
99
// Refer to #429 for details.
1010
// "--enable-leader-election",
1111
]
12+
13+
eventAddrArgs: controllerArgs + [
14+
"--events-addr=http://fluxcd-notification-controller" + "." + _targetNamespace + ".svc.cluster.local:9090",
15+
]

addons/fluxcd/resources/components/helm-controller.cue

+44-17
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,6 @@ _base: string
44
_rules: [...]
55
controllerArgs: [...]
66
_targetNamespace: string
7-
defaultResources: {
8-
limits: {
9-
cpu: parameter.helmControllerResourceLimits.cpu | *"1000m"
10-
memory: parameter.helmControllerResourceLimits.memory | *"1Gi"
11-
}
12-
requests: {
13-
cpu: parameter.helmControllerResourceRequests.cpu | *"100m"
14-
memory: parameter.helmControllerResourceRequests.memory | *"64Mi"
15-
}
16-
}
177

188
helmController: {
199
// About this name, refer to #429 for details.
@@ -29,12 +19,20 @@ helmController: {
2919
value: _targetNamespace
3020
},
3121
{
32-
name: "GOMAXPROCS"
33-
value: defaultResources.limits.cpu
22+
name: "GOMAXPROCS"
23+
valueFrom: {
24+
resourceFieldRef: {
25+
resource: "limits.cpu"
26+
}
27+
}
3428
},
3529
{
36-
name: "GOMEMLIMIT"
37-
value: defaultResources.limits.memory
30+
name: "GOMEMLIMIT"
31+
valueFrom: {
32+
resourceFieldRef: {
33+
resource: "limits.memory"
34+
}
35+
}
3836
}
3937
]
4038
livenessProbe: {
@@ -95,16 +93,45 @@ helmController: {
9593
},
9694
{
9795
type: "resource"
98-
properties: defaultResources
96+
properties: {
97+
limits: {
98+
if parameter.helmControllerResourceLimits.cpu != _|_ {
99+
cpu: parameter.helmControllerResourceLimits.cpu
100+
}
101+
if parameter.helmControllerResourceLimits.cpu == _|_ {
102+
cpu: deploymentResources.limits.cpu
103+
}
104+
if parameter.helmControllerResourceLimits.memory != _|_ {
105+
memory: parameter.helmControllerResourceLimits.memory
106+
}
107+
if parameter.helmControllerResourceLimits.memory == _|_ {
108+
memory: deploymentResources.limits.memory
109+
}
110+
}
111+
requests: {
112+
if parameter.helmControllerResourceRequests.cpu != _|_ {
113+
cpu: parameter.helmControllerResourceRequests.cpu
114+
}
115+
if parameter.helmControllerResourceRequests.cpu == _|_ {
116+
cpu: deploymentResources.requests.cpu
117+
}
118+
if parameter.helmControllerResourceRequests.memory != _|_ {
119+
memory: parameter.helmControllerResourceRequests.memory
120+
}
121+
if parameter.helmControllerResourceRequests.memory == _|_ {
122+
memory: deploymentResources.requests.memory
123+
}
124+
}
125+
}
99126
},
100127
{
101128
type: "command"
102129
properties: {
103130
if parameter.helmControllerOptions != _|_ {
104-
args: controllerArgs + parameter.helmControllerOptions
131+
args: eventAddrArgs + parameter.helmControllerOptions
105132
}
106133
if parameter.helmControllerOptions == _|_ {
107-
args: controllerArgs
134+
args: eventAddrArgs
108135
}
109136
}
110137
},

addons/fluxcd/resources/components/image-automation-controller.cue

+62-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ _base: string
44
_rules: [...]
55
controllerArgs: [...]
66
_targetNamespace: string
7+
// imageControllerDefaultArgs: controllerArgs + [
8+
// "--events-addr=" + "http://fluxcd-notification-controller." + _targetNamespace + ".svc:9090"
9+
// ]
710

811
imageAutomationController: {
912
// About this name, refer to #429 for details.
@@ -12,12 +15,28 @@ imageAutomationController: {
1215
dependsOn: ["fluxcd-ns"]
1316
properties: {
1417
imagePullPolicy: "IfNotPresent"
15-
image: _base + "fluxcd/image-automation-controller:v0.36.0"
18+
image: _base + "fluxcd/image-automation-controller:v0.39.0"
1619
env: [
1720
{
1821
name: "RUNTIME_NAMESPACE"
1922
value: _targetNamespace
2023
},
24+
{
25+
name: "GOMAXPROCS"
26+
valueFrom: {
27+
resourceFieldRef: {
28+
resource: "limits.cpu"
29+
}
30+
}
31+
},
32+
{
33+
name: "GOMEMLIMIT"
34+
valueFrom: {
35+
resourceFieldRef: {
36+
resource: "limits.memory"
37+
}
38+
}
39+
}
2140
]
2241
livenessProbe: {
2342
httpGet: {
@@ -68,14 +87,54 @@ imageAutomationController: {
6887
"app": "image-automation-controller"
6988
}
7089
},
90+
{
91+
type: "annotations"
92+
properties: {
93+
"prometheus.io/port": "8080"
94+
"prometheus.io/scrape": "true"
95+
}
96+
},
97+
{
98+
type: "resource"
99+
properties: {
100+
limits: {
101+
if parameter.imageAutomationControllerResourceLimits.cpu != _|_ {
102+
cpu: parameter.imageAutomationControllerResourceLimits.cpu
103+
}
104+
if parameter.imageAutomationControllerResourceLimits.cpu == _|_ {
105+
cpu: deploymentResources.limits.cpu
106+
}
107+
if parameter.imageAutomationControllerResourceLimits.memory != _|_ {
108+
memory: parameter.imageAutomationControllerResourceLimits.memory
109+
}
110+
if parameter.imageAutomationControllerResourceLimits.memory == _|_ {
111+
memory: deploymentResources.limits.memory
112+
}
113+
}
114+
requests: {
115+
if parameter.imageAutomationControllerResourceRequests.cpu != _|_ {
116+
cpu: parameter.imageAutomationControllerResourceRequests.cpu
117+
}
118+
if parameter.imageAutomationControllerResourceRequests.cpu == _|_ {
119+
cpu: deploymentResources.requests.cpu
120+
}
121+
if parameter.imageAutomationControllerResourceRequests.memory != _|_ {
122+
memory: parameter.imageAutomationControllerResourceRequests.memory
123+
}
124+
if parameter.imageAutomationControllerResourceRequests.memory == _|_ {
125+
memory: deploymentResources.requests.memory
126+
}
127+
}
128+
}
129+
},
71130
{
72131
type: "command"
73132
properties: {
74133
if parameter.imageAutomationControllerOptions != _|_ {
75-
args: controllerArgs + parameter.imageAutomationControllerOptions
134+
args: eventAddrArgs + parameter.imageAutomationControllerOptions
76135
}
77136
if parameter.imageAutomationControllerOptions == _|_ {
78-
args: controllerArgs
137+
args: eventAddrArgs
79138
}
80139
}
81140
},

addons/fluxcd/resources/components/image-reflector-controller.cue

+62-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ _base: string
44
_rules: [...]
55
controllerArgs: [...]
66
_targetNamespace: string
7+
// imageControllerDefaultArgs: controllerArgs + [
8+
// "--events-addr=" + "http://fluxcd-notification-controller." + _targetNamespace + ".svc:9090"
9+
// ]
710

811
imageReflectorController: {
912
// About this name, refer to #429 for details.
@@ -12,12 +15,28 @@ imageReflectorController: {
1215
dependsOn: ["fluxcd-ns"]
1316
properties: {
1417
imagePullPolicy: "IfNotPresent"
15-
image: _base + "fluxcd/image-reflector-controller:v0.30.0"
18+
image: _base + "fluxcd/image-reflector-controller:v0.33.0"
1619
env: [
1720
{
1821
name: "RUNTIME_NAMESPACE"
1922
value: _targetNamespace
2023
},
24+
{
25+
name: "GOMAXPROCS"
26+
valueFrom: {
27+
resourceFieldRef: {
28+
resource: "limits.cpu"
29+
}
30+
}
31+
},
32+
{
33+
name: "GOMEMLIMIT"
34+
valueFrom: {
35+
resourceFieldRef: {
36+
resource: "limits.memory"
37+
}
38+
}
39+
}
2140
]
2241
livenessProbe: {
2342
httpGet: {
@@ -72,14 +91,54 @@ imageReflectorController: {
7291
"app": "image-reflector-controller"
7392
}
7493
},
94+
{
95+
type: "annotations"
96+
properties: {
97+
"prometheus.io/port": "8080"
98+
"prometheus.io/scrape": "true"
99+
}
100+
},
101+
{
102+
type: "resource"
103+
properties: {
104+
limits: {
105+
if parameter.imageReflectorControllerResourceLimits.cpu != _|_ {
106+
cpu: parameter.imageReflectorControllerResourceLimits.cpu
107+
}
108+
if parameter.imageReflectorControllerResourceLimits.cpu == _|_ {
109+
cpu: deploymentResources.limits.cpu
110+
}
111+
if parameter.imageReflectorControllerResourceLimits.memory != _|_ {
112+
memory: parameter.imageReflectorControllerResourceLimits.memory
113+
}
114+
if parameter.imageReflectorControllerResourceLimits.memory == _|_ {
115+
memory: deploymentResources.limits.memory
116+
}
117+
}
118+
requests: {
119+
if parameter.imageReflectorControllerResourceRequests.cpu != _|_ {
120+
cpu: parameter.imageReflectorControllerResourceRequests.cpu
121+
}
122+
if parameter.imageReflectorControllerResourceRequests.cpu == _|_ {
123+
cpu: deploymentResources.requests.cpu
124+
}
125+
if parameter.imageReflectorControllerResourceRequests.memory != _|_ {
126+
memory: parameter.imageReflectorControllerResourceRequests.memory
127+
}
128+
if parameter.imageReflectorControllerResourceRequests.memory == _|_ {
129+
memory: deploymentResources.requests.memory
130+
}
131+
}
132+
}
133+
},
75134
{
76135
type: "command"
77136
properties: {
78137
if parameter.imageReflectorControllerOptions != _|_ {
79-
args: controllerArgs + parameter.imageReflectorControllerOptions
138+
args: eventAddrArgs + parameter.imageReflectorControllerOptions
80139
}
81140
if parameter.imageReflectorControllerOptions == _|_ {
82-
args: controllerArgs
141+
args: eventAddrArgs
83142
}
84143
}
85144
},

0 commit comments

Comments
 (0)