Repository navigation
test: Test the repository-azure plugin #194
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 all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
17ec2ce
test: Add repository-azure-plugin test
siegfriedweber aea6a1f
test: Improve repository-azure-plugin test
siegfriedweber e504616
test: Upgrade opensearch-py
siegfriedweber b9dd2c8
test(repository-azure-plugin): Adapt to OpenShift
siegfriedweber c54b840
Merge branch 'main' into test/repository-azure
siegfriedweber 7663246
test(repository-azure-plugin): Remove debug output
siegfriedweber 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
15 changes: 15 additions & 0 deletions
15
tests/templates/kuttl/repository-azure-plugin/00-patch-ns.yaml
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,15 @@ | ||
| # see https://github.com/stackabletech/issues/issues/566 | ||
| --- | ||
| apiVersion: kuttl.dev/v1beta1 | ||
| kind: TestStep | ||
| commands: | ||
| - script: | | ||
| kubectl patch namespace $NAMESPACE --patch=' | ||
| { | ||
| "metadata": { | ||
| "labels": { | ||
| "pod-security.kubernetes.io/enforce": "privileged" | ||
| } | ||
| } | ||
| }' | ||
| timeout: 120 |
31 changes: 31 additions & 0 deletions
31
tests/templates/kuttl/repository-azure-plugin/01-rbac.yaml
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,31 @@ | ||
| --- | ||
| apiVersion: v1 | ||
| kind: ServiceAccount | ||
| metadata: | ||
| name: test-service-account | ||
| --- | ||
| kind: Role | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| metadata: | ||
| name: test-role | ||
| rules: | ||
| - apiGroups: | ||
| - security.openshift.io | ||
| resources: | ||
| - securitycontextconstraints | ||
| resourceNames: | ||
| - privileged | ||
| verbs: | ||
| - use | ||
| --- | ||
| kind: RoleBinding | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| metadata: | ||
| name: test-role-binding | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: test-service-account | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: Role | ||
| name: test-role |
10 changes: 10 additions & 0 deletions
10
tests/templates/kuttl/repository-azure-plugin/02-assert.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,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
...s/kuttl/repository-azure-plugin/02-install-vector-aggregator-discovery-config-map.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 %} |
9 changes: 9 additions & 0 deletions
9
tests/templates/kuttl/repository-azure-plugin/03-truststore.yaml
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 @@ | ||
| --- | ||
| apiVersion: secrets.stackable.tech/v1alpha1 | ||
| kind: TrustStore | ||
| metadata: | ||
| name: truststore-pem | ||
| spec: | ||
| secretClassName: tls | ||
| format: tls-pem | ||
| targetKind: ConfigMap |
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 @@ | ||
| --- | ||
| apiVersion: apps/v1 | ||
| kind: StatefulSet | ||
| metadata: | ||
| name: azurite | ||
| status: | ||
| readyReplicas: 1 | ||
| replicas: 1 |
99 changes: 99 additions & 0 deletions
99
tests/templates/kuttl/repository-azure-plugin/10-install-azurite.yaml
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,99 @@ | ||
| --- | ||
| apiVersion: apps/v1 | ||
| kind: StatefulSet | ||
| metadata: | ||
| name: azurite | ||
| labels: | ||
| app.kubernetes.io/name: azurite | ||
| spec: | ||
| replicas: 1 | ||
| selector: | ||
| matchLabels: | ||
| app.kubernetes.io/name: azurite | ||
| serviceName: azurite | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app.kubernetes.io/name: azurite | ||
| spec: | ||
| containers: | ||
| - name: azurite | ||
| image: mcr.microsoft.com/azure-storage/azurite:3.37.0 | ||
| command: | ||
| - azurite-blob | ||
| - --location | ||
| - /data | ||
| - --disableTelemetry | ||
| # The account name is in the URL path, not in the FQDN hostname. | ||
| - --disableProductStyleUrl | ||
| - --blobHost | ||
| - 0.0.0.0 | ||
| - --cert | ||
| - /tls/tls.crt | ||
| - --key | ||
| - /tls/tls.key | ||
| ports: | ||
| - containerPort: 10000 | ||
| name: blobs | ||
| securityContext: | ||
| capabilities: | ||
| drop: | ||
| - ALL | ||
| readOnlyRootFilesystem: true | ||
| allowPrivilegeEscalation: false | ||
| privileged: false | ||
| volumeMounts: | ||
| - name: storage | ||
| mountPath: /data | ||
| - name: tls | ||
| mountPath: /tls | ||
| securityContext: | ||
| runAsNonRoot: true | ||
| runAsGroup: 1000 | ||
| runAsUser: 1000 | ||
| fsGroup: 1000 | ||
| serviceAccountName: test-service-account | ||
| volumes: | ||
| - name: tls | ||
| ephemeral: | ||
| volumeClaimTemplate: | ||
| metadata: | ||
| annotations: | ||
| secrets.stackable.tech/class: tls | ||
| secrets.stackable.tech/scope: service=azurite | ||
| spec: | ||
| storageClassName: secrets.stackable.tech | ||
| accessModes: | ||
| - ReadWriteOnce | ||
| resources: | ||
| requests: | ||
| storage: "1" | ||
| volumeClaimTemplates: | ||
| - metadata: | ||
| name: storage | ||
| spec: | ||
| accessModes: | ||
| - ReadWriteOnce | ||
| resources: | ||
| requests: | ||
| storage: 100Mi | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: azurite | ||
| spec: | ||
| selector: | ||
| app.kubernetes.io/name: azurite | ||
| ports: | ||
| - port: 10000 | ||
| targetPort: 10000 | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Secret | ||
| metadata: | ||
| name: azurite-credentials | ||
| stringData: | ||
| # The default storage account of Azurite, see https://github.com/Azure/Azurite#default-storage-account. | ||
| AZURITE_ACCOUNT_NAME: devstoreaccount1 | ||
| AZURITE_ACCOUNT_KEY: Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw== | ||
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,7 @@ | ||
| --- | ||
| apiVersion: batch/v1 | ||
| kind: Job | ||
| metadata: | ||
| name: create-azure-storage-container | ||
| status: | ||
| succeeded: 1 |
66 changes: 66 additions & 0 deletions
66
tests/templates/kuttl/repository-azure-plugin/11-create-azure-storage-container.yaml
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,66 @@ | ||
| --- | ||
| apiVersion: batch/v1 | ||
| kind: Job | ||
| metadata: | ||
| name: create-azure-storage-container | ||
| spec: | ||
| template: | ||
| spec: | ||
| containers: | ||
| - name: create-azure-storage-container | ||
| image: mcr.microsoft.com/azure-cli:2.91.0 | ||
| command: | ||
| - az | ||
| - storage | ||
| - container | ||
| - create | ||
| - --name | ||
| - opensearch-remote | ||
| envFrom: | ||
| - secretRef: | ||
| name: azurite-credentials | ||
| env: | ||
| - name: NAMESPACE | ||
| valueFrom: | ||
| fieldRef: | ||
| fieldPath: metadata.namespace | ||
| - name: AZURE_STORAGE_CONNECTION_STRING | ||
| value: "\ | ||
| DefaultEndpointsProtocol=https;\ | ||
| AccountName=$(AZURITE_ACCOUNT_NAME);\ | ||
| AccountKey=$(AZURITE_ACCOUNT_KEY);\ | ||
| BlobEndpoint=https://azurite.$(NAMESPACE).svc.cluster.local:10000/$(AZURITE_ACCOUNT_NAME);\ | ||
| " | ||
| - name: REQUESTS_CA_BUNDLE | ||
| value: /tls/ca.crt | ||
| # The home directory of the user is not writable, so let the Azure | ||
| # CLI store its configuration in the writable /tmp directory. | ||
| - name: AZURE_CONFIG_DIR | ||
| value: /tmp/.azure | ||
| securityContext: | ||
| capabilities: | ||
| drop: | ||
| - ALL | ||
| readOnlyRootFilesystem: true | ||
| allowPrivilegeEscalation: false | ||
| privileged: false | ||
| volumeMounts: | ||
| - name: tls | ||
| mountPath: /tls | ||
| # The Azure CLI requires a writable temporary directory, also for | ||
| # its configuration (see AZURE_CONFIG_DIR). | ||
| - name: tmp | ||
| mountPath: /tmp | ||
| securityContext: | ||
| runAsNonRoot: true | ||
| runAsGroup: 1000 | ||
| runAsUser: 1000 | ||
| fsGroup: 1000 | ||
| serviceAccountName: test-service-account | ||
| volumes: | ||
| - name: tls | ||
| configMap: | ||
| name: truststore-pem | ||
| - name: tmp | ||
| emptyDir: {} | ||
| restartPolicy: OnFailure |
20 changes: 20 additions & 0 deletions
20
tests/templates/kuttl/repository-azure-plugin/20-assert.yaml
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,20 @@ | ||
| --- | ||
| apiVersion: kuttl.dev/v1beta1 | ||
| kind: TestAssert | ||
| timeout: 600 | ||
| --- | ||
| apiVersion: apps/v1 | ||
| kind: StatefulSet | ||
| metadata: | ||
| name: opensearch-nodes-cluster-manager | ||
| status: | ||
| readyReplicas: 3 | ||
| replicas: 3 | ||
| --- | ||
| apiVersion: apps/v1 | ||
| kind: StatefulSet | ||
| metadata: | ||
| name: opensearch-nodes-data | ||
| status: | ||
| readyReplicas: 2 | ||
| replicas: 2 |
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.