Skip to content

Commit e4f3cda

Browse files
authored
helm chart: add log and accountid (#69)
Issue #, if available: aws-controllers-k8s/community#787 Tested using sagemaker-controller ``` k get pods -n ack-system -ojson "spec": { "containers": [ { "args": [ "--aws-account-id", "$(AWS_ACCOUNT_ID)", "--aws-region", "$(AWS_REGION)", "--enable-development-logging", "$(ACK_ENABLE_DEVELOPMENT_LOGGING)", "--log-level", "$(ACK_LOG_LEVEL)", "--resource-tags", "$(ACK_RESOURCE_TAGS)", "--watch-namespace", "$(ACK_WATCH_NAMESPACE)" ], "command": [ "./bin/controller" ], "env": [ { "name": "K8S_NAMESPACE", "valueFrom": { "fieldRef": { "apiVersion": "v1", "fieldPath": "metadata.namespace" } } }, { "name": "AWS_ACCOUNT_ID", "value": "xxx" }, { "name": "AWS_REGION", "value": "us-west-2" }, { "name": "ACK_WATCH_NAMESPACE" }, { "name": "ACK_ENABLE_DEVELOPMENT_LOGGING", "value": "true" }, { "name": "ACK_LOG_LEVEL", "value": "INFO" }, { "name": "ACK_RESOURCE_TAGS", "value": "services.k8s.aws/managed=true,services.k8s.aws/created=%UTCNOW%,services.k8s.aws/namespace=%KUBERNETES_NAMESPACE%" }, { "name": "AWS_ROLE_ARN", "value": "arn:aws:iam::xxx:role/ack-sage-role-ack-bug-bash-may18" }, { "name": "AWS_WEB_IDENTITY_TOKEN_FILE", "value": "/var/run/secrets/eks.amazonaws.com/serviceaccount/token" } ], ``` By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent ad3bd3d commit e4f3cda

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,4 @@ require (
1717
github.com/stretchr/testify v1.7.0
1818
golang.org/x/mod v0.4.1
1919
k8s.io/apimachinery v0.20.1
20-
k8s.io/utils v0.0.0-20201110183641-67b214c5f920
2120
)

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV
6161
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
6262
github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
6363
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
64-
github.com/aws-controllers-k8s/runtime v0.1.0 h1:XTBQf7hn0792yuCRy58IZpbZoGMrGCpSK2mZXkof5W4=
65-
github.com/aws-controllers-k8s/runtime v0.1.0/go.mod h1:xA2F18PJerBHaqrS4de1lpP7skeSMeStkmh+3x5sWvw=
64+
github.com/aws-controllers-k8s/runtime v0.2.0 h1:gd0Kq8xGelgkZoNjr8yZbHfpvPA1R+wfMCi1lT4H8x4=
65+
github.com/aws-controllers-k8s/runtime v0.2.0/go.mod h1:xA2F18PJerBHaqrS4de1lpP7skeSMeStkmh+3x5sWvw=
6666
github.com/aws/aws-sdk-go v1.37.4 h1:tWxrpMK/oRSXVnjUzhGeCWLR00fW0WF4V4sycYPPrJ8=
6767
github.com/aws/aws-sdk-go v1.37.4/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
6868
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=

templates/helm/templates/deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,16 @@ spec:
6060
valueFrom:
6161
fieldRef:
6262
fieldPath: metadata.namespace
63+
- name: AWS_ACCOUNT_ID
64+
value: {{ .Values.aws.account_id | quote }}
6365
- name: AWS_REGION
6466
value: {{ .Values.aws.region }}
6567
- name: ACK_WATCH_NAMESPACE
6668
value: {{ .Values.watchNamespace }}
69+
- name: ACK_ENABLE_DEVELOPMENT_LOGGING
70+
value: {{ .Values.log.enable_development_logging | quote }}
71+
- name: ACK_LOG_LEVEL
72+
value: {{ .Values.log.level | quote }}
6773
- name: ACK_RESOURCE_TAGS
6874
value: {{ join "," .Values.resourceTags | quote }}
6975
terminationGracePeriodSeconds: 10

templates/helm/values.yaml.tpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ resources:
2727
aws:
2828
# If specified, use the AWS region for AWS API calls
2929
region: ""
30+
account_id: ""
31+
32+
# log level for the controller
33+
log:
34+
enable_development_logging: false
35+
level: info
3036

3137
# If specified, the service controller will watch for object creation only in the provided namespace
3238
watchNamespace: ""

0 commit comments

Comments
 (0)