Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: E2E resources for Windows #1141

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased

### enhancement
- Update e2e-resources to be able to run Windows containers @czeitler [#1141](https://github.com/newrelic/nri-kubernetes/pull/1141)

## v3.32.0 - 2024-11-18

### 🚀 Enhancements
Expand Down
2 changes: 2 additions & 0 deletions charts/internal/e2e-resources/templates/cronjob.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ spec:
- mountPath: /output
name: storage
restartPolicy: OnFailure
nodeSelector:
kubernetes.io/os: linux
volumes:
- name: storage
emptyDir:
Expand Down
27 changes: 27 additions & 0 deletions charts/internal/e2e-resources/templates/daemonset-windows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{- if and (.Values.daemonSet.enabled) (.Values.windows.enabled) }}
{{- range .Values.windows.osList }}
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: {{ .Release.Name }}-daemonset-windows-{{ .version }}
spec:
selector:
matchLabels:
app: daemonset-windows-{{ .version }}
template:
metadata:
labels:
app: daemonset-windows-{{ .version }}
spec:
containers:
- name: windows-sleep
image: mcr.microsoft.com/windows/servercore:{{ .version }}
command:
- powershell.exe
- -command
- "while($$true) { Start-Sleep -s 5 }"
nodeSelector:
kubernetes.io/os: windows
node.kubernetes.io/windows-build: {{ .buildNumber }}
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/internal/e2e-resources/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ spec:
- -c
- echo "Hello world! I'm going to exit with 42 to simulate a software bug." && sleep 300 && exit 42
{{- end }}
nodeSelector:
kubernetes.io/os: linux
volumes:
- name: storage
emptyDir:
Expand Down
35 changes: 35 additions & 0 deletions charts/internal/e2e-resources/templates/deployment-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{{- if and (.Values.deployment.enabled) (.Values.windows.enabled) }}
{{- range .Values.windows.osList }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-deployment-windows-{{ .version }}
spec:
paused: false
minReadySeconds: 6
replicas: 2
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
selector:
matchLabels:
app: deployment-windows-{{ .version }}
template:
metadata:
labels:
app: deployment-windows-{{ .version }}
spec:
containers:
- name: windows-sleep
image: mcr.microsoft.com/windows/servercore:{{ .version }}
command:
- powershell.exe
- -command
- "while($$true) { Start-Sleep -s 5 }"
nodeSelector:
kubernetes.io/os: windows
node.kubernetes.io/windows-build: {{ .buildNumber }}
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/internal/e2e-resources/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ spec:
- -c
- echo "Hello world! I'm going to exit with 42 to simulate a software bug." && sleep 300 && exit 42
{{- end }}
nodeSelector:
kubernetes.io/os: linux
volumes:
- name: storage
emptyDir:
Expand Down
4 changes: 4 additions & 0 deletions charts/internal/e2e-resources/templates/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ spec:
limits:
cpu: "500m"
imagePullPolicy: IfNotPresent
nodeSelector:
kubernetes.io/os: linux
volumes:
- name: script-volume
configMap:
Expand All @@ -53,6 +55,8 @@ spec:
cpu: 500m
requests:
cpu: 200m
nodeSelector:
kubernetes.io/os: linux
{{ end }}
---
{{ if .Values.openShift.enabled }}
Expand Down
2 changes: 2 additions & 0 deletions charts/internal/e2e-resources/templates/job-fails.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,7 @@ spec:
args:
- -c
- echo "Hello world! I'm going to exit with 42 to simulate a software bug." && sleep 5 && exit 42
nodeSelector:
kubernetes.io/os: linux
backoffLimit: 6
{{- end }}
3 changes: 3 additions & 0 deletions charts/internal/e2e-resources/templates/pods-pending.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ spec:
requests:
memory: 5M
cpu: 5m
nodeSelector:
kubernetes.io/os: linux
---
apiVersion: v1
kind: Pod
Expand All @@ -31,4 +33,5 @@ spec:
image: alpine:latest
nodeSelector:
not-existing: not-existing
kubernetes.io/os: linux
{{- end }}
2 changes: 2 additions & 0 deletions charts/internal/e2e-resources/templates/scraper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,6 @@ spec:
command:
- which
- bash
nodeSelector:
kubernetes.io/os: linux
{{- end }}
2 changes: 2 additions & 0 deletions charts/internal/e2e-resources/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ spec:
- -c
- echo "Hello world! I'm going to exit with 42 to simulate a software bug." && sleep 300 && exit 42
{{- end }}
nodeSelector:
kubernetes.io/os: linux
volumes:
- name: storage
{{- if .Values.persistentVolumeClaim.enabled }}
Expand Down
11 changes: 11 additions & 0 deletions charts/internal/e2e-resources/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,14 @@ fileSystemTest:
openShift:
enabled: false

windows:
# Enables running dummies on Windows nodes
enabled: false
# version is used for naming resources and the servercore image tag
# buildNumber is the major.minor.buildNumber matching the Windows Server version.
# https://kubernetes.io/docs/concepts/windows/user-guide/#handling-multiple-windows-versions-in-the-same-cluster
osList:
- version: ltsc2019
buildNumber: 10.0.17763
- version: ltsc2022
buildNumber: 10.0.20348
Loading