Skip to content

Commit

Permalink
fix: adding missing files
Browse files Browse the repository at this point in the history
  • Loading branch information
bugbuilder committed Nov 28, 2024
1 parent 41fa335 commit 5066c94
Show file tree
Hide file tree
Showing 10 changed files with 490 additions and 38 deletions.
26 changes: 26 additions & 0 deletions addons/fluxcd/parameter.cue
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,38 @@ parameter: {
onlyHelmComponents: *false | bool
//+usage=advanced options for Helm Controller
helmControllerOptions?: [...string]
//+usage=advanced options for Helm Controller
helmControllerResourceLimits?: {}
//+usage=advanced options for Helm Controller
helmControllerResourceRequests?: {}
//+usage=advanced options for Source Controller
sourceControllerOptions?: [...string]
//+usage=advanced options for Source Controller
sourceControllerResourceLimits?: {}
//+usage=advanced options for Source Controller
sourceControllerResourceRequests?: {}
//+usage=advanced options for Kustomize Controller
kustomizeControllerOptions?: [...string]
//+usage=advanced options for Kustomize Controller
kustomizeControllerResourceLimits?: {}
//+usage=advanced options for Kustomize Controller
kustomizeControllerResourceRequests?: {}
//+usage=advanced options for Image Reflector Controller
imageReflectorControllerOptions?: [...string]
//+usage=advanced options for Image Reflector Controller
imageReflectorControllerResourceLimits?: {}
//+usage=advanced options for Image Reflector Controller
imageReflectorControllerResourceRequests?: {}
//+usage=advanced options for Image Automation Controller
imageAutomationControllerOptions?: [...string]
//+usage=advanced options for Image Automation Controller
imageAutomationControllerResourceLimits?: {}
//+usage=advanced options for Image Automation Controller
imageAutomationControllerResourceRequests?: {}
//+usage=advanced options for Notification Controller
notificationControllerOptions?: [...string]
//+usage=advanced options for Notification Controller
notificationControllerResourceLimits?: {}
//+usage=advanced options for Notification Controller
notificationControllerResourceRequests?: {}
}
4 changes: 4 additions & 0 deletions addons/fluxcd/resources/components/args.cue
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ controllerArgs: [
// Refer to #429 for details.
// "--enable-leader-election",
]

eventAddrArgs: controllerArgs + [
"--events-addr=http://fluxcd-notification-controller" + "." + _targetNamespace + ".svc.cluster.local:9090",
]
61 changes: 44 additions & 17 deletions addons/fluxcd/resources/components/helm-controller.cue
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,6 @@ _base: string
_rules: [...]
controllerArgs: [...]
_targetNamespace: string
defaultResources: {
limits: {
cpu: parameter.helmControllerResourceLimits.cpu | *"1000m"
memory: parameter.helmControllerResourceLimits.memory | *"1Gi"
}
requests: {
cpu: parameter.helmControllerResourceRequests.cpu | *"100m"
memory: parameter.helmControllerResourceRequests.memory | *"64Mi"
}
}

helmController: {
// About this name, refer to #429 for details.
Expand All @@ -29,12 +19,20 @@ helmController: {
value: _targetNamespace
},
{
name: "GOMAXPROCS"
value: defaultResources.limits.cpu
name: "GOMAXPROCS"
valueFrom: {
resourceFieldRef: {
resource: "limits.cpu"
}
}
},
{
name: "GOMEMLIMIT"
value: defaultResources.limits.memory
name: "GOMEMLIMIT"
valueFrom: {
resourceFieldRef: {
resource: "limits.memory"
}
}
}
]
livenessProbe: {
Expand Down Expand Up @@ -95,16 +93,45 @@ helmController: {
},
{
type: "resource"
properties: defaultResources
properties: {
limits: {
if parameter.helmControllerResourceLimits.cpu != _|_ {
cpu: parameter.helmControllerResourceLimits.cpu
}
if parameter.helmControllerResourceLimits.cpu == _|_ {
cpu: deploymentResources.limits.cpu
}
if parameter.helmControllerResourceLimits.memory != _|_ {
memory: parameter.helmControllerResourceLimits.memory
}
if parameter.helmControllerResourceLimits.memory == _|_ {
memory: deploymentResources.limits.memory
}
}
requests: {
if parameter.helmControllerResourceRequests.cpu != _|_ {
cpu: parameter.helmControllerResourceRequests.cpu
}
if parameter.helmControllerResourceRequests.cpu == _|_ {
cpu: deploymentResources.requests.cpu
}
if parameter.helmControllerResourceRequests.memory != _|_ {
memory: parameter.helmControllerResourceRequests.memory
}
if parameter.helmControllerResourceRequests.memory == _|_ {
memory: deploymentResources.requests.memory
}
}
}
},
{
type: "command"
properties: {
if parameter.helmControllerOptions != _|_ {
args: controllerArgs + parameter.helmControllerOptions
args: eventAddrArgs + parameter.helmControllerOptions
}
if parameter.helmControllerOptions == _|_ {
args: controllerArgs
args: eventAddrArgs
}
}
},
Expand Down
65 changes: 62 additions & 3 deletions addons/fluxcd/resources/components/image-automation-controller.cue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ _base: string
_rules: [...]
controllerArgs: [...]
_targetNamespace: string
// imageControllerDefaultArgs: controllerArgs + [
// "--events-addr=" + "http://fluxcd-notification-controller." + _targetNamespace + ".svc:9090"
// ]

imageAutomationController: {
// About this name, refer to #429 for details.
Expand All @@ -12,12 +15,28 @@ imageAutomationController: {
dependsOn: ["fluxcd-ns"]
properties: {
imagePullPolicy: "IfNotPresent"
image: _base + "fluxcd/image-automation-controller:v0.36.0"
image: _base + "fluxcd/image-automation-controller:v0.39.0"
env: [
{
name: "RUNTIME_NAMESPACE"
value: _targetNamespace
},
{
name: "GOMAXPROCS"
valueFrom: {
resourceFieldRef: {
resource: "limits.cpu"
}
}
},
{
name: "GOMEMLIMIT"
valueFrom: {
resourceFieldRef: {
resource: "limits.memory"
}
}
}
]
livenessProbe: {
httpGet: {
Expand Down Expand Up @@ -68,14 +87,54 @@ imageAutomationController: {
"app": "image-automation-controller"
}
},
{
type: "annotations"
properties: {
"prometheus.io/port": "8080"
"prometheus.io/scrape": "true"
}
},
{
type: "resource"
properties: {
limits: {
if parameter.imageAutomationControllerResourceLimits.cpu != _|_ {
cpu: parameter.imageAutomationControllerResourceLimits.cpu
}
if parameter.imageAutomationControllerResourceLimits.cpu == _|_ {
cpu: deploymentResources.limits.cpu
}
if parameter.imageAutomationControllerResourceLimits.memory != _|_ {
memory: parameter.imageAutomationControllerResourceLimits.memory
}
if parameter.imageAutomationControllerResourceLimits.memory == _|_ {
memory: deploymentResources.limits.memory
}
}
requests: {
if parameter.imageAutomationControllerResourceRequests.cpu != _|_ {
cpu: parameter.imageAutomationControllerResourceRequests.cpu
}
if parameter.imageAutomationControllerResourceRequests.cpu == _|_ {
cpu: deploymentResources.requests.cpu
}
if parameter.imageAutomationControllerResourceRequests.memory != _|_ {
memory: parameter.imageAutomationControllerResourceRequests.memory
}
if parameter.imageAutomationControllerResourceRequests.memory == _|_ {
memory: deploymentResources.requests.memory
}
}
}
},
{
type: "command"
properties: {
if parameter.imageAutomationControllerOptions != _|_ {
args: controllerArgs + parameter.imageAutomationControllerOptions
args: eventAddrArgs + parameter.imageAutomationControllerOptions
}
if parameter.imageAutomationControllerOptions == _|_ {
args: controllerArgs
args: eventAddrArgs
}
}
},
Expand Down
65 changes: 62 additions & 3 deletions addons/fluxcd/resources/components/image-reflector-controller.cue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ _base: string
_rules: [...]
controllerArgs: [...]
_targetNamespace: string
// imageControllerDefaultArgs: controllerArgs + [
// "--events-addr=" + "http://fluxcd-notification-controller." + _targetNamespace + ".svc:9090"
// ]

imageReflectorController: {
// About this name, refer to #429 for details.
Expand All @@ -12,12 +15,28 @@ imageReflectorController: {
dependsOn: ["fluxcd-ns"]
properties: {
imagePullPolicy: "IfNotPresent"
image: _base + "fluxcd/image-reflector-controller:v0.30.0"
image: _base + "fluxcd/image-reflector-controller:v0.33.0"
env: [
{
name: "RUNTIME_NAMESPACE"
value: _targetNamespace
},
{
name: "GOMAXPROCS"
valueFrom: {
resourceFieldRef: {
resource: "limits.cpu"
}
}
},
{
name: "GOMEMLIMIT"
valueFrom: {
resourceFieldRef: {
resource: "limits.memory"
}
}
}
]
livenessProbe: {
httpGet: {
Expand Down Expand Up @@ -72,14 +91,54 @@ imageReflectorController: {
"app": "image-reflector-controller"
}
},
{
type: "annotations"
properties: {
"prometheus.io/port": "8080"
"prometheus.io/scrape": "true"
}
},
{
type: "resource"
properties: {
limits: {
if parameter.imageReflectorControllerResourceLimits.cpu != _|_ {
cpu: parameter.imageReflectorControllerResourceLimits.cpu
}
if parameter.imageReflectorControllerResourceLimits.cpu == _|_ {
cpu: deploymentResources.limits.cpu
}
if parameter.imageReflectorControllerResourceLimits.memory != _|_ {
memory: parameter.imageReflectorControllerResourceLimits.memory
}
if parameter.imageReflectorControllerResourceLimits.memory == _|_ {
memory: deploymentResources.limits.memory
}
}
requests: {
if parameter.imageReflectorControllerResourceRequests.cpu != _|_ {
cpu: parameter.imageReflectorControllerResourceRequests.cpu
}
if parameter.imageReflectorControllerResourceRequests.cpu == _|_ {
cpu: deploymentResources.requests.cpu
}
if parameter.imageReflectorControllerResourceRequests.memory != _|_ {
memory: parameter.imageReflectorControllerResourceRequests.memory
}
if parameter.imageReflectorControllerResourceRequests.memory == _|_ {
memory: deploymentResources.requests.memory
}
}
}
},
{
type: "command"
properties: {
if parameter.imageReflectorControllerOptions != _|_ {
args: controllerArgs + parameter.imageReflectorControllerOptions
args: eventAddrArgs + parameter.imageReflectorControllerOptions
}
if parameter.imageReflectorControllerOptions == _|_ {
args: controllerArgs
args: eventAddrArgs
}
}
},
Expand Down
Loading

0 comments on commit 5066c94

Please sign in to comment.