Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Commit 3d0999f

Browse files
authored
Merge pull request #102 from packethost/merged-readme
update README to use clusterctl with built-in packet provider
2 parents e706602 + 32f9e24 commit 3d0999f

File tree

2 files changed

+7
-24
lines changed

2 files changed

+7
-24
lines changed

README.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,9 @@ To initialize the cluster, you need to provider it with the path to the config f
5151
1. Use the config file.
5252

5353
```
54-
VERSION=v0.3.0
55-
curl -L -o clusterctl.yaml https://github.com/packethost/cluster-api-provider-packet/releases/download/${VERSION}/clusterctl.yaml
56-
clusterctl --config=./clusterctl.yaml init --infrastructure=packet
54+
clusterctl init --infrastructure=packet
5755
```
5856

59-
Unfortunately, clusterctl itself does not support passing a URL to `--config`, see [this issue](https://github.com/kubernetes-sigs/cluster-api/issues/3099).
60-
61-
Additionally, we are in the process of working with the core cluster-api team, so that you will not need the
62-
`--config=` option, hopefully soon.
63-
6457
#### Generate Cluster yaml
6558

6659
To generate your cluster yaml:
@@ -80,7 +73,7 @@ To generate your cluster yaml:
8073
1. Run the cluster generation command:
8174

8275
```
83-
clusterctl --config=./clusterctl.yaml config cluster <cluster-name> > out/cluster.yaml
76+
clusterctl config cluster <cluster-name> > out/cluster.yaml
8477
```
8578

8679
Note that the above command will make _all_ of the environment variables required. This is a limitation of

scripts/generate-cluster.sh

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,14 @@
22

33
set -e
44

5-
# default configure URL
6-
DEFAULT_CONFIG_URL=https://api.github.com/repos/packethost/cluster-api-provider-packet/releases/latest
7-
TMPYAML=/tmp/clusterctl-packet.yaml
8-
95
# might want to use a specific path to clusterctl
106
CLUSTERCTL=${CLUSTERCTL:-clusterctl}
117

8+
# might want to use a specific config URL
129
CONFIG_URL=${CONFIG_URL:-""}
13-
14-
# if the config url was not provided, download it
15-
if [ -z "${CONFIG_URL}" ]; then
16-
# because github does not have a direct link to an asset
17-
# this would be easier with jq, but not everyone has jq installed
18-
YAML_URL=$(curl -s ${DEFAULT_CONFIG_URL} | grep clusterctl.yaml | grep browser_download_url | cut -d ":" -f 2,3 | tr -d "\"")
19-
curl -L -o ${TMPYAML} ${YAML_URL}
20-
CONFIG_URL=${TMPYAML}
10+
CONFIG_OPT=${CONFIG_OPT:-""}
11+
if [ -n "$CONFIG_URL" ]; then
12+
CONFIG_OPT="--config ${CONFIG_URL}"
2113
fi
2214

2315
TEMPLATE_OUT=./out/cluster.yaml
@@ -65,9 +57,7 @@ FACILITY=${PACKET_FACILITY}
6557

6658
# and now export them all so envsubst can use them
6759
export PROJECT_ID FACILITY NODE_OS WORKER_NODE_TYPE MASTER_NODE_TYPE POD_CIDR SERVICE_CIDR SSH_KEY KUBERNETES_VERSION
68-
${CLUSTERCTL} --config=${CONFIG_URL} config cluster ${CLUSTER_NAME} > $TEMPLATE_OUT
69-
# remove any lingering config file
70-
rm -f ${TMPYAML}
60+
${CLUSTERCTL} ${CONFIG_OPT} config cluster ${CLUSTER_NAME} > $TEMPLATE_OUT
7161

7262
echo "Done! See output file at ${TEMPLATE_OUT}. Run:"
7363
echo " kubectl apply -f ${TEMPLATE_OUT}"

0 commit comments

Comments
 (0)