-
-
Notifications
You must be signed in to change notification settings - Fork 8
test: Add test for Apache Iceberg integration #785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 13 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
6f186a0
Clean up smoke test
sbernauer fd729c2
clean up smoke test part 2
sbernauer 663f0f0
Add working test :)
sbernauer 34d81c5
Move files
sbernauer dd4a180
Add and test HDFS functionality
sbernauer bf56915
Kerbize HDFS and HMS
sbernauer 8ffd779
Add Kerberos test
sbernauer f925884
Use nightly image
sbernauer cf035f0
Merge branch 'main' into test/iceberg
sbernauer dfefa4d
linter
sbernauer 841e484
Update Iceberg docs
sbernauer a689cdb
changelog
sbernauer 1e2bb65
Merge remote-tracking branch 'origin/main' into test/iceberg
sbernauer ca3d817
Small bumps
sbernauer 8b612cf
Update docs/modules/nifi/pages/usage_guide/writing-to-iceberg-tables.…
sbernauer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| {% if test_scenario['values']['openshift'] == 'true' %} | ||
| # see https://github.com/stackabletech/issues/issues/566 | ||
| --- | ||
| apiVersion: kuttl.dev/v1beta1 | ||
| kind: TestStep | ||
| commands: | ||
| - script: kubectl patch namespace $NAMESPACE -p '{"metadata":{"labels":{"pod-security.kubernetes.io/enforce":"privileged"}}}' | ||
| timeout: 120 | ||
| {% endif %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| --- | ||
| kind: Role | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| metadata: | ||
| name: test-role | ||
| rules: | ||
| {% if test_scenario['values']['openshift'] == "true" %} | ||
| - apiGroups: ["security.openshift.io"] | ||
| resources: ["securitycontextconstraints"] | ||
| resourceNames: ["privileged"] | ||
| verbs: ["use"] | ||
| {% endif %} | ||
| --- | ||
| apiVersion: v1 | ||
| kind: ServiceAccount | ||
| metadata: | ||
| name: test-sa | ||
| --- | ||
| kind: RoleBinding | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| metadata: | ||
| name: test-rb | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: test-sa | ||
| roleRef: | ||
| kind: Role | ||
| name: test-role | ||
| apiGroup: rbac.authorization.k8s.io |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| apiVersion: kuttl.dev/v1beta1 | ||
| kind: TestStep | ||
| commands: | ||
| - script: envsubst '$NAMESPACE' < 01_s3-connection.yaml | kubectl apply -n $NAMESPACE -f - |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| --- | ||
| apiVersion: s3.stackable.tech/v1alpha1 | ||
| kind: S3Connection | ||
| metadata: | ||
| name: minio | ||
| spec: | ||
| host: "minio.${NAMESPACE}.svc.cluster.local" | ||
| port: 9000 | ||
| accessStyle: Path | ||
| credentials: | ||
| secretClass: s3-credentials-class | ||
| tls: | ||
| verification: | ||
| server: | ||
| caCert: | ||
| secretClass: tls | ||
| --- | ||
| apiVersion: secrets.stackable.tech/v1alpha1 | ||
| kind: SecretClass | ||
| metadata: | ||
| name: s3-credentials-class | ||
| spec: | ||
| backend: | ||
| k8sSearch: | ||
| searchNamespace: | ||
| pod: {} | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Secret | ||
| metadata: | ||
| name: minio-credentials | ||
| labels: | ||
| secrets.stackable.tech/class: s3-credentials-class | ||
| stringData: | ||
| accessKey: admin | ||
| secretKey: adminadmin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| --- | ||
| apiVersion: kuttl.dev/v1beta1 | ||
| kind: TestAssert | ||
| timeout: 300 | ||
| {% if test_scenario['values']['iceberg-use-kerberos'] == 'true' %} | ||
| --- | ||
| apiVersion: apps/v1 | ||
| kind: StatefulSet | ||
| metadata: | ||
| name: krb5-kdc | ||
| status: | ||
| readyReplicas: 1 | ||
| replicas: 1 | ||
| {% endif %} |
146 changes: 146 additions & 0 deletions
146
tests/templates/kuttl/iceberg/02-install-krb5-kdc.yaml.j2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,146 @@ | ||
| {% if test_scenario['values']['iceberg-use-kerberos'] == 'true' %} | ||
| apiVersion: apps/v1 | ||
| kind: StatefulSet | ||
| metadata: | ||
| name: krb5-kdc | ||
| spec: | ||
| selector: | ||
| matchLabels: | ||
| app: krb5-kdc | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app: krb5-kdc | ||
| spec: | ||
| serviceAccountName: test-sa | ||
| initContainers: | ||
| - name: init | ||
| image: oci.stackable.tech/sdp/krb5:{{ test_scenario['values']['krb5'] }}-stackable0.0.0-dev | ||
| args: | ||
| - sh | ||
| - -euo | ||
| - pipefail | ||
| - -c | ||
| - | | ||
| test -e /var/kerberos/krb5kdc/principal || kdb5_util create -s -P asdf | ||
| kadmin.local get_principal -terse root/admin || kadmin.local add_principal -pw asdf root/admin | ||
| # stackable-secret-operator principal must match the keytab specified in the SecretClass | ||
| kadmin.local get_principal -terse stackable-secret-operator || kadmin.local add_principal -e aes256-cts-hmac-sha384-192:normal -pw asdf stackable-secret-operator | ||
| env: | ||
| - name: KRB5_CONFIG | ||
| value: /stackable/config/krb5.conf | ||
| volumeMounts: | ||
| - mountPath: /stackable/config | ||
| name: config | ||
| - mountPath: /var/kerberos/krb5kdc | ||
| name: data | ||
| containers: | ||
| - name: kdc | ||
| image: oci.stackable.tech/sdp/krb5:{{ test_scenario['values']['krb5'] }}-stackable0.0.0-dev | ||
| args: | ||
| - krb5kdc | ||
| - -n | ||
| env: | ||
| - name: KRB5_CONFIG | ||
| value: /stackable/config/krb5.conf | ||
| volumeMounts: | ||
| - mountPath: /stackable/config | ||
| name: config | ||
| - mountPath: /var/kerberos/krb5kdc | ||
| name: data | ||
| # Root permissions required on Openshift to access internal ports | ||
| {% if test_scenario['values']['openshift'] == "true" %} | ||
| securityContext: | ||
| runAsUser: 0 | ||
| {% endif %} | ||
| - name: kadmind | ||
| image: oci.stackable.tech/sdp/krb5:{{ test_scenario['values']['krb5'] }}-stackable0.0.0-dev | ||
| args: | ||
| - kadmind | ||
| - -nofork | ||
| env: | ||
| - name: KRB5_CONFIG | ||
| value: /stackable/config/krb5.conf | ||
| volumeMounts: | ||
| - mountPath: /stackable/config | ||
| name: config | ||
| - mountPath: /var/kerberos/krb5kdc | ||
| name: data | ||
| # Root permissions required on Openshift to access internal ports | ||
| {% if test_scenario['values']['openshift'] == "true" %} | ||
| securityContext: | ||
| runAsUser: 0 | ||
| {% endif %} | ||
| - name: client | ||
| image: oci.stackable.tech/sdp/krb5:{{ test_scenario['values']['krb5'] }}-stackable0.0.0-dev | ||
| tty: true | ||
| stdin: true | ||
| env: | ||
| - name: KRB5_CONFIG | ||
| value: /stackable/config/krb5.conf | ||
| volumeMounts: | ||
| - mountPath: /stackable/config | ||
| name: config | ||
| volumes: | ||
| - name: config | ||
| configMap: | ||
| name: krb5-kdc | ||
| volumeClaimTemplates: | ||
| - metadata: | ||
| name: data | ||
| spec: | ||
| accessModes: | ||
| - ReadWriteOnce | ||
| resources: | ||
| requests: | ||
| storage: 1Gi | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: krb5-kdc | ||
| spec: | ||
| selector: | ||
| app: krb5-kdc | ||
| ports: | ||
| - name: kadmin | ||
| port: 749 | ||
| - name: kdc | ||
| port: 88 | ||
| - name: kdc-udp | ||
| port: 88 | ||
| protocol: UDP | ||
| --- | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: krb5-kdc | ||
| data: | ||
| krb5.conf: | | ||
| [logging] | ||
| default = STDERR | ||
| kdc = STDERR | ||
| admin_server = STDERR | ||
| # default = FILE:/var/log/krb5libs.log | ||
| # kdc = FILE:/var/log/krb5kdc.log | ||
| # admin_server = FILE:/vaggr/log/kadmind.log | ||
| [libdefaults] | ||
| dns_lookup_realm = false | ||
| ticket_lifetime = 24h | ||
| renew_lifetime = 7d | ||
| forwardable = true | ||
| rdns = false | ||
| default_realm = {{ test_scenario['values']['kerberos-realm'] }} | ||
| spake_preauth_groups = edwards25519 | ||
| [realms] | ||
| {{ test_scenario['values']['kerberos-realm'] }} = { | ||
| acl_file = /stackable/config/kadm5.acl | ||
| disable_encrypted_timestamp = false | ||
| } | ||
| [domain_realm] | ||
| .cluster.local = {{ test_scenario['values']['kerberos-realm'] }} | ||
| cluster.local = {{ test_scenario['values']['kerberos-realm'] }} | ||
| kadm5.acl: | | ||
| root/admin *e | ||
| stackable-secret-operator *e | ||
| {% endif %} |
8 changes: 8 additions & 0 deletions
8
tests/templates/kuttl/iceberg/03-create-kerberos-secretclass.yaml.j2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| {% if test_scenario['values']['iceberg-use-kerberos'] == 'true' %} | ||
| apiVersion: kuttl.dev/v1beta1 | ||
| kind: TestStep | ||
| commands: | ||
| # We need to replace $NAMESPACE (by KUTTL) | ||
| - script: envsubst '$NAMESPACE' < 03_kerberos-secretclass.yaml | kubectl apply -n $NAMESPACE -f - | ||
| {% endif %} |
33 changes: 33 additions & 0 deletions
33
tests/templates/kuttl/iceberg/03_kerberos-secretclass.yaml.j2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| apiVersion: secrets.stackable.tech/v1alpha1 | ||
| kind: SecretClass | ||
| metadata: | ||
| name: kerberos-$NAMESPACE | ||
| spec: | ||
| backend: | ||
| kerberosKeytab: | ||
| realmName: {{ test_scenario['values']['kerberos-realm'] }} | ||
| kdc: krb5-kdc.$NAMESPACE.svc.cluster.local | ||
| admin: | ||
| mit: | ||
| kadminServer: krb5-kdc.$NAMESPACE.svc.cluster.local | ||
| adminKeytabSecret: | ||
| namespace: $NAMESPACE | ||
| name: secret-operator-keytab | ||
| adminPrincipal: stackable-secret-operator | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Secret | ||
| metadata: | ||
| name: secret-operator-keytab | ||
| data: | ||
| # To create keytab. When promted enter password asdf | ||
| # cat | ktutil << 'EOF' | ||
| # list | ||
| # add_entry -password -p [email protected] -k 1 -e aes256-cts-hmac-sha384-192 | ||
| # wkt /tmp/keytab | ||
| # EOF | ||
| {% if test_scenario['values']['kerberos-realm'] == 'CLUSTER.LOCAL' %} | ||
| keytab: BQIAAABdAAEADUNMVVNURVIuTE9DQUwAGXN0YWNrYWJsZS1zZWNyZXQtb3BlcmF0b3IAAAABZAYWIgEAFAAgm8MCZ8B//XF1tH92GciD6/usWUNAmBTZnZQxLua2TkgAAAAB | ||
| {% elif test_scenario['values']['kerberos-realm'] == 'PROD.MYCORP' %} | ||
| keytab: BQIAAABbAAEAC1BST0QuTVlDT1JQABlzdGFja2FibGUtc2VjcmV0LW9wZXJhdG9yAAAAAWQZa0EBABQAIC/EnFNejq/K5lX6tX+B3/tkI13TCzkPB7d2ggCIEzE8AAAAAQ== | ||
| {% endif %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| apiVersion: kuttl.dev/v1beta1 | ||
| kind: TestAssert | ||
| {% if lookup('env', 'VECTOR_AGGREGATOR') %} | ||
| --- | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: vector-aggregator-discovery | ||
| {% endif %} |
9 changes: 9 additions & 0 deletions
9
tests/templates/kuttl/iceberg/10-install-vector-aggregator-discovery-configmap.yaml.j2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| {% if lookup('env', 'VECTOR_AGGREGATOR') %} | ||
| --- | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: vector-aggregator-discovery | ||
| data: | ||
| ADDRESS: {{ lookup('env', 'VECTOR_AGGREGATOR') }} | ||
| {% endif %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| --- | ||
| apiVersion: kuttl.dev/v1beta1 | ||
| kind: TestAssert | ||
| timeout: 600 | ||
| --- | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: minio | ||
| status: | ||
| readyReplicas: 1 | ||
| replicas: 1 | ||
| --- | ||
| apiVersion: batch/v1 | ||
| kind: Job | ||
| metadata: | ||
| name: minio-post-job | ||
| status: | ||
| succeeded: 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| apiVersion: kuttl.dev/v1beta1 | ||
| kind: TestStep | ||
| commands: | ||
| - script: kubectl -n $NAMESPACE apply -f https://raw.githubusercontent.com/stackabletech/demos/refs/heads/release-25.3/stacks/_templates/minio-tls/rendered-chart.yaml |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.