operator: Add tools to test on Azure (#11340)

)
pull/11400/head
Periklis Tsirakidis 1 year ago committed by GitHub
parent a0b462d366
commit d683aedb1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 33
      operator/hack/deploy-azure-storage-secret.sh
  2. 25
      operator/hack/lokistack_gateway_ocp_azure.yaml

@ -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}")"

@ -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"
Loading…
Cancel
Save