Skip to content

Instantly share code, notes, and snippets.

@lastcoolnameleft
Last active July 16, 2021 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lastcoolnameleft/efd331383af7aa8c6b84fa4490701ae0 to your computer and use it in GitHub Desktop.
Save lastcoolnameleft/efd331383af7aa8c6b84fa4490701ae0 to your computer and use it in GitHub Desktop.
Kernel Addon
apiVersion: cluster.x-k8s.io/v1alpha4
kind: Cluster
metadata:
labels:
cni: calico
name: capi-quickstart
namespace: default
spec:
clusterNetwork:
pods:
cidrBlocks:
- 192.168.0.0/16
controlPlaneRef:
apiVersion: controlplane.cluster.x-k8s.io/v1alpha4
kind: KubeadmControlPlane
name: capi-quickstart-control-plane
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
kind: AzureCluster
name: capi-quickstart
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
kind: AzureCluster
metadata:
name: capi-quickstart
namespace: default
spec:
identityRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
kind: AzureClusterIdentity
name: cluster-identity
location: southcentralus
networkSpec:
vnet:
name: capi-quickstart-vnet
resourceGroup: capi-quickstart
subscriptionID: df8428d4-bc25-4601-b458-1c8533ceec0b
---
apiVersion: controlplane.cluster.x-k8s.io/v1alpha4
kind: KubeadmControlPlane
metadata:
name: capi-quickstart-control-plane
namespace: default
spec:
kubeadmConfigSpec:
clusterConfiguration:
apiServer:
extraArgs:
cloud-config: /etc/kubernetes/azure.json
cloud-provider: azure
extraVolumes:
- hostPath: /etc/kubernetes/azure.json
mountPath: /etc/kubernetes/azure.json
name: cloud-config
readOnly: true
timeoutForControlPlane: 20m
controllerManager:
extraArgs:
allocate-node-cidrs: "false"
cloud-config: /etc/kubernetes/azure.json
cloud-provider: azure
cluster-name: capi-quickstart
extraVolumes:
- hostPath: /etc/kubernetes/azure.json
mountPath: /etc/kubernetes/azure.json
name: cloud-config
readOnly: true
etcd:
local:
dataDir: /var/lib/etcddisk/etcd
diskSetup:
filesystems:
- device: /dev/disk/azure/scsi1/lun0
extraOpts:
- -E
- lazy_itable_init=1,lazy_journal_init=1
filesystem: ext4
label: etcd_disk
- device: ephemeral0.1
filesystem: ext4
label: ephemeral0
replaceFS: ntfs
partitions:
- device: /dev/disk/azure/scsi1/lun0
layout: true
overwrite: false
tableType: gpt
files:
- contentFrom:
secret:
key: control-plane-azure.json
name: capi-quickstart-control-plane-azure-json
owner: root:root
path: /etc/kubernetes/azure.json
permissions: "0644"
initConfiguration:
nodeRegistration:
kubeletExtraArgs:
azure-container-registry-config: /etc/kubernetes/azure.json
cloud-config: /etc/kubernetes/azure.json
cloud-provider: azure
name: '{{ ds.meta_data["local_hostname"] }}'
joinConfiguration:
nodeRegistration:
kubeletExtraArgs:
azure-container-registry-config: /etc/kubernetes/azure.json
cloud-config: /etc/kubernetes/azure.json
cloud-provider: azure
name: '{{ ds.meta_data["local_hostname"] }}'
mounts:
- - LABEL=etcd_disk
- /var/lib/etcddisk
machineTemplate:
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
kind: AzureMachineTemplate
name: capi-quickstart-control-plane
replicas: 1
version: v1.21.2
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
kind: AzureMachineTemplate
metadata:
name: capi-quickstart-control-plane
namespace: default
spec:
template:
spec:
dataDisks:
- diskSizeGB: 256
lun: 0
nameSuffix: etcddisk
osDisk:
diskSizeGB: 128
osType: Linux
sshPublicKey: ""
vmSize: Standard_D2s_v3
---
apiVersion: cluster.x-k8s.io/v1alpha4
kind: MachineDeployment
metadata:
name: capi-quickstart-md-0
namespace: default
spec:
clusterName: capi-quickstart
replicas: 3
selector:
matchLabels: null
template:
spec:
bootstrap:
configRef:
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4
kind: KubeadmConfigTemplate
name: capi-quickstart-md-0
clusterName: capi-quickstart
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
kind: AzureMachineTemplate
name: capi-quickstart-md-0
version: v1.21.2
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
kind: AzureMachineTemplate
metadata:
name: capi-quickstart-md-0
namespace: default
spec:
template:
spec:
osDisk:
diskSizeGB: 128
osType: Linux
sshPublicKey: ""
vmSize: Standard_D2s_v3
---
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4
kind: KubeadmConfigTemplate
metadata:
name: capi-quickstart-md-0
namespace: default
spec:
template:
spec:
preKubeadmCommands:
- wget -P /tmp https://kernel.ubuntu.com/~rtg/azure-rt-group-sched-sf00314473/amd64/linux-image-unsigned-5.4.0-1053-azure_5.4.0-1053.55~SF00314473.1_amd64.deb
- wget -P /tmp https://kernel.ubuntu.com/~rtg/azure-rt-group-sched-sf00314473/amd64/linux-modules-5.4.0-1053-azure_5.4.0-1053.55~SF00314473.1_amd64.deb
- wget -P /tmp https://kernel.ubuntu.com/~rtg/azure-rt-group-sched-sf00314473/amd64/linux-modules-extra-5.4.0-1053-azure_5.4.0-1053.55~SF00314473.1_amd64.deb
- dpkg -i /tmp/linux-image-unsigned-5.4.0-1053-azure_5.4.0-1053.55~SF00314473.1_amd64.deb /tmp/linux-modules-extra-5.4.0-1053-azure_5.4.0-1053.55~SF00314473.1_amd64.deb /tmp/linux-modules-5.4.0-1053-azure_5.4.0-1053.55~SF00314473.1_amd64.deb
postKubeadmCommands:
- reboot
files:
- contentFrom:
secret:
key: worker-node-azure.json
name: capi-quickstart-md-0-azure-json
owner: root:root
path: /etc/kubernetes/azure.json
permissions: "0644"
joinConfiguration:
nodeRegistration:
kubeletExtraArgs:
azure-container-registry-config: /etc/kubernetes/azure.json
cloud-config: /etc/kubernetes/azure.json
cloud-provider: azure
name: '{{ ds.meta_data["local_hostname"] }}'
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
kind: AzureClusterIdentity
metadata:
labels:
clusterctl.cluster.x-k8s.io/move-hierarchy: "true"
name: cluster-identity
namespace: default
spec:
allowedNamespaces: {}
clientID: 276b844f-bb78-4e8f-a908-e6aa78c650df
clientSecret:
name: cluster-identity-secret
namespace: default
tenantID: 72f988bf-86f1-41af-91ab-2d7cd011db47
type: ServicePrincipal
thfalgou@kernel-addon-2-md-0-cvx9n:~$ ls /sys/fs/cgroup/cpu/cpu.rt_period_us
/sys/fs/cgroup/cpu/cpu.rt_period_us
thfalgou@kernel-addon-2-md-0-cvx9n:~$ ls /sys/fs/cgroup/cpu/cpu.rt_runtime_us
/sys/fs/cgroup/cpu/cpu.rt_runtime_us
thfalgou@kernel-addon-2-md-0-cvx9n:~$ grep CONFIG_RT_GROUP_SCHED /boot/config-*
/boot/config-5.4.0-1051-azure:# CONFIG_RT_GROUP_SCHED is not set
/boot/config-5.4.0-1053-azure:CONFIG_RT_GROUP_SCHED=y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment