Skip to content

Commit cba1bea

Browse files
authored
Merge pull request #60 from akartsky/namespace_scope
Namespace scope service controllers
2 parents d63e230 + 7e7aff2 commit cba1bea

File tree

5 files changed

+11
-1
lines changed

5 files changed

+11
-1
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/aws-controllers-k8s/code-generator
33
go 1.14
44

55
require (
6-
github.com/aws-controllers-k8s/runtime v0.1.0
6+
github.com/aws-controllers-k8s/runtime v0.2.0
77
github.com/aws/aws-sdk-go v1.37.4
88
github.com/dlclark/regexp2 v1.4.0
99
// pin to v0.1.1 due to release problem with v0.1.2

templates/cmd/controller/main.go.tpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ func main() {
5454
MetricsBindAddress: ackCfg.MetricsAddr,
5555
LeaderElection: ackCfg.EnableLeaderElection,
5656
LeaderElectionID: awsServiceAPIGroup,
57+
Namespace: ackCfg.WatchNamespace,
5758
})
5859
if err != nil {
5960
setupLog.Error(

templates/config/controller/deployment.yaml.tpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ spec:
3636
- "$(ACK_LOG_LEVEL)"
3737
- --resource-tags
3838
- "$(ACK_RESOURCE_TAGS)"
39+
- --watch-namespace
40+
- "$(ACK_WATCH_NAMESPACE)"
3941
image: controller:latest
4042
name: controller
4143
ports:

templates/helm/templates/deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ spec:
4747
- "$(ACK_LOG_LEVEL)"
4848
- --resource-tags
4949
- "$(ACK_RESOURCE_TAGS)"
50+
- --watch-namespace
51+
- "$(ACK_WATCH_NAMESPACE)"
5052
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
5153
name: controller
5254
ports:
@@ -60,6 +62,8 @@ spec:
6062
fieldPath: metadata.namespace
6163
- name: AWS_REGION
6264
value: {{ .Values.aws.region }}
65+
- name: ACK_WATCH_NAMESPACE
66+
value: {{ .Values.watchNamespace }}
6367
- name: ACK_RESOURCE_TAGS
6468
value: {{ join "," .Values.resourceTags | quote }}
6569
terminationGracePeriodSeconds: 10

templates/helm/values.yaml.tpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ aws:
2828
# If specified, use the AWS region for AWS API calls
2929
region: ""
3030

31+
# If specified, the service controller will watch for object creation only in the provided namespace
32+
watchNamespace: ""
33+
3134
resourceTags:
3235
# Configures the ACK service controller to always set key/value pairs tags on resources that it manages.
3336
- services.k8s.aws/managed=true

0 commit comments

Comments
 (0)