Skip to content

Commit

Permalink
operator: Add tools to test on Azure (#11340)
Browse files Browse the repository at this point in the history
)
  • Loading branch information
periklis committed Dec 6, 2023
1 parent a0b462d commit d683aed
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
33 changes: 33 additions & 0 deletions operator/hack/deploy-azure-storage-secret.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bash

set -euo pipefail

readonly account_name="${1-}"
readonly container_name="${2-}"

if [[ -z "${account_name}" ]]; then
echo "Provide a account name"
exit 1
fi

if [[ -z "${container_name}" ]]; then
echo "Provide a container name"
exit 1
fi

readonly namespace="${NAMESPACE:-openshift-logging}"

readonly azure_environment="AzureGlobal"

resource_group=$(az storage account show --name "${account_name}" | jq -r '.resourceGroup')
readonly resource_group

account_key=$(az storage account keys list --resource-group "${resource_group}" --account-name "${account_name}" | jq -r '.[0].value')
readonly account_key

kubectl --ignore-not-found=true -n "${namespace}" delete secret test
kubectl -n "${namespace}" create secret generic test \
--from-literal=environment="$(echo -n "${azure_environment}")" \
--from-literal=account_name="$(echo -n "${account_name}")" \
--from-literal=account_key="$(echo -n "${account_key}")" \
--from-literal=container="$(echo -n "${container_name}")"
25 changes: 25 additions & 0 deletions operator/hack/lokistack_gateway_ocp_azure.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: loki.grafana.com/v1
kind: LokiStack
metadata:
name: lokistack-dev
namespace: openshift-logging
spec:
size: 1x.demo
storage:
schemas:
- version: v13
effectiveDate: 2023-10-15
secret:
name: test
type: azure
storageClassName: managed-csi
tenants:
mode: openshift-logging
rules:
enabled: true
selector:
matchLabels:
openshift.io/cluster-monitoring: "true"
namespaceSelector:
matchLabels:
openshift.io/cluster-monitoring: "true"

0 comments on commit d683aed

Please sign in to comment.