Skip to content

Commit 53fff6c

Browse files
committed
feat(controller): add annotations support
1 parent 3a6a4c1 commit 53fff6c

3 files changed

Lines changed: 12 additions & 1 deletion

File tree

rootfs/api/models/app.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,6 +1162,7 @@ def _gather_app_settings(self, release, app_settings, process_type, replicas, vo
11621162
'app_type': process_type,
11631163
'resources': json.loads(settings.KUBERNETES_POD_DEFAULT_RESOURCES),
11641164
'build_type': release.build.type,
1165+
'annotations': json.loads(settings.KUBERNETES_POD_DEFAULT_ANNOTATIONS),
11651166
'healthcheck': healthcheck,
11661167
'lifecycle_post_start': config.lifecycle_post_start,
11671168
'lifecycle_pre_stop': config.lifecycle_pre_stop,

rootfs/api/settings/production.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,15 @@
368368
}
369369
})
370370
)
371+
372+
# Default pod annotations for application.
373+
KUBERNETES_POD_DEFAULT_ANNOTATIONS = os.environ.get(
374+
'KUBERNETES_POD_DEFAULT_ANNOTATIONS',
375+
json.dumps({
376+
"kubernetes.io/egress-bandwidth": "100M",
377+
"kubernetes.io/igress-bandwidth": "100M",
378+
})
379+
)
371380
# Default quota spec for application namespace
372381
KUBERNETES_NAMESPACE_DEFAULT_QUOTA_SPEC = os.environ.get(
373382
'KUBERNETES_NAMESPACE_DEFAULT_QUOTA_SPEC', ''

rootfs/scheduler/resources/pod.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ def manifest(self, namespace, name, image, **kwargs):
115115
'metadata': {
116116
'name': name,
117117
'namespace': namespace,
118-
'labels': labels
118+
'labels': labels,
119+
'annotations': kwargs.get('annotations', {}),
119120
},
120121
'spec': {}
121122
}

0 commit comments

Comments
 (0)