Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
8cf8257
initial commit
bobsira Oct 12, 2023
8a1ce2a
intial refactoring and seperation of concerns
bobsira Oct 24, 2023
5b3e54a
more updates on the set up scripts
bobsira Oct 31, 2023
b72ec33
more updates to the automation scripts
bobsira Nov 8, 2023
18efcf9
fixes to containerd installation
bobsira Nov 13, 2023
226cc32
changes to VM specification
bobsira Nov 13, 2023
3a48a66
response content cannot be parsed because the Internet Explorer engi…
bobsira Nov 15, 2023
33456f5
fix to containerd start service command
bobsira Nov 18, 2023
12c5727
logical change to replacement of toml conf file
bobsira Nov 19, 2023
fbd7f38
error handling additions
bobsira Nov 19, 2023
3dbc715
updates to NSSM install
bobsira Nov 20, 2023
aec2483
uninstall containerd logic
bobsira Nov 29, 2023
8c9f3d7
added stop containerd serv
bobsira Nov 29, 2023
4b21c83
changes to import statement
bobsira Nov 29, 2023
949cf74
restructed file imports
bobsira Nov 29, 2023
a3488cd
fix for Uninstall-ContainerTool
bobsira Dec 7, 2023
2f71d71
removed containerd uninstalll logic
bobsira Dec 8, 2023
3ba1538
script tp execute the process
bobsira Dec 8, 2023
6c0e96e
fix on parent directory reference
bobsira Dec 8, 2023
4936277
added the missing session declaration
bobsira Dec 8, 2023
1c1900f
changes to flow of execution
Dec 11, 2023
9f16dde
removed unwanted definition
bobsira Dec 11, 2023
85426d6
nssm service check
bobsira Dec 12, 2023
d50cc1e
more error handling code
Dec 12, 2023
c508c38
folder creation error handling
Dec 13, 2023
a4c14e2
fix initialize containerd logic
Dec 14, 2023
9ed7350
indentation fix in hosts file
Dec 14, 2023
f8ff45e
phase one remoting complete
Jan 3, 2024
29505da
containerd setup modification
bobsira Jan 15, 2024
af70e9a
feedback on remote work
bobsira Jan 15, 2024
7f57213
intial authoring of auto install file
Jan 25, 2024
d291652
BIOS/MBR-Based Hard Disk answer file
Jan 30, 2024
7ae051c
setup file to test the configuration
Jan 31, 2024
58c3230
updates for testing
Jan 31, 2024
5306cf7
add auto-unattend iso file
iankingori Feb 1, 2024
c758048
flannel and kube-proxy networking config addition@
bobsira Feb 2, 2024
6109743
Merge pull request #1 from iankingori/bob/iso-setup
bobsira Feb 4, 2024
80d31ee
Merge branch 'vrapolinario:main' into user/bosira/autounattended-wind…
bobsira Feb 4, 2024
1ffcce4
changed from yml to recommended yaml extension
bobsira Feb 4, 2024
b4aae2e
generic computer name
Feb 5, 2024
4aa93e9
computer name changes
Feb 5, 2024
a2e9063
configuring linux nodes
bobsira Feb 5, 2024
cd16c12
better logging to the console
bobsira Feb 6, 2024
956beaf
fixing broken changes
bobsira Feb 6, 2024
aafc3c9
Merge branch 'user/bosira/autounattended-windows-install' of https://…
bobsira Feb 12, 2024
936eb03
draft changes to merge remote and auto-install work
Feb 20, 2024
2411d0e
initial setup to combine the two work
Mar 5, 2024
81a2cd4
final setup to merge auto-install and remote config
Mar 11, 2024
59a7270
final changes, kalkikubes
Mar 11, 2024
e6fbbed
final polish
Mar 19, 2024
62e42bf
added SSH setup during auto-install
bobsira Sep 21, 2024
2fa904f
bundled the new xml answer file into an iso
bobsira Sep 21, 2024
ed08391
fixed the path mismatch value
bobsira Sep 21, 2024
e3beabb
swapped the SSH configuration ordering
bobsira Sep 23, 2024
8398aef
OpenSSH installation in the VM
bobsira Sep 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion automation/Run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ function Run {
[string]$Pass
)

