how to connect via psql (#15)
This commit is contained in:
		
							parent
							
								
									c08e83bebf
								
							
						
					
					
						commit
						1d2fb0091f
					
				
							
								
								
									
										10
									
								
								README.md
								
								
								
								
							
							
						
						
									
										10
									
								
								README.md
								
								
								
								
							| 
						 | 
					@ -138,3 +138,13 @@ permissions there).
 | 
				
			||||||
### Watch Pods being created
 | 
					### Watch Pods being created
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    $ kubectl --context minikube  get pods -w --show-labels
 | 
					    $ kubectl --context minikube  get pods -w --show-labels
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Connect to PostgreSQL
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					We can use the generated secret of the `postgres` robot user to connect to our `acid-testcluster` master running in Minikube:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    $ export HOST_PORT=$(minikube service acid-testcluster --url | sed 's,.*/,,')
 | 
				
			||||||
 | 
					    $ export PGHOST=$(echo $HOST_PORT | cut -d: -f 1)
 | 
				
			||||||
 | 
					    $ export PGPORT=$(echo $HOST_PORT | cut -d: -f 2)
 | 
				
			||||||
 | 
					    $ export PGPASSWORD=$(kubectl --context minikube get secret postgres.acid-testcluster.credentials.postgresql.acid.zalan.do -o 'jsonpath={.data.password}' | base64 -d)
 | 
				
			||||||
 | 
					    $ psql -U postgres
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue