Reputation: 2823
I'm sharing the same cluster for 2 namespaces: staging and production. The only differences among the two namespaces are:
I have managed to address (2) and (3) as follows, so as to maintain a single YAML file for all ReplicationControllers:
However, I'm unable to find a satisfactory way to have a reference for a gcePersistentDisk's pdName - I can't seem to use a ConfigMap, hence a little stumped. What would be the appropriate way to go about this? The best alternative seems to be to maintain 2 separate YAML files with different strings, but this has a code-smell as it is violating DRY.
Also, any constructive commentary on the rest of my setup as mentioned above is highly appreciated :-)
Upvotes: 7
Views: 1904
Reputation: 1316
You could probably create one PersistentVolumeClaim in each namespace. Take a look at Can a PVC be bound to a specific PV? on how to "pre-bind" PersistentVolumes to PersistentVolumeClaims.
Might not be an ideal solution but it probably works 'till PVCs support label selectors.
Upvotes: 2