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

Commit 8a32813

Browse files
authored
Merge pull request #145 from gianarb/remove-master-from-codebase
remove master from codebase and where possible from docs
2 parents 620918f + 6541d5b commit 8a32813

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ To generate your cluster yaml:
6767
* `SSH_KEY` - The path to an ssh public key to place on all of the machines. If not set, it will use whichever ssh keys are defined for your project.
6868
* `POD_CIDR` - The CIDR to use for your pods; if not set, see defaults below
6969
* `SERVICE_CIDR` - The CIDR to use for your services; if not set, see defaults below
70-
* `MASTER_NODE_TYPE` - The Packet node type to use for control plane nodes; if not set, see defaults below
70+
* `CONTROLPLANE_NODE_TYPE` - The Packet node type to use for control plane nodes; if not set, see defaults below
7171
* `WORKER_NODE_TYPE` - The Packet node type to use for worker nodes; if not set, see defaults below
7272
* `WORKER_MACHINE_COUNT` - The number of worker machines to deploy; if not set, cluster-api itself (not the Packet implementation) defaults to 0 workers.
7373
1. Run the cluster generation command:
@@ -100,9 +100,9 @@ If you do not change the generated `yaml` files, it will use defaults. You can l
100100
* pod CIDR: `172.26.0.0/16`
101101
* service domain: `cluster.local`
102102
* cluster name: `test1-<random>`, where random is a random 5-character string containing the characters `a-z0-9`
103-
* master node type: `t1.small`
103+
* control plane node type: `t1.small`
104104
* worker node type: `t1.small`
105-
* worker and master OS type: `ubuntu_18_04`
105+
* worker and control plane OS type: `ubuntu_18_04`
106106

107107
#### Apply Your Cluster
108108

@@ -128,7 +128,7 @@ The actual machines are deployed using `kubeadm`. The deployment process uses th
128128

129129
1. When a new `Cluster` is created:
130130
* if the appropriate `Secret` does not include a CA key/certificate pair, create one and save it in that `Secret`
131-
2. When a new master `Machine` is created:
131+
2. When a new control plane `Machine` is created:
132132
* retrieve the CA certificate and key from the appropriate Kubernetes `Secret`
133133
* launch a new server instance on Packet
134134
* set the `cloud-init` on the instance to run `kubeadm init`, passing it the CA certificate and key
@@ -156,7 +156,7 @@ When trying to install a new machine, the logic is as follows:
156156
Important notes:
157157

158158
* There can be multiple `machineParams` entries for each `userdata`, enabling one userdata script to be used for more than one combination of OS and Kubernetes versions.
159-
* There are versions both for `controlPlane` and `kubelet`. `master` servers will match both `controlPlane` and `kubelet`; worker nodes will have no `controlPlane` entry.
159+
* There are versions both for `controlPlane` and `kubelet`. `control plane` servers will match both `controlPlane` and `kubelet`; worker nodes will have no `controlPlane` entry.
160160
* The `containerRuntime` is installed as is. The value of `containerRuntime` will be passed to the userdata script as `${CR_PACKAGE}`, to be installed as desired.
161161

162162
## References

api/v1alpha3/tags.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ limitations under the License.
1717
package v1alpha3
1818

1919
const (
20-
MasterTag = "kubernetes.io/role:master"
21-
WorkerTag = "kubernetes.io/role:node"
20+
ControlPlaneTag = "kubernetes.io/role:master"
21+
WorkerTag = "kubernetes.io/role:node"
2222
)

docs/concepts/machine.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This is an example of it:
77
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
88
kind: PacketMachine
99
metadata:
10-
name: "qa-master-0"
10+
name: "qa-controlplane-0"
1111
spec:
1212
OS: "ubuntu_18_04"
1313
billingCycle: hourly
@@ -42,7 +42,7 @@ You can specify the reservation ID using the field `hardwareReservationID`:
4242
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
4343
kind: PacketMachine
4444
metadata:
45-
name: "qa-master-0"
45+
name: "qa-controlplane-0"
4646
spec:
4747
OS: "ubuntu_18_04"
4848
facility:

