diff --git a/tests/templates/kuttl/kerberos/30-install-hbase.yaml.j2 b/tests/templates/kuttl/kerberos/30-install-hbase.yaml.j2 index a21046d1..b809108d 100644 --- a/tests/templates/kuttl/kerberos/30-install-hbase.yaml.j2 +++ b/tests/templates/kuttl/kerberos/30-install-hbase.yaml.j2 @@ -65,4 +65,17 @@ commands: roleGroups: default: replicas: 1 + configOverrides: + hbase-site.xml: + # Allow Kerberos authentication at the hbase-restserver-default-headless service + hbase.rest.authentication.kerberos.principal: HTTP/hbase-restserver-default-headless.$NAMESPACE.svc.cluster.local@\${env:KERBEROS_REALM} + podOverrides: + spec: + volumes: + - name: kerberos + ephemeral: + volumeClaimTemplate: + metadata: + annotations: + secrets.stackable.tech/scope: service=hbase,service=hbase-restserver-default-headless EOF diff --git a/tests/templates/kuttl/kerberos/42-test-rest-server.yaml b/tests/templates/kuttl/kerberos/42-test-rest-server.yaml deleted file mode 100644 index e31127d4..00000000 --- a/tests/templates/kuttl/kerberos/42-test-rest-server.yaml +++ /dev/null @@ -1,30 +0,0 @@ ---- -apiVersion: batch/v1 -kind: Job -metadata: - name: test-rest-server -spec: - template: - spec: - serviceAccountName: test-sa - containers: - - name: test-rest-server - image: oci.stackable.tech/sdp/testing-tools:0.2.0-stackable0.0.0-dev - command: - - /bin/bash - - -c - - | - status_code=$(curl --write-out '%{http_code}' --silent --insecure --output /dev/null "https://hbase-restserver-default-headless:8080") - - if [[ "$status_code" -eq 401 ]] ; then - echo "[PASS] Successfully got 401 as we did not authenticate" - exit 0 - else - echo "[FAIL] Expected the restserver to return a 401 as we did not authenticate" - exit 1 - fi - securityContext: - fsGroup: 1000 - runAsGroup: 1000 - runAsUser: 1000 - restartPolicy: OnFailure diff --git a/tests/templates/kuttl/kerberos/42-test-rest-server.yaml.j2 b/tests/templates/kuttl/kerberos/42-test-rest-server.yaml.j2 new file mode 100644 index 00000000..3f01589f --- /dev/null +++ b/tests/templates/kuttl/kerberos/42-test-rest-server.yaml.j2 @@ -0,0 +1,69 @@ +--- +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +commands: + - script: | + kubectl apply -n $NAMESPACE -f - <