openshift how to add label to each new deployment automatically

9/27/2019

I want to add new label to each new deployment in openshift automatically.

Ex: Add label call appid to all new deployments in openshift cluster.

I think i should use "postStart" lifecycle.

-- Sulo Wijetunga
kubernetes
openshift

1 Answer

10/2/2019

You can configure the labels in the openshift template.

  apiVersion: apps.openshift.io/v1
  kind: DeploymentConfig
  metadata:
    labels:
      app: ${APP_LABEL}
      appid: ${APP_ID}
    name: ${APP_LABEL}
-- Arockiasmy K
Source: StackOverflow