pkg/cloud/packet/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func (p *PacketClient) NewDevice(machineScope *scope.MachineScope, extraTags []s
8888
return nil, fmt.Errorf("error executing control-plane userdata template: %v", err)
8989
}
9090
userData = stringWriter.String()
91-
tags = append(tags, infrastructurev1alpha3.MasterTag)
91+
tags = append(tags, infrastructurev1alpha3.ControlPlaneTag)
9292
} else {
9393
tags = append(tags, infrastructurev1alpha3.WorkerTag)
9494
}

pkg/cloud/packet/scope/machine.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func (m *MachineScope) IsControlPlane() bool {
122122
// Role returns the machine role from the labels.
123123
func (m *MachineScope) Role() string {
124124
if util.IsControlPlaneMachine(m.Machine) {
125-
return infrav1.MasterTag
125+
return infrav1.ControlPlaneTag
126126
}
127127
return infrav1.WorkerTag
128128
}

scripts/generate-cluster.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ TEMPLATE_OUT=./out/cluster.yaml
3030
DEFAULT_KUBERNETES_VERSION="v1.18.2"
3131
DEFAULT_POD_CIDR="172.25.0.0/16"
3232
DEFAULT_SERVICE_CIDR="172.26.0.0/16"
33-
DEFAULT_MASTER_NODE_TYPE="t1.small"
33+
DEFAULT_CONTROLPLANE_NODE_TYPE="t1.small"
3434
DEFAULT_WORKER_NODE_TYPE="t1.small"
3535
DEFAULT_NODE_OS="ubuntu_18_04"
3636
DEFAULT_WORKER_MACHINE_COUNT=3
@@ -62,7 +62,7 @@ CLUSTER_NAME=${CLUSTER_NAME:-${DEFAULT_CLUSTER_NAME}}
6262
POD_CIDR=${POD_CIDR:-${DEFAULT_POD_CIDR}}
6363
SERVICE_CIDR=${SERVICE_CIDR:-${DEFAULT_SERVICE_CIDR}}
6464
WORKER_NODE_TYPE=${WORKER_NODE_TYPE:-${DEFAULT_WORKER_NODE_TYPE}}
65-
MASTER_NODE_TYPE=${MASTER_NODE_TYPE:-${DEFAULT_MASTER_NODE_TYPE}}
65+
CONTROLPLANE_NODE_TYPE=${CONTROLPLANE_NODE_TYPE:-${DEFAULT_CONTROLPLANE_NODE_TYPE}}
6666
WORKER_MACHINE_COUNT=${WORKER_MACHINE_COUNT:-${DEFAULT_WORKER_MACHINE_COUNT}}
6767
CONTROL_PLANE_MACHINE_COUNT=${CONTROL_PLANE_MACHINE_COUNT:-${DEFAULT_CONTROL_PLANE_MACHINE_COUNT}}
6868
NODE_OS=${NODE_OS:-${DEFAULT_NODE_OS}}
@@ -73,7 +73,7 @@ PROJECT_ID=${PACKET_PROJECT_ID}
7373
FACILITY=${PACKET_FACILITY}
7474

7575
# and now export them all so envsubst can use them
76-
export PROJECT_ID FACILITY NODE_OS WORKER_NODE_TYPE MASTER_NODE_TYPE POD_CIDR SERVICE_CIDR SSH_KEY KUBERNETES_VERSION WORKER_MACHINE_COUNT CONTROL_PLANE_MACHINE_COUNT
76+
export PROJECT_ID FACILITY NODE_OS WORKER_NODE_TYPE CONTROLPLANE_NODE_TYPE POD_CIDR SERVICE_CIDR SSH_KEY KUBERNETES_VERSION WORKER_MACHINE_COUNT CONTROL_PLANE_MACHINE_COUNT
7777
${CLUSTERCTL} ${CONFIG_OPT} config cluster ${CLUSTER_NAME} --from file://$PWD/templates/cluster-template.yaml > $TEMPLATE_OUT
7878

7979
echo "Done! See output file at ${TEMPLATE_OUT}. Run:"

0 commit comments

Comments
 (0)