I have my Kubernetes service of which I'm getting the url in my minikube installation using:
minikube service postgres --url
Which returns the URL like: http://192.xxx.xx.xxxx:3xx62
However I want this URL to be used in my ConfigMap as the pghost and pgport - so for example:
apiVersion: v1
kind: ConfigMap
metadata:
name: firsttest
labels:
app: firsttest
data:
pgdatabase: "first_test"
pguser: "postgresql_user"
pghost: ""
pgport: ""
pgpool_size: "5"
auth_user: "unique"
And the service looks like:
apiVersion: v1
kind: Service
metadata:
name: postgres
spec:
type: NodePort
ports:
- name: pgql
port: 5432
targetPort: 5432
protocol: TCP
selector:
app: postgres
Is this possible?
Any help appreciated.
Thanks.
I will just compile a list of some crucial things about interaction with Services: