Skip to content

Commit 1fef741

Browse files
author
jmccormick2001
committed
update TLS docs
1 parent bd952f5 commit 1fef741

File tree

3 files changed

+85
-3
lines changed

3 files changed

+85
-3
lines changed

bin/remove-images.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
# Copyright 2017 Crunchy Data Solutions, Inc.
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
docker rmi -f crunchydata/lspvc:$CO_IMAGE_TAG \
17+
crunchydata/postgres-operator:$CO_IMAGE_TAG \
18+
crunchydata/csvload:$CO_IMAGE_TAG \
19+
crunchydata/apiserver:$CO_IMAGE_TAG

docs/build.asciidoc

Lines changed: 65 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export CO_VERSION=2.2
8686
export CO_IMAGE_TAG=$CO_BASEOS-$CO_VERSION
8787
export CO_NAMESPACE=demo
8888
export CO_CMD=kubectl
89-
export CO_APISERVER_URL=http://postgres-operator:8080
89+
export CO_APISERVER_URL=https://postgres-operator:8443
9090
....
9191

9292
The value of CO_APISERVER_URL is used by the *pgo* client to connect
@@ -286,6 +286,40 @@ then the next searched location is */etc/pgo/pgouser*, and if not found
286286
there then lastly the *PGOUSER* environment variable is searched for
287287
a path to the basic authentication file.
288288

289+
=== Configure TLS
290+
291+
As of Operator 2.3, TLS is used to secure communications to
292+
the *apiserver*. Sample keys/certs used by TLS are found
293+
here:
294+
....
295+
$COROOT/conf/apiserver/server.crt
296+
$COROOT/conf/apiserver/server.key
297+
....
298+
299+
If you want to generate your own keys, you can use the script found in:
300+
....
301+
$COROOT/bin/make-certs.sh
302+
....
303+
304+
The *pgo* client is required to use keys to connect to the *apiserver*.
305+
Specify the keys to *pgo* by setting the following environment
306+
variables:
307+
....
308+
export PGO_CA_CERT=$COROOT/conf/apiserver/server.crt
309+
export PGO_CLIENT_CERT=$COROOT/conf/apiserver/server.crt
310+
export PGO_CLIENT_KEY=$COROOT/conf/apiserver/server.key
311+
....
312+
313+
The sample server keys are used as the client keys, adjust to suit
314+
your requirements.
315+
316+
For the *apiserver* TLS configuration, the keys are included
317+
in the *apiserver-conf* configMap when the *apiserver* is deployed.
318+
See the $COROOT/deploy/deploy.sh script which is where the
319+
configMap is created.
320+
321+
The *apiserver* listens on port 8443 (e.g. https://postgres-operator:8443).
322+
289323
=== Configuration
290324

291325
The *apiserver* uses the following configuration files found in $COROOT/conf/apiserver to determine how the Operator will provision PostgreSQL containers:
@@ -319,6 +353,25 @@ make deployoperator
319353
kubectl get pod -l 'name=postgres-operator'
320354
....
321355

356+
You should see output similar to:
357+
....
358+
NAME READY STATUS RESTARTS AGE
359+
postgres-operator-7f8db87c7b-4tk52 2/2 Running 0 8s
360+
....
361+
362+
This output shows that both the *apiserver* and *postgres-operator* containers
363+
are in ready state and the pod is running.
364+
365+
You can find the operator service IP address as follows:
366+
....
367+
kubectl get service postgres-operator
368+
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
369+
postgres-operator ClusterIP 10.105.56.167 <none> 8080/TCP,8443/TCP 1m
370+
....
371+
372+
In this example, the *apiserver* is reachable at *https://10.105.56.167:8443*.
373+
374+
322375
When you first run the operator, it will create the required
323376
CustomResourceDefinitions. You can view these as follows:
324377

@@ -348,7 +401,17 @@ kubectl get pgpolicylogs
348401
At this point, you should be ready to start using the *pgo* client! Be
349402
sure to set the environment variable *CO_APISERVER_URL* to the DNS
350403
name of the *postgres-operator* service or to the IP address of the
351-
*postgres-operator* service IP address.
404+
*postgres-operator* service IP address. For example:
405+
406+
....
407+
export CO_APISERVER_URL=https://10.105.56.167:8443
408+
....
409+
410+
or if you have DNS configured on your client host:
411+
....
412+
export CO_APISERVER_URL=https://postgres-operator.demo.svc.cluster.local:8443
413+
....
414+
352415

353416
== Performing a Smoke Test
354417

pgo/cmd/auth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ func GetCredentials() {
166166
os.Exit(2)
167167
}
168168

169-
log.Info("setting up httpclient with TLS")
169+
log.Debug("setting up httpclient with TLS")
170170
httpclient = &http.Client{
171171
Transport: &http.Transport{
172172
TLSClientConfig: &tls.Config{

0 commit comments

Comments
 (0)