Skip to content

Commit

Permalink
working 3 node bare metal build/destroy/rebuild from scratch
Browse files Browse the repository at this point in the history
  • Loading branch information
usrbinkat authored Aug 29, 2024
1 parent bbbce69 commit 27c72f0
Show file tree
Hide file tree
Showing 12 changed files with 186 additions and 327 deletions.
4 changes: 2 additions & 2 deletions Pulumi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ config:
cert_manager:
value:
enabled: true
version: 1.15.1
version: 1.15.3
kubevirt:
value:
enabled: true
version: 1.3.0
version: 1.3.1
hostpath_provisioner:
value:
enabled: true
Expand Down
38 changes: 19 additions & 19 deletions docs/example.machineconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ machine:

# Used to provide additional options to the kubelet.
kubelet:
image: ghcr.io/siderolabs/kubelet:v1.30.3 # The `image` field is an optional reference to an alternative kubelet image.
image: ghcr.io/siderolabs/kubelet:v1.30.4 # The `image` field is an optional reference to an alternative kubelet image.
defaultRuntimeSeccompProfileEnabled: true # Enable container runtime default Seccomp profile.
disableManifestsDirectory: true # The `disableManifestsDirectory` field configures the kubelet to get static pod manifests from the /etc/kubernetes/manifests directory.

# # The `ClusterDNS` field is an optional reference to an alternative kubelet clusterDNS ip list.
# clusterDNS:
# - 10.96.0.10
Expand Down Expand Up @@ -82,7 +82,7 @@ machine:
# gateway: 192.168.2.1 # The route's gateway (if empty, creates link scope route).
# metric: 1024 # The optional metric for the route.
# mtu: 1500 # The interface's MTU.
#
#
# # # Picks a network device using the selector.

# # # select a device with bus prefix 00:*.
Expand Down Expand Up @@ -182,7 +182,7 @@ machine:
disk: /dev/sda # The disk used for installations.
image: ghcr.io/siderolabs/installer:v1.7.6 # Allows for supplying the image used to perform the installation.
wipe: false # Indicates if the installation disk should be wiped at installation time.

# # Look up disk using disk attributes like model, size, serial and others.
# diskSelector:
# size: 4GB # Disk size.
Expand Down Expand Up @@ -213,12 +213,12 @@ machine:
# # The TLS configuration for the registry.
# tls:
# insecureSkipVerify: true # Skip TLS server certificate verification (not recommended).
#
#
# # # Enable mutual TLS authentication with the registry.
# # clientIdentity:
# # crt: LS0tIEVYQU1QTEUgQ0VSVElGSUNBVEUgLS0t
# # key: LS0tIEVYQU1QTEUgS0VZIC0tLQ==
#
#
# # # The auth configuration for this registry.
# # auth:
# # username: username # Optional registry authentication.
Expand All @@ -237,7 +237,7 @@ machine:
# Configures host DNS caching resolver.
hostDNS:
enabled: true # Enable host DNS caching resolver.

# # Configure Talos API access from Kubernetes pods.
# kubernetesTalosAPIAccess:
# enabled: true # Enable Talos API access from Kubernetes pods.
Expand All @@ -247,7 +247,7 @@ machine:
# # The list of Kubernetes namespaces Talos API access is available from.
# allowedKubernetesNamespaces:
# - kube-system

# # Provides machine specific control plane configuration options.

# # ControlPlane definition example.
Expand Down Expand Up @@ -280,7 +280,7 @@ machine:
# # A list of partitions to create on the disk.
# partitions:
# - mountpoint: /var/mnt/extra # Where to mount the partition.
#
#
# # # The size of partition: either bytes or human readable representation. If `size:` is omitted, the partition is sized to occupy the full disk.

# # # Human readable representation.
Expand Down Expand Up @@ -344,11 +344,11 @@ machine:
# - # Deterministically generated key from the node UUID and PartitionLabel.
# nodeID: {}
# slot: 0 # Key slot number for LUKS2 encryption.
#
#
# # # KMS managed encryption key.
# # kms:
# # endpoint: https://192.168.88.21:4443 # KMS endpoint to Seal/Unseal the key.
#
#
# # # Cipher kind to use for the encryption. Depends on the encryption provider.
# # cipher: aes-xts-plain64

Expand Down Expand Up @@ -414,7 +414,7 @@ cluster:
# The service subnet CIDR.
serviceSubnets:
- 10.96.0.0/12

# # The CNI used.
# cni:
# name: custom # Name of CNI to use.
Expand All @@ -436,7 +436,7 @@ cluster:
key: LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlKS2dJQkFBS0NBZ0VBMjdlaEc2M0hubHJkakpWWFdlUXdxTE9PN2duVmpEaVByd1orMVd5QTBHZ0t0TXhHClZYNk5NKzJhYzNHZkQrWW1uU3pHM0N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UUVBemprUHd2Qnp4YTFuS25kRVFRby8wbDNOb1puTXJBMWNORFRNM3N3MHdvTzNHTjgzVEZNVwpjUmdYb1lNamEzL1RWalRKb1hDYmU1SExETktUQnRod05OMmNMb2I3aUhReWs3b2UvaDhmRnRGYlBwV1FvTUJECnkyTFp3ZDdMcy9JVFpuTUVraVZoL3U4cUIrSXBWdlFlVWZxNHBlUFgyN2hyWWRwOVdUMy9tbk9qMGpGSHBUakQKVThDT0xxY0thNHE5UEh5cVduQUZLQ3owSmNKTWJNTS84UmNqZmp5MVkrQVVrWTFCNjZQTjQyVlZwZjFFazlybgp2dFBNRzR6RzRyNkZDVUhUUThUNThVTkhqb2tYb3dGUlJZemc1aWFsUG9Zb0VCM0xGZ3ZpNFhvRkt2WFh2NVNiCmp0WEZQdzd6aCtHSStqTzYvQ1I3Tm9iYTdrZG13NjViclFLQ0FRRUFqbDFML1dIQmpCUGYwM2FweFkzT3Q5ZWkKLzE1UEtYQVVnc3JpaFNOd3UxSERuNUcrT1VtUldWTWlncTlzWWNGWWdhSm4zNTliczJpL1RheDE4ZWdTZVhBagozSDhQQWRIRGVGSEI0K1ZmdVF5aCtxTXAxYWJQU2ZwWnV3dXY5VzNvSkpNcUhkQUo2bmtCMG9QNkN2TDlGeldCCkRzZ0dnZlFGTE9Ud1pucXVHZ1J1NGxuVmZabGliQzZlSnlBelZydXFDd2JqOHBFKzEwSFd1eUV1d1BqRURKVnoKVHFEa3B2UHRxMUdLK2lpeWk4emcvOXgzdzNyaGpOZENFRmhNZ3RtdHM4MXdHdVpxY1RqczB6eXd0cm1vYzJBSQpaWHllaUMvdk5vSW5pSzVRMWlqSHNVcnAzWVNPSCtEdmo3Skc0djM5ZWwyRm9WVjFlaS8ybFV0TUdwZ2hudz09Ci0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg==
# API server specific configuration options.
apiServer:
image: registry.k8s.io/kube-apiserver:v1.30.3 # The container image used in the API server manifest.
image: registry.k8s.io/kube-apiserver:v1.30.4 # The container image used in the API server manifest.
# Extra certificate subject alternative names for the API server's certificate.
certSANs:
- 127.0.0.1
Expand Down Expand Up @@ -468,16 +468,16 @@ cluster:
- level: Metadata
# Controller manager server specific configuration options.
controllerManager:
image: registry.k8s.io/kube-controller-manager:v1.30.3 # The container image used in the controller manager manifest.
image: registry.k8s.io/kube-controller-manager:v1.30.4 # The container image used in the controller manager manifest.
# Kube-proxy server-specific configuration options
proxy:
image: registry.k8s.io/kube-proxy:v1.30.3 # The container image used in the kube-proxy manifest.
image: registry.k8s.io/kube-proxy:v1.30.4 # The container image used in the kube-proxy manifest.

# # Disable kube-proxy deployment on cluster bootstrap.
# disabled: false
# Scheduler server specific configuration options.
scheduler:
image: registry.k8s.io/kube-scheduler:v1.30.3 # The container image used in the scheduler manifest.
image: registry.k8s.io/kube-scheduler:v1.30.4 # The container image used in the scheduler manifest.
# Configures cluster member discovery.
discovery:
enabled: true # Enable the cluster membership discovery feature.
Expand All @@ -496,7 +496,7 @@ cluster:
ca:
crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUJmakNDQVNTZ0F3SUJBZ0lSQUkrSVdIeTk2bUIrdTh4cXhubmNnZ2t3Q2dZSUtvWkl6ajBFQXdJd0R6RU4KTUFzR0ExVUVDaE1FWlhSalpEQWVGdzB5TkRBNE1qZ3lNRFExTXpKYUZ3MHpOREE0TWpZeU1EUTFNekphTUE4eApEVEFMQmdOVkJBb1RCR1YwWTJRd1dUQVRCZ2NxaGtqT1BRSUJCZ2dxaGtqT1BRTUJCd05DQUFUVHdUVFVFcytiCm9tNi9VZlFTZ1dyYzBiOEV1SkJxYy95dk9LcjlsczlSMW9kdUtacHliTzM2UGMyelBaZWk2L0RNeVRHR09VL0wKSC9mc0pqTUJncFZ5bzJFd1h6QU9CZ05WSFE4QkFmOEVCQU1DQW9Rd0hRWURWUjBsQkJZd0ZBWUlLd1lCQlFVSApBd0VHQ0NzR0FRVUZCd01DTUE4R0ExVWRFd0VCL3dRRk1BTUJBZjh3SFFZRFZSME9CQllFRkZ6Z24yN3h5eStICm4ySEZUYzBEM09nVjNXcy9NQW9HQ0NxR1NNNDlCQU1DQTBnQU1FVUNJRllpUkZheUpCUUF1eGw5VVhrTE9GRmEKcVhIUHlORllrYk9oaU00ZVdhd2RBaUVBN2RVWkVieGIyZDlCd0g0cE4zNm1sZHY1V2dRVXhGaXZPSERaNjhRQgoyYkU9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K
key: LS0tLS1CRUdJTiBFQyBQUklWQVRFIEtFWS0tLS0tCk1IY0NBUUVFSU9UYmRPczlXV2Z4UUw1OXZKSExoSnFDcnpmVGpOQkpUclhlSkFSYlZXNUNvQW9HQ0NxR1NNNDkKQXdFSG9VUURRZ0FFMDhFMDFCTFBtNkp1djFIMEVvRnEzTkcvQkxpUWFuUDhyemlxL1piUFVkYUhiaW1hY216dAorajNOc3oyWG91dnd6TWt4aGpsUHl4LzM3Q1l6QVlLVmNnPT0KLS0tLS1FTkQgRUMgUFJJVkFURSBLRVktLS0tLQo=

