Skip to content

Instantly share code, notes, and snippets.

@ralvares
Created April 26, 2023 06:42
Show Gist options
  • Save ralvares/f498ccc70e823af94501d8982c5c5bc5 to your computer and use it in GitHub Desktop.
Save ralvares/f498ccc70e823af94501d8982c5c5bc5 to your computer and use it in GitHub Desktop.
DOCKER_CONFIG_JSON=`oc extract secret/pull-secret -n openshift-config --to=-`
oc create secret generic multiclusterhub-operator-pull-secret \
-n open-cluster-management-observability \
--from-literal=.dockerconfigjson="$DOCKER_CONFIG_JSON" \
--type=kubernetes.io/dockerconfigjson
ACCESS_KEY=""
SECRET_KEY=""
while [[ z$ACCESS_KEY == z ]]; do
echo "Wait for acm-observability bucket to be created, sleep 3 seconds"
sleep 3
ACCESS_KEY=$(oc get secret acm-observability -n open-cluster-management-observability --template={{.data.AWS_ACCESS_KEY_ID}} | base64 -d)
SECRET_KEY=$(oc get secret acm-observability -n open-cluster-management-observability --template={{.data.AWS_SECRET_ACCESS_KEY}} | base64 -d)
done;
BUCKET_NAME=$(oc get ObjectBucketClaim acm-observability -n open-cluster-management-observability --template={{.spec.bucketName}})
oc get secret thanos-object-storage -n open-cluster-management-observability
echo "---
apiVersion: v1
kind: Secret
metadata:
name: thanos-object-storage
namespace: open-cluster-management-observability
type: Opaque
stringData:
thanos.yaml: |
type: s3
config:
bucket: $BUCKET_NAME
endpoint: s3.openshift-storage.svc
insecure: true
access_key: $ACCESS_KEY
secret_key: $SECRET_KEY" | oc create -f -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment