File tree Expand file tree Collapse file tree 7 files changed +135
-0
lines changed
testing/kuttl/e2e-other/gssapi Expand file tree Collapse file tree 7 files changed +135
-0
lines changed Original file line number Diff line number Diff line change 1+ apiVersion : v1
2+ kind : ConfigMap
3+ metadata :
4+ name : krb5
5+ ---
6+ apiVersion : v1
7+ kind : Secret
8+ metadata :
9+ name : krb5-keytab
Original file line number Diff line number Diff line change 1+ apiVersion : kuttl.dev/v1beta1
2+ kind : TestStep
3+ commands :
4+ - command : kubectl exec -n krb5 -it krb5-kdc-0 -- /krb5-scripts/krb5.sh "${NAMESPACE}"
Original file line number Diff line number Diff line change 1+ apiVersion : postgres-operator.crunchydata.com/v1beta1
2+ kind : PostgresCluster
3+ metadata :
4+ name : gssapi
5+ status :
6+ instances :
7+ - name : instance1
8+ readyReplicas : 1
9+ replicas : 1
10+ updatedReplicas : 1
11+ ---
12+ apiVersion : v1
13+ kind : Service
14+ metadata :
15+ name : gssapi-primary
Original file line number Diff line number Diff line change 1+ apiVersion : postgres-operator.crunchydata.com/v1beta1
2+ kind : PostgresCluster
3+ metadata :
4+ name : gssapi
5+ spec :
6+ config :
7+ files :
8+ - secret :
9+ name : krb5-keytab
10+ - configMap :
11+ name : krb5
12+ patroni :
13+ dynamicConfiguration :
14+ postgresql :
15+ pg_hba :
16+ - host postgres postgres 0.0.0.0/0 scram-sha-256
17+ - host all krb5hippo@PGO.CRUNCHYDATA.COM 0.0.0.0/0 gss
18+ parameters :
19+ krb_server_keyfile : /etc/postgres/krb5.keytab
20+ users :
21+ - name : postgres
22+ postgresVersion : 14
23+ instances :
24+ - name : instance1
25+ dataVolumeClaimSpec :
26+ accessModes :
27+ - " ReadWriteOnce"
28+ resources :
29+ requests :
30+ storage : 1Gi
31+ backups :
32+ pgbackrest :
33+ repos :
34+ - name : repo1
35+ volume :
36+ volumeClaimSpec :
37+ accessModes :
38+ - " ReadWriteOnce"
39+ resources :
40+ requests :
41+ storage : 1Gi
Original file line number Diff line number Diff line change 1+ apiVersion : batch/v1
2+ kind : Job
3+ metadata :
4+ name : psql-connect-gssapi
5+ status :
6+ succeeded : 1
Original file line number Diff line number Diff line change 1+ apiVersion : batch/v1
2+ kind : Job
3+ metadata :
4+ name : psql-connect-gssapi
5+ spec :
6+ template :
7+ spec :
8+ restartPolicy : Never
9+ containers :
10+ - name : psql
11+ image : us.gcr.io/container-suite/crunchy-postgres:centos8-14.1-5.1.0-rc.1-0
12+ command :
13+ - bash
14+ - -c
15+ - --
16+ - |-
17+ psql -c 'create user "krb5hippo@PGO.CRUNCHYDATA.COM";'
18+ kinit -k -t /krb5-conf/krb5.keytab krb5hippo@PGO.CRUNCHYDATA.COM
19+ psql -U krb5hippo@PGO.CRUNCHYDATA.COM -h gssapi-primary.$(NAMESPACE).svc.cluster.local -d postgres \
20+ -c 'select version();'
21+ env :
22+ - name : NAMESPACE
23+ valueFrom : { fieldRef: { fieldPath: metadata.namespace } }
24+ - name : PGHOST
25+ valueFrom : { secretKeyRef: { name: gssapi-pguser-postgres, key: host } }
26+ - name : PGPORT
27+ valueFrom : { secretKeyRef: { name: gssapi-pguser-postgres, key: port } }
28+ - name : PGUSER
29+ valueFrom : { secretKeyRef: { name: gssapi-pguser-postgres, key: user } }
30+ - name : PGPASSWORD
31+ valueFrom : { secretKeyRef: { name: gssapi-pguser-postgres, key: password } }
32+ - name : PGDATABASE
33+ value : postgres
34+ - name : KRB5_CONFIG
35+ value : /krb5-conf/krb5.conf
36+ volumeMounts :
37+ - name : krb5-conf
38+ mountPath : /krb5-conf
39+ volumes :
40+ - name : krb5-conf
41+ projected :
42+ sources :
43+ - configMap :
44+ name : krb5
45+ - secret :
46+ name : krb5-keytab
Original file line number Diff line number Diff line change 1+ # GSSAPI Authentication
2+
3+ This test verifies that it is possible to properly configure PostgreSQL for GSSAPI
4+ authentication. This is done by configuring a PostgresCluster for GSSAPI authentication,
5+ and then utilizing a Kerberos ticket that has been issued by a Kerberos KDC server to log into
6+ PostgreSQL.
7+
8+ ## Assumptions
9+
10+ - A Kerberos Key Distribution Center (KDC) Pod named ` krb5-kdc-0 ` is deployed inside of a ` krb5 `
11+ namespace within the Kubernetes cluster
12+ - The KDC server (` krb5-kdc-0 ` ) contains a ` /krb5-conf/krb5.sh ` script that can be run as part
13+ of the test to create the Kerberos principals, keytab secret and client configuration needed to
14+ successfully run the test
You can’t perform that action at this time.
0 commit comments