Skip to content

Commit

Permalink
Try indenting to see if pre-integration tests pass.
Browse files Browse the repository at this point in the history
  • Loading branch information
bigkevmcd committed Jul 25, 2023
1 parent a7a2372 commit ba291fd
Showing 1 changed file with 43 additions and 43 deletions.
86 changes: 43 additions & 43 deletions website/docs/cluster-management/managing-clusters-without-capi.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -106,49 +106,49 @@ Here's how to create a kubeconfig secret.
<details><summary>Expand to see script</summary>

```bash title="static-kubeconfig.sh"
#!/bin/bash

if [[ -z "$CLUSTER_NAME" ]]; then
echo "Ensure CLUSTER_NAME has been set"
exit 1
fi

if [[ -z "$CA_CERTIFICATE" ]]; then
echo "Ensure CA_CERTIFICATE has been set to the path of the CA certificate"
exit 1
fi

if [[ -z "$ENDPOINT" ]]; then
echo "Ensure ENDPOINT has been set"
exit 1
fi

if [[ -z "$TOKEN" ]]; then
echo "Ensure TOKEN has been set"
exit 1
fi

export CLUSTER_CA_CERTIFICATE=$(cat "$CA_CERTIFICATE" | base64)

envsubst <<EOF
apiVersion: v1
kind: Config
current-context: $CLUSTER_NAME
clusters:
- name: $CLUSTER_NAME
cluster:
server: https://$ENDPOINT
certificate-authority-data: $CLUSTER_CA_CERTIFICATE
users:
- name: $CLUSTER_NAME
user:
token: $TOKEN
contexts:
- name: $CLUSTER_NAME
context:
cluster: $CLUSTER_NAME
user: $CLUSTER_NAME
EOF
#!/bin/bash

if [[ -z "$CLUSTER_NAME" ]]; then
echo "Ensure CLUSTER_NAME has been set"
exit 1
fi

if [[ -z "$CA_CERTIFICATE" ]]; then
echo "Ensure CA_CERTIFICATE has been set to the path of the CA certificate"
exit 1
fi

if [[ -z "$ENDPOINT" ]]; then
echo "Ensure ENDPOINT has been set"
exit 1
fi

if [[ -z "$TOKEN" ]]; then
echo "Ensure TOKEN has been set"
exit 1
fi

export CLUSTER_CA_CERTIFICATE=$(cat "$CA_CERTIFICATE" | base64)

envsubst <<EOF
apiVersion: v1
kind: Config
current-context: $CLUSTER_NAME
clusters:
- name: $CLUSTER_NAME
cluster:
server: https://$ENDPOINT
certificate-authority-data: $CLUSTER_CA_CERTIFICATE
users:
- name: $CLUSTER_NAME
user:
token: $TOKEN
contexts:
- name: $CLUSTER_NAME
context:
cluster: $CLUSTER_NAME
user: $CLUSTER_NAME
EOF
```
</details>
Expand Down

0 comments on commit ba291fd

Please sign in to comment.