Skip to content

Commit

Permalink
[CI] [fix]: run yamllint as part of build_test_ci workflow, fix white…
Browse files Browse the repository at this point in the history
…space/indentation issues (#329)

* run yamllint as part of build_test_ci workflow

* try workaround from https://github.com/release-drafter/release-drafter/issues/1125\#issuecomment-1471142225

* format yaml so it passes yamllint
  • Loading branch information
AshleyDumaine authored May 23, 2024
1 parent ccdda60 commit 2dc40c4
Show file tree
Hide file tree
Showing 17 changed files with 93 additions and 82 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/build_test_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ jobs:
- '!**/**.md'
- '!docs/**'
yamllint:
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.src == 'true' }}
steps:
- uses: actions/checkout@v4
- name: Validate YAML file
run: yamllint templates

go-build-test:
runs-on: ubuntu-latest
needs: changes
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v6
with:
commitish: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7 changes: 7 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
extends: default

rules:
line-length: disable
document-start: disable
new-line-at-end-of-file: disable
2 changes: 1 addition & 1 deletion templates/addons/cilium/cilium.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
egressMasqueradeInterfaces: eth0
policyAuditMode: ${FW_AUDIT_ONLY:=true}
hostFirewall:
enabled: true
enabled: true
extraConfig:
allow-localhost: policy
k8sServiceHost: {{ .InfraCluster.spec.controlPlaneEndpoint.host }}
Expand Down
65 changes: 29 additions & 36 deletions templates/addons/cluster-autoscaler/cluster-autoscaler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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]
4 changes: 2 additions & 2 deletions templates/addons/cluster-resource-set/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
---
6 changes: 3 additions & 3 deletions templates/addons/etcd-backup-restore/etcd-backup-restore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions templates/addons/etcd-backup-restore/linode-obj.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions templates/addons/etcd-backup-restore/sse-key-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 6 additions & 6 deletions templates/addons/machine-health-check/machinehealthcheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 9 additions & 9 deletions templates/flavors/clusterclass-kubeadm/cluster-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
24 changes: 12 additions & 12 deletions templates/flavors/clusterclass-kubeadm/clusterClass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions templates/flavors/clusterclass-kubeadm/deleteTransformer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -77,4 +77,4 @@ patch: |-
# kind: LinodeMachineTemplate
# name: ${CLUSTER_NAME}-control-plane
# replicas: ${CONTROL_PLANE_MACHINE_COUNT}
# version: ${KUBERNETES_VERSION}
# version: ${KUBERNETES_VERSION}
2 changes: 1 addition & 1 deletion templates/flavors/k3s/default/k3sControlPlane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion templates/flavors/rke2/default/rke2ControlPlane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions templates/infra/linodeMachineTemplate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion templates/infra/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}

0 comments on commit 2dc40c4

Please sign in to comment.