# # The container image used to create the etcd service.
# image: gcr.io/etcd-development/etcd:v3.5.13

Expand All @@ -517,7 +517,7 @@ cluster:
# metadata:
# name: ci


# # A key used for the [encryption of secret data at rest](https://kubernetes.io/docs/tasks/administer-cluster/encrypt-data/).

# # Decryption secret example (do not use in production!).
Expand Down
16 changes: 10 additions & 6 deletions docs/hack/pod-pvc-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,25 @@ spec:
storage: 1Gi
storageClassName: ssd
volumeMode: Filesystem
volumeName: nginx-pv
---
apiVersion: v1
kind: Pod
metadata:
name: nginx-pod
annotations:
kubernetes.io/psp: restricted
seccomp.security.alpha.kubernetes.io/pod: 'runtime/default'
apparmor.security.beta.kubernetes.io/allowedProfileNames: 'runtime/default'
apparmor.security.beta.kubernetes.io/defaultProfileName: 'runtime/default'
spec:
securityContext:
seccompProfile:
type: RuntimeDefault
containers:
- name: nginx-container
image: nginx
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: ["ALL"]
runAsNonRoot: false
seccompProfile:
type: RuntimeDefault
resources:
limits:
cpu: "0.5"
Expand Down
55 changes: 15 additions & 40 deletions docs/hack/ubuntu-br0-persistent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,48 +9,26 @@ spec:
registry:
url: "docker://docker.io/containercraft/ubuntu:22.04"
pvc:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 256G
storageClassName: "ssd"
volumeMode: Filesystem
resources:
requests:
storage: 64G
accessModes:
- ReadWriteOnce
---
# ssh-keygen: kubectl create secret generic user-kc2-sshpubkey --from-file=key1=.ssh/id_rsa.pub --dry-run=client -oyaml | kubectl apply -f -
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
name: ubuntu
name: ubuntu-br0-persistent
namespace: default
labels:
app: kc2
app: ubuntu
feature: xrdp
spec:
running: true
template:
spec:
nodeSelector:
kubernetes.io/hostname: "mordor"
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- "mordor"
#nodeSelector:
# kubernetes.io/hostname: "op1"
#affinity:
# nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# nodeSelectorTerms:
# - matchExpressions:
# - key: kubernetes.io/hostname
# operator: In
# values:
# - "op1"
domain:
clock:
utc: {}
Expand All @@ -68,7 +46,12 @@ spec:
model: host-passthrough
dedicatedCpuPlacement: false
memory:
guest: 8192M
guest: 8G
machine:
type: q35
resources:
requests:
memory: 8G
devices:
rng: {}
autoattachPodInterface: false
Expand All @@ -95,25 +78,17 @@ spec:
bootloader:
efi:
secureBoot: true
machine:
type: q35
resources:
requests:
memory: 8192M
hostname: ccio
networks:
- name: enp1s0
multus:
networkName: lan
- name: enp2s0
multus:
networkName: br0
terminationGracePeriodSeconds: 0
accessCredentials:
- sshPublicKey:
source:
secret:
secretName: user-kc2-sshpubkey
secretName: kc2-pubkey
propagationMethod:
qemuGuestAgent:
users:
Expand Down
4 changes: 2 additions & 2 deletions docs/hack/ubuntu-br0.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
name: ubuntu
name: ubuntu-br0
namespace: default
labels:
app: kc2
Expand Down Expand Up @@ -68,7 +68,7 @@ spec:
- sshPublicKey:
source:
secret:
secretName: user-kc2-sshpubkey
secretName: kc2-pubkey
propagationMethod:
qemuGuestAgent:
users:
Expand Down
Loading

0 comments on commit 27c72f0

Please sign in to comment.