# configure Flannel CNI for Windows
# make sure the flannel daemon set is restarted to reflect the new Windows-specific configuration
& kubectl apply -f "..\kube-flannel.yml"
& kubectl rollout restart ds kube-flannel-ds -n kube-flannel
& kubectl get pods -A

$SecurePassword = ConvertTo-SecureString -String $Pass -AsPlainText -Force
$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $Username, $SecurePassword

Expand Down Expand Up @@ -102,7 +108,14 @@ function Run {

Invoke-Command -VMName $VMName -Credential $Credential -ScriptBlock $ScriptBlock -ArgumentList $JoinCommand

# windows node successfully joined in the cluster
# validate windows node successfully join
& kubectl get nodes -o wide

# configure flannel and kube-proxy on the windows node
& kubectl apply -f "..\fannel-overlay.yml"
& kubectl apply -f "..\kube-proxy.yml"

# check the status of the windows node
& kubectl get nodes -o wide

}
142 changes: 142 additions & 0 deletions flannel-overlay.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
---
kind: ConfigMap
apiVersion: v1
metadata:
name: kube-flannel-windows-cfg
namespace: kube-flannel
labels:
tier: node
app: flannel
data:
cni-conf-containerd.json: |
{
"name": "flannel.4096",
"cniVersion": "0.3.0",
"type": "flannel",
"capabilities": {
"portMappings": true,
"dns": true
},
"delegate": {
"type": "sdnoverlay",
"AdditionalArgs": [
{
"Name": "EndpointPolicy",
"Value": {
"Type": "OutBoundNAT",
"Settings" : {
"Exceptions": []
}
}
},
{
"Name": "EndpointPolicy",
"Value": {
"Type": "SDNROUTE",
"Settings": {
"DestinationPrefix": "",
"NeedEncap": true
}
}
},
{
"Name":"EndpointPolicy",
"Value":{
"Type":"ProviderAddress",
"Settings":{
"ProviderAddress":""
}
}
}
]
}
}
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: kube-flannel-ds-windows-amd64
labels:
tier: node
app: flannel
namespace: kube-flannel
spec:
selector:
matchLabels:
app: flannel
template:
metadata:
labels:
tier: node
app: flannel
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/os
operator: In
values:
- windows
- key: kubernetes.io/arch
operator: In
values:
- amd64
securityContext:
windowsOptions:
hostProcess: true
runAsUserName: "NT AUTHORITY\\system"
hostNetwork: true
serviceAccountName: flannel
tolerations:
- operator: Exists
effect: NoSchedule
# Mark the pod as a critical add-on for rescheduling.
- key: CriticalAddonsOnly
operator: Exists
- effect: NoExecute
operator: Exists
containers:
- name: kube-flannel
image: syck0/flannel:v0.21.5-hostprocess
imagePullPolicy: Always
volumeMounts:
- name: flannel-cfg
mountPath: /mounts/kube-flannel/
- name: flannel-windows-cfg
mountPath: /mounts/kube-flannel-windows/
env:
- name: CNI_BIN_PATH
value: C:\\opt\\cni\\bin
- name: CNI_CONFIG_PATH
value: C:\\etc\\cni\\net.d
- name: SERVICE_SUBNET
value: 10.96.0.0/12
# As of now with the currently used flannel version (last checked with v0.21.5) we need to overwrite KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT
# in order to be able to reach the kubernetes api server. Under windows it's currently not possible to reach it over the service created by kubernetes
# For more context and details check the corresponding PR: https://github.com/kubernetes-sigs/sig-windows-tools/pull/314
# Especially the comments in this review: https://github.com/kubernetes-sigs/sig-windows-tools/pull/314#discussion_r1238815189
# There is also a follow up issue on the flannel side: https://github.com/flannel-io/flannel/issues/1772
# Once this issue is solved we should be able to remove the custom host and port to the kubernetes api server
- name: KUBERNETES_SERVICE_HOST
value: control-plane.minikube.internal # KUBERNETES_SERVICE_HOST_VALUE
- name: KUBERNETES_SERVICE_PORT
value: "8443" # replace with your "KUBERNETES_SERVICE_PORT_VALUE"
- name: POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
volumes:
- name: flannel-cfg
configMap:
name: kube-flannel-cfg
- name: flannel-windows-cfg
configMap:
name: kube-flannel-windows-cfg
184 changes: 183 additions & 1 deletion kube-flannel.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,78 @@
---
kind: Namespace
apiVersion: v1
metadata:
name: kube-flannel
labels:
k8s-app: flannel
pod-security.kubernetes.io/enforce: privileged
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
labels:
k8s-app: flannel
name: flannel
rules:
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- apiGroups:
- ""
resources:
- nodes
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- nodes/status
verbs:
- patch
- apiGroups:
- networking.k8s.io
resources:
- clustercidrs
verbs:
- list
- watch
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
labels:
k8s-app: flannel
name: flannel
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: flannel
subjects:
- kind: ServiceAccount
name: flannel
namespace: kube-flannel
---
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
k8s-app: flannel
name: flannel
namespace: kube-flannel
---
kind: ConfigMap
apiVersion: v1
metadata:
name: kube-flannel-cfg
namespace: kube-flannel
labels:
tier: node
k8s-app: flannel
app: flannel
data:
cni-conf.json: |
Expand Down Expand Up @@ -35,4 +103,118 @@ data:
"VNI": 4096,
"Port": 4789
}
}
}
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: kube-flannel-ds
namespace: kube-flannel
labels:
tier: node
app: flannel
k8s-app: flannel
spec:
selector:
matchLabels:
app: flannel
template:
metadata:
labels:
tier: node
app: flannel
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/os
operator: In
values:
- linux
hostNetwork: true
priorityClassName: system-node-critical
tolerations:
- operator: Exists
effect: NoSchedule
serviceAccountName: flannel
initContainers:
- name: install-cni-plugin
image: docker.io/flannel/flannel-cni-plugin:v1.1.2
#image: docker.io/rancher/mirrored-flannelcni-flannel-cni-plugin:v1.1.2
command:
- cp
args:
- -f
- /flannel
- /opt/cni/bin/flannel
volumeMounts:
- name: cni-plugin
mountPath: /opt/cni/bin
- name: install-cni
image: docker.io/flannel/flannel:v0.22.0
#image: docker.io/rancher/mirrored-flannelcni-flannel:v0.22.0
command:
- cp
args:
- -f
- /etc/kube-flannel/cni-conf.json
- /etc/cni/net.d/10-flannel.conflist
volumeMounts:
- name: cni
mountPath: /etc/cni/net.d
- name: flannel-cfg
mountPath: /etc/kube-flannel/
containers:
- name: kube-flannel
image: docker.io/flannel/flannel:v0.22.0
#image: docker.io/rancher/mirrored-flannelcni-flannel:v0.22.0
command:
- /opt/bin/flanneld
args:
- --ip-masq
- --kube-subnet-mgr
resources:
requests:
cpu: "100m"
memory: "50Mi"
securityContext:
privileged: false
capabilities:
add: ["NET_ADMIN", "NET_RAW"]
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: EVENT_QUEUE_DEPTH
value: "5000"
volumeMounts:
- name: run
mountPath: /run/flannel
- name: flannel-cfg
mountPath: /etc/kube-flannel/
- name: xtables-lock
mountPath: /run/xtables.lock
volumes:
- name: run
hostPath:
path: /run/flannel
- name: cni-plugin
hostPath:
path: /opt/cni/bin
- name: cni
hostPath:
path: /etc/cni/net.d
- name: flannel-cfg
configMap:
name: kube-flannel-cfg
- name: xtables-lock
hostPath:
path: /run/xtables.lock
type: FileOrCreate
Loading