Skip to content

Commit

Permalink
Use helm to generate Antrea Windows manifests
Browse files Browse the repository at this point in the history
Fixes antrea-io#5564

Signed-off-by: Shikhar Soni <shikharish05@gmail.com>
  • Loading branch information
shikharish committed May 22, 2024
1 parent ee6fd52 commit 1f6d34d
Show file tree
Hide file tree
Showing 22 changed files with 226 additions and 235 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,6 @@ manifest:
$(CURDIR)/hack/generate-standard-manifests.sh --mode dev --out build/yamls
$(CURDIR)/hack/generate-manifest-windows.sh --mode dev > build/yamls/antrea-windows.yml
$(CURDIR)/hack/generate-manifest-windows.sh --mode dev --include-ovs > build/yamls/antrea-windows-with-ovs.yml
$(CURDIR)/hack/update-checksum-windows.sh
$(CURDIR)/hack/generate-manifest-flow-aggregator.sh --mode dev > build/yamls/flow-aggregator.yml

.PHONY: manifest-scale
Expand Down
23 changes: 23 additions & 0 deletions build/charts/antrea-windows/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
24 changes: 24 additions & 0 deletions build/charts/antrea-windows/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: antrea-windows
type: application
displayName: Antrea
home: https://antrea.io/
version: 0.0.0
appVersion: latest
kubeVersion: ">= 1.16.0-0"
icon: https://raw.githubusercontent.com/antrea-io/antrea/main/docs/assets/logo/antrea_logo.svg
description: Kubernetes networking based on Open vSwitch
keywords:
- Kubernetes
- CNCF
- Networking
- CNI
- Security
- Open vSwitch
- OVS
sources:
- https://github.com/antrea-io/antrea
annotations:
artifacthub.io/license: Apache-2.0
artifacthub.io/operator: "false"
artifacthub.io/prerelease: "false"
12 changes: 12 additions & 0 deletions build/charts/antrea-windows/templates/agent.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
data:
{{- tpl ((.Files.Glob "conf/*.ps1").AsConfig) . | nindent 2 }}
{{- if .Values.includeOVS }}
{{- tpl ((.Files.Glob "conf/ovs/*.ps1").AsConfig) . | nindent 2 }}
{{- end }}
kind: ConfigMap
metadata:
labels:
app: antrea
name: antrea-agent-windows
namespace: kube-system
9 changes: 9 additions & 0 deletions build/charts/antrea-windows/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
data:
{{- tpl ((.Files.Glob "conf/*.conf*").AsConfig) . | nindent 2 }}
kind: ConfigMap
metadata:
labels:
app: antrea
name: antrea-windows-config
namespace: kube-system
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@ apiVersion: apps/v1
kind: DaemonSet
metadata:
labels:
app: antrea
component: antrea-agent
name: antrea-agent-windows
namespace: kube-system
spec:
selector:
matchLabels:
app: antrea
component: antrea-agent
template:
metadata:
annotations:
"microsoft.com/hostprocess-inherit-user": "true"
checksum/windows-config: windows-config-checksum-placeholder
checksum/agent-windows: agent-windows-checksum-placeholder
checksum/windows-config: windows-config-checksum-placeholder
microsoft.com/hostprocess-inherit-user: "true"
labels:
app: antrea
component: antrea-agent
spec:
securityContext:
windowsOptions:
runAsUserName: "NT AUTHORITY\\SYSTEM"
hostProcess: true
containers:
- args:
- -file
Expand All @@ -40,7 +40,31 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.nodeName
image: antrea-windows
{{- if .Values.release }}
image: {{ .Values.Image.repository }}:{{ .Values.Image.tag }}
{{- else }}
image: antrea/antrea-windows:latest
imagePullPolicy: IfNotPresent
{{- end}}
{{- if .Values.includeOVS }}
lifecycle:
postStart:
exec:
command:
- powershell
- -file
- $env:CONTAINER_SANDBOX_MOUNT_POINT/var/lib/antrea-windows/VMSwitchExtension-AntreaAgent-Containerd.ps1
- -VMSwitchExtension
- enable
preStop:
exec:
command:
- powershell
- -file
- $env:CONTAINER_SANDBOX_MOUNT_POINT/var/lib/antrea-windows/VMSwitchExtension-AntreaAgent-Containerd.ps1
- -VMSwitchExtension
- disable
{{- end}}
name: antrea-agent
volumeMounts:
- mountPath: /etc/antrea
Expand All @@ -49,14 +73,39 @@ spec:
name: antrea-agent-windows
- mountPath: /var/log/antrea/
name: var-log-antrea
{{- if .Values.includeOVS }}
- args:
- -file
- $env:CONTAINER_SANDBOX_MOUNT_POINT/var/lib/antrea-windows/Run-AntreaOVS-Containerd.ps1
command:
- powershell
{{- if .Values.release }}
image: {{ .Values.Image.repository }}:{{ .Values.Image.tag }}
{{- else }}
image: antrea/antrea-windows:latest
{{- end}}
imagePullPolicy: IfNotPresent
name: antrea-ovs
volumeMounts:
- mountPath: /var/lib/antrea-windows
name: antrea-agent-windows
- mountPath: /var/log/openvswitch
name: var-log-antrea
subPath: openvswitch
{{- end}}
hostNetwork: true
initContainers:
- args:
- -file
- $env:CONTAINER_SANDBOX_MOUNT_POINT/var/lib/antrea-windows/Install-WindowsCNI-Containerd.ps1
command:
- powershell
image: antrea-windows
{{- if .Values.release }}
image: {{ .Values.Image.repository }}:{{ .Values.Image.tag }}
{{- else }}
image: antrea/antrea-windows:latest
imagePullPolicy: IfNotPresent
{{- end}}
name: install-cni
volumeMounts:
- mountPath: /etc/antrea
Expand All @@ -67,6 +116,10 @@ spec:
nodeSelector:
kubernetes.io/os: windows
priorityClassName: system-node-critical
securityContext:
windowsOptions:
hostProcess: true
runAsUserName: NT AUTHORITY\SYSTEM
serviceAccountName: antrea-agent
tolerations:
- key: CriticalAddonsOnly
Expand All @@ -86,4 +139,4 @@ spec:
type: DirectoryOrCreate
name: var-log-antrea
updateStrategy:
type: RollingUpdate
type: RollingUpdate
Loading

0 comments on commit 1f6d34d

Please sign in to comment.