diff --git a/.yamllint b/.yamllint index de3d69627..74fa5817d 100644 --- a/.yamllint +++ b/.yamllint @@ -4,3 +4,4 @@ extends: default rules: line-length: disable document-start: disable + new-line-at-end-of-file: disable diff --git a/templates/addons/cluster-autoscaler/cluster-autoscaler.yaml b/templates/addons/cluster-autoscaler/cluster-autoscaler.yaml index 0259cff97..9b4f1e27c 100644 --- a/templates/addons/cluster-autoscaler/cluster-autoscaler.yaml +++ b/templates/addons/cluster-autoscaler/cluster-autoscaler.yaml @@ -16,27 +16,26 @@ spec: app: ${CLUSTER_NAME}-cluster-autoscaler spec: containers: - - image: registry.k8s.io/autoscaling/cluster-autoscaler:${CLUSTER_AUTOSCALER_VERSION} - name: cluster-autoscaler - command: - - /cluster-autoscaler - args: - - --cloud-provider=clusterapi - - --kubeconfig=/mnt/kubeconfig/value - - --clusterapi-cloud-config-authoritative - - --node-group-auto-discovery=clusterapi:namespace=${NAMESPACE},clusterName=${CLUSTER_NAME} - # See: https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#my-cluster-is-below-minimum--above-maximum-number-of-nodes-but-ca-did-not-fix-that-why - - --enforce-node-group-min-size - volumeMounts: - - name: kubeconfig - readOnly: true - mountPath: /mnt/kubeconfig/ + - image: registry.k8s.io/autoscaling/cluster-autoscaler:${CLUSTER_AUTOSCALER_VERSION} + name: cluster-autoscaler + command: [/cluster-autoscaler] + args: + - --cloud-provider=clusterapi + - --kubeconfig=/mnt/kubeconfig/value + - --clusterapi-cloud-config-authoritative + - --node-group-auto-discovery=clusterapi:namespace=${NAMESPACE},clusterName=${CLUSTER_NAME} + # See: https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#my-cluster-is-below-minimum--above-maximum-number-of-nodes-but-ca-did-not-fix-that-why + - --enforce-node-group-min-size + volumeMounts: + - name: kubeconfig + readOnly: true + mountPath: /mnt/kubeconfig/ serviceAccountName: ${CLUSTER_NAME}-cluster-autoscaler terminationGracePeriodSeconds: 10 volumes: - - name: kubeconfig - secret: - secretName: ${CLUSTER_NAME}-kubeconfig + - name: kubeconfig + secret: + secretName: ${CLUSTER_NAME}-kubeconfig --- kind: RoleBinding apiVersion: rbac.authorization.k8s.io/v1 @@ -47,8 +46,8 @@ roleRef: kind: Role name: ${CLUSTER_NAME}-cluster-autoscaler subjects: -- kind: ServiceAccount - name: ${CLUSTER_NAME}-cluster-autoscaler + - kind: ServiceAccount + name: ${CLUSTER_NAME}-cluster-autoscaler --- apiVersion: v1 kind: ServiceAccount @@ -60,19 +59,13 @@ apiVersion: rbac.authorization.k8s.io/v1 metadata: name: ${CLUSTER_NAME}-cluster-autoscaler rules: -- apiGroups: - - cluster.x-k8s.io - - infrastructure.cluster.x-k8s.io - resources: - - machinedeployments - - machinedeployments/scale - - machines - - machinesets - - machinepools - - linodemachinetemplates - - linodemachines - verbs: - - get - - list - - update - - watch + - apiGroups: [cluster.x-k8s.io, infrastructure.cluster.x-k8s.io] + resources: + - machinedeployments + - machinedeployments/scale + - machines + - machinesets + - machinepools + - linodemachinetemplates + - linodemachines + verbs: [get, list, update, watch] diff --git a/templates/addons/cluster-resource-set/secret.yaml b/templates/addons/cluster-resource-set/secret.yaml index 554fc1ea9..4bea4a458 100644 --- a/templates/addons/cluster-resource-set/secret.yaml +++ b/templates/addons/cluster-resource-set/secret.yaml @@ -23,7 +23,7 @@ spec: matchLabels: crs: ${CLUSTER_NAME}-crs resources: - - kind: Secret - name: linode-${CLUSTER_NAME}-crs-0 + - kind: Secret + name: linode-${CLUSTER_NAME}-crs-0 strategy: ApplyOnce --- diff --git a/templates/addons/etcd-backup-restore/etcd-backup-restore.yaml b/templates/addons/etcd-backup-restore/etcd-backup-restore.yaml index f8f3425a4..a1b3fa392 100644 --- a/templates/addons/etcd-backup-restore/etcd-backup-restore.yaml +++ b/templates/addons/etcd-backup-restore/etcd-backup-restore.yaml @@ -89,7 +89,7 @@ data: - --etcd-connection-timeout=30s - --delta-snapshot-period=60s - --delta-snapshot-memory-limit=104857600 - - --compress-snapshots=true + - --compress-snapshots=true - --compression-policy=gzip - --cacert=/etc/kubernetes/pki/etcd/ca.crt - --cert=/etc/kubernetes/pki/etcd/healthcheck-client.crt @@ -147,6 +147,6 @@ spec: etcd-backup: "true" cluster: ${CLUSTER_NAME} resources: - - kind: ConfigMap - name: ${CLUSTER_NAME}-etcd-backup-restore-addon + - kind: ConfigMap + name: ${CLUSTER_NAME}-etcd-backup-restore-addon strategy: ApplyOnce diff --git a/templates/addons/etcd-backup-restore/linode-obj.yaml b/templates/addons/etcd-backup-restore/linode-obj.yaml index dd62ec127..f82d21c54 100644 --- a/templates/addons/etcd-backup-restore/linode-obj.yaml +++ b/templates/addons/etcd-backup-restore/linode-obj.yaml @@ -23,6 +23,6 @@ spec: etcd-backup: "true" cluster: ${CLUSTER_NAME} resources: - - kind: Secret - name: ${CLUSTER_NAME}-etcd-backup-bucket-details + - kind: Secret + name: ${CLUSTER_NAME}-etcd-backup-bucket-details strategy: ApplyOnce diff --git a/templates/addons/etcd-backup-restore/sse-key-secret.yaml b/templates/addons/etcd-backup-restore/sse-key-secret.yaml index effd0c6ac..1a5f070fc 100644 --- a/templates/addons/etcd-backup-restore/sse-key-secret.yaml +++ b/templates/addons/etcd-backup-restore/sse-key-secret.yaml @@ -24,6 +24,6 @@ spec: etcd-backup: "true" cluster: ${CLUSTER_NAME} resources: - - kind: Secret - name: ${CLUSTER_NAME}-ssekey + - kind: Secret + name: ${CLUSTER_NAME}-ssekey strategy: ApplyOnce diff --git a/templates/addons/machine-health-check/machinehealthcheck.yaml b/templates/addons/machine-health-check/machinehealthcheck.yaml index 759b2bd61..b630dce0e 100644 --- a/templates/addons/machine-health-check/machinehealthcheck.yaml +++ b/templates/addons/machine-health-check/machinehealthcheck.yaml @@ -20,12 +20,12 @@ spec: matchLabels: cluster.x-k8s.io/deployment-name: ${CLUSTER_NAME}-md-0 unhealthyConditions: - - type: Ready - status: Unknown - timeout: 300s - - type: Ready - status: "False" - timeout: 300s + - type: Ready + status: Unknown + timeout: 300s + - type: Ready + status: "False" + timeout: 300s --- apiVersion: cluster.x-k8s.io/v1beta1 kind: MachineHealthCheck diff --git a/templates/flavors/clusterclass-kubeadm/cluster-template.yaml b/templates/flavors/clusterclass-kubeadm/cluster-template.yaml index d39fda42b..d39551eb7 100644 --- a/templates/flavors/clusterclass-kubeadm/cluster-template.yaml +++ b/templates/flavors/clusterclass-kubeadm/cluster-template.yaml @@ -15,16 +15,16 @@ spec: class: kubeadm version: ${KUBERNETES_VERSION} variables: - - name: region - value: ${LINODE_REGION} - - name: controlPlaneMachineType - value: ${LINODE_CONTROL_PLANE_MACHINE_TYPE} - - name: workerMachineType - value: ${LINODE_MACHINE_TYPE} + - name: region + value: ${LINODE_REGION} + - name: controlPlaneMachineType + value: ${LINODE_CONTROL_PLANE_MACHINE_TYPE} + - name: workerMachineType + value: ${LINODE_MACHINE_TYPE} controlPlane: replicas: ${CONTROL_PLANE_MACHINE_COUNT} workers: machineDeployments: - - class: default-worker - name: md-0 - replicas: ${WORKER_MACHINE_COUNT} + - class: default-worker + name: md-0 + replicas: ${WORKER_MACHINE_COUNT} diff --git a/templates/flavors/clusterclass-kubeadm/clusterClass.yaml b/templates/flavors/clusterclass-kubeadm/clusterClass.yaml index 68bdd2339..c9ac5b8bf 100644 --- a/templates/flavors/clusterclass-kubeadm/clusterClass.yaml +++ b/templates/flavors/clusterclass-kubeadm/clusterClass.yaml @@ -20,18 +20,18 @@ spec: name: kubeadm workers: machineDeployments: - - class: default-worker - template: - bootstrap: - ref: - apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 - kind: KubeadmConfigTemplate - name: kubeadm-worker - infrastructure: - ref: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1 - kind: LinodeMachineTemplate - name: kubeadm-worker + - class: default-worker + template: + bootstrap: + ref: + apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 + kind: KubeadmConfigTemplate + name: kubeadm-worker + infrastructure: + ref: + apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1 + kind: LinodeMachineTemplate + name: kubeadm-worker variables: - name: region required: true diff --git a/templates/flavors/clusterclass-kubeadm/deleteTransformer.yaml b/templates/flavors/clusterclass-kubeadm/deleteTransformer.yaml index bedd856a6..0a818c5af 100644 --- a/templates/flavors/clusterclass-kubeadm/deleteTransformer.yaml +++ b/templates/flavors/clusterclass-kubeadm/deleteTransformer.yaml @@ -64,7 +64,7 @@ patch: |- - op: remove path: /spec/template/spec/version value: -#patch: |- +# patch: |- # $patch: delete # apiVersion: controlplane.cluster.x-k8s.io/v1beta1 # kind: KubeadmControlPlaneTemplate @@ -77,4 +77,4 @@ patch: |- # kind: LinodeMachineTemplate # name: ${CLUSTER_NAME}-control-plane # replicas: ${CONTROL_PLANE_MACHINE_COUNT} -# version: ${KUBERNETES_VERSION} \ No newline at end of file +# version: ${KUBERNETES_VERSION} diff --git a/templates/flavors/k3s/default/k3sControlPlane.yaml b/templates/flavors/k3s/default/k3sControlPlane.yaml index 5347065c8..68eb67081 100644 --- a/templates/flavors/k3s/default/k3sControlPlane.yaml +++ b/templates/flavors/k3s/default/k3sControlPlane.yaml @@ -90,7 +90,7 @@ spec: owner: root:root contentFrom: secret: - key: linode-token-region.yaml + key: linode-token-region.yaml name: linode-${CLUSTER_NAME}-crs-0 serverConfig: disableComponents: diff --git a/templates/flavors/rke2/default/rke2ControlPlane.yaml b/templates/flavors/rke2/default/rke2ControlPlane.yaml index a5c6565c3..506735cb3 100644 --- a/templates/flavors/rke2/default/rke2ControlPlane.yaml +++ b/templates/flavors/rke2/default/rke2ControlPlane.yaml @@ -34,7 +34,7 @@ spec: node-role.kubernetes.io/control-plane: "true" - contentFrom: secret: - key: linode-token-region.yaml + key: linode-token-region.yaml name: linode-${CLUSTER_NAME}-crs-0 owner: root:root path: /var/lib/rancher/rke2/server/manifests/linode-token-region.yaml diff --git a/templates/infra/linodeMachineTemplate.yaml b/templates/infra/linodeMachineTemplate.yaml index f8332052e..760874d73 100644 --- a/templates/infra/linodeMachineTemplate.yaml +++ b/templates/infra/linodeMachineTemplate.yaml @@ -10,8 +10,8 @@ spec: type: ${LINODE_CONTROL_PLANE_MACHINE_TYPE} region: ${LINODE_REGION} interfaces: - - purpose: public - primary: true + - purpose: public + primary: true authorizedKeys: # uncomment to include your ssh key in linode provisioning # - $LINODE_SSH_PUBKEY @@ -27,8 +27,8 @@ spec: type: ${LINODE_MACHINE_TYPE} region: ${LINODE_REGION} interfaces: - - purpose: public - primary: true + - purpose: public + primary: true authorizedKeys: # uncomment to include your ssh key in linode provisioning # - $LINODE_SSH_PUBKEY diff --git a/templates/infra/secret.yaml b/templates/infra/secret.yaml index 0769643c7..ae9c1c3b2 100644 --- a/templates/infra/secret.yaml +++ b/templates/infra/secret.yaml @@ -4,6 +4,6 @@ kind: Secret metadata: name: ${CLUSTER_NAME}-credentials labels: - clusterctl.cluster.x-k8s.io/move: "true" + clusterctl.cluster.x-k8s.io/move: "true" stringData: apiToken: ${LINODE_TOKEN}