Skip to content

Instantly share code, notes, and snippets.

View guangbochen's full-sized avatar
👨‍👩‍👧‍👦
orchestration

Guangbo guangbochen

👨‍👩‍👧‍👦
orchestration
View GitHub Profile
@guangbochen
guangbochen / rke2-commands.md
Created November 26, 2023 14:00 — forked from superseb/rke2-commands.md
RKE2 commands

RKE2 commands

Install

curl -sL https://get.rke2.io | sh
systemctl daemon-reload
systemctl start rke2-server
apiVersion: provisioning.cattle.io/v1
kind: Cluster
metadata:
annotations:
field.cattle.io/creatorId: user-2hb4j
creationTimestamp: "2021-09-14T15:18:49Z"
finalizers:
- wrangler.cattle.io/provisioning-cluster-remove
generation: 3
name: rke2-test
creating a file to work with
1175000+0 records in
1175000+0 records out
601600000 bytes (602 MB) copied, 5.6939 s, 106 MB/s
Testing block size = 1k
587500+0 records in
587500+0 records out
601600000 bytes (602 MB) copied, 4.45826 s, 135 MB/s
Testing block size = 2k
cat <<EOF | kubectl create -f -
apiVersion: v1
kind: Pod
metadata:
name: samplepod-2
annotations:
k8s.v1.cni.cncf.io/networks: '[
{
"name": "ovs-ipam-net",
"ips": ["10.10.10.1/24"]
#!/bin/bash
set -e
function prepare(){
#precheck
echo "Pre-checking..."
command -v fdisk >/dev/null 2>&1 || { echo >&2 "fdisk is required but it's not installed. Please install it first."; exit 1; }
command -v mkfs.ext4 >/dev/null 2>&1 || { echo >&2 "mkfs.ext4 is required but it's not installed. Please install it first."; exit 1; }
command -v mount >/dev/null 2>&1 || { echo >&2 "mount is required but it's not installed. Please install it first."; exit 1; }
echo "Pre-checking done"
#!/bin/bash
set -e
[ -z "${MYSQL_PASSWD}" ] && MYSQL_PASSWD=root
[ -z "${MYSQL_ADMIN_USER}" ] && MYSQL_ADMIN_USER=wordpress
[ -z "${MYSQL_ADMIN_PASSWD}" ] && MYSQL_ADMIN_PASSWD=wordpress
mysql_install()
{
apiVersion: kubevirt.io/v1alpha3
kind: VirtualMachine
metadata:
name: centos-net2
spec:
dataVolumeTemplates:
- metadata:
name: centos-net2-rootdisk-kfg0p
spec:
pvc:
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
name: ubuntu
spec:
dataVolumeTemplates:
- metadata:
name: ubuntu-disk
spec:
pvc:
apiVersion: kubevirt.io/v1alpha3
kind: VirtualMachine
metadata:
name: k3os-img
spec:
dataVolumeTemplates:
- metadata:
name: k3os-cdroom-disk
spec:
pvc:
apiVersion: k8s.cni.cncf.io/v1
kind: NetworkAttachmentDefinition
metadata:
name: macvlan-conf
namespace: default
spec:
config: '{
"cniVersion": "0.3.0",
"type": "macvlan",
"master": "eth0",