This repository was archived by the owner on Aug 12, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +26
-5
lines changed Expand file tree Collapse file tree 2 files changed +26
-5
lines changed Original file line number Diff line number Diff line change @@ -44,13 +44,20 @@ To deploy a cluster via the cluster-api:
44
44
45
45
#### Initialize the Cluster
46
46
47
- To initialize the cluster:
47
+ To initialize the cluster, you need to provider it with the path to the config file.
48
+
49
+ 1 . Download the clusterctl config file for your release.
50
+ 1 . Use the config file.
48
51
49
52
```
50
- clusterctl --config=https://github.com/packethost/cluster-api-provider-packet/releases/latest/clusterctl.yaml init --infrastructure=packet
53
+ VERSION=v0.3.0
54
+ curl -L -o clusterctl.yaml https://github.com/packethost/cluster-api-provider-packet/releases/download/${VERSION}/clusterctl.yaml
55
+ clusterctl --config=./clusterctl.yaml init --infrastructure=packet
51
56
```
52
57
53
- We are in the process of working with the core cluster-api team, so that you will not need the
58
+ Unfortunately, clusterctl itself does not support passing a URL to ` --config ` , see [ this issue] ( https://github.com/kubernetes-sigs/cluster-api/issues/3099 ) .
59
+
60
+ Additionally, we are in the process of working with the core cluster-api team, so that you will not need the
54
61
` --config= ` option, hopefully soon.
55
62
56
63
#### Generate Cluster yaml
@@ -71,7 +78,7 @@ To generate your cluster yaml:
71
78
1 . Run the cluster generation command:
72
79
73
80
```
74
- clusterctl --config=https://github.com/packethost/cluster-api-provider-packet/releases/latest /clusterctl.yaml config cluster <cluster-name> > out/cluster.yaml
81
+ clusterctl --config=. /clusterctl.yaml config cluster <cluster-name> > out/cluster.yaml
75
82
```
76
83
77
84
Note that the above command will make _ all_ of the environment variables required. This is a limitation of
Original file line number Diff line number Diff line change 3
3
set -e
4
4
5
5
# default configure URL
6
- CONFIG_URL=${CONFIG_URL:- https:// github.com/ packethost/ cluster-api-provider-packet/ releases/ latest/ clusterctl.yaml}
6
+ DEFAULT_CONFIG_URL=https://api.github.com/repos/packethost/cluster-api-provider-packet/releases/latest
7
+ TMPYAML=/tmp/clusterctl-packet.yaml
8
+
9
+ CONFIG_URL=${CONFIG_URL:- " " }
10
+
11
+ # if the config url was not provided, download it
12
+ if [ -z " ${CONFIG_URL} " ]; then
13
+ # because github does not have a direct link to an asset
14
+ # this would be easier with jq, but not everyone has jq installed
15
+ YAML_URL=$( curl -s ${DEFAULT_CONFIG_URL} | grep clusterctl.yaml | grep browser_download_url | cut -d " :" -f 2,3 | tr -d " \" " )
16
+ curl -L -o ${TMPYAML} ${YAML_URL}
17
+ CONFIG_URL=${TMPYAML}
18
+ fi
7
19
8
20
TEMPLATE_OUT=./out/cluster.yaml
9
21
@@ -51,6 +63,8 @@ FACILITY=${PACKET_FACILITY}
51
63
# and now export them all so envsubst can use them
52
64
export PROJECT_ID FACILITY NODE_OS WORKER_NODE_TYPE MASTER_NODE_TYPE POD_CIDR SERVICE_CIDR SSH_KEY KUBERNETES_VERSION
53
65
clusterctl --config=${CONFIG_URL} config cluster ${CLUSTER_NAME} > $TEMPLATE_OUT
66
+ # remove any lingering config file
67
+ rm -f ${TMPYAML}
54
68
55
69
echo " Done! See output file at ${TEMPLATE_OUT} . Run:"
56
70
echo " kubectl apply -f ${TEMPLATE_OUT} "
You can’t perform that action at this time.
0 commit comments