You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Gregory Nickonov edited this page Mar 1, 2019
·
1 revision
Sometimes (very often, actually) you have to declare several resources with the same name and repetition of the same resource name over and over again makes code look messy and not DRY. Scope is the answer to the problem - in the defined scope you can omit resource name in declarations and the scope name will be used instead:
The code above will define ConfigMap with the name frontend, label application and value BACKEND_URL. It will also define a Deployment with the same name, that uses an image, defined in the values file and use environment variables, defined as values of the ConfigMap with the same name as a Deployment. Clear and DRY!