Name pg pod in a more unique way

- this is to make it possible to run migration with multiple deployments in the same pod
This commit is contained in:
Christian M. Adams
2021-03-24 13:37:32 -04:00
parent 7e67838adb
commit 746dc2738f
3 changed files with 8 additions and 6 deletions

View File

@@ -62,6 +62,8 @@ metadata:
name: awx
```
> The metadata.name you provide, will be the name of the resulting AWX deployment. If you deploy more than one to the same namespace, be sure to use unique names.
Finally, use `kubectl` to create the awx instance in your cluster:
```bash

View File

@@ -13,7 +13,7 @@
kind: Pod
namespace: '{{ meta.namespace }}'
label_selectors:
- "app={{ deployment_type }}-postgres"
- "app={{ meta.name }}-{{ deployment_type }}-postgres"
register: postgres_pod
until: "postgres_pod['resources'][0]['status']['phase'] == 'Running'"
delay: 5

View File

@@ -6,11 +6,11 @@ metadata:
name: '{{ meta.name }}-postgres'
namespace: '{{ meta.namespace }}'
labels:
app: '{{ deployment_type }}-postgres'
app: '{{ meta.name }}-{{ deployment_type }}-postgres'
spec:
selector:
matchLabels:
app: '{{ deployment_type }}-postgres'
app: '{{ meta.name }}-{{ deployment_type }}-postgres'
serviceName: '{{ meta.name }}'
replicas: 1
updateStrategy:
@@ -18,7 +18,7 @@ spec:
template:
metadata:
labels:
app: '{{ deployment_type }}-postgres'
app: '{{ meta.name }}-{{ deployment_type }}-postgres'
spec:
containers:
- image: '{{ tower_postgres_image }}'
@@ -71,10 +71,10 @@ metadata:
name: '{{ meta.name }}-postgres'
namespace: '{{ meta.namespace }}'
labels:
app: '{{ deployment_type }}-postgres'
app: '{{ meta.name }}-{{ deployment_type }}-postgres'
spec:
ports:
- port: 5432
clusterIP: None
selector:
app: '{{ deployment_type }}-postgres'
app: '{{ meta.name }}-{{ deployment_type }}-postgres'