mirror of
https://github.com/kubereboot/kured.git
synced 2026-05-09 01:46:59 +00:00
Add kustomize testing
This extends our test coverages for kured-* manifest changes on PRs, and any eventual changes in kubernetes/kubectl on periodics. Signed-off-by: Jean-Philippe Evrard <open-source@a.spamming.party>
This commit is contained in:
15
.github/kustomize/kured-dev.yaml
vendored
Normal file
15
.github/kustomize/kured-dev.yaml
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
name: kured
|
||||
namespace: kube-system
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: kured
|
||||
image: docker.io/weaveworks/kured
|
||||
imagePullPolicy: Always
|
||||
command:
|
||||
- /usr/bin/kured
|
||||
- --period=1m
|
||||
7
.github/kustomize/kustomization.yaml
vendored
Normal file
7
.github/kustomize/kustomization.yaml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- kured-ds.yaml
|
||||
- kured-rbac.yaml
|
||||
patchesStrategicMerge:
|
||||
- kured-dev.yaml
|
||||
53
.github/workflows/kustomize-test.yml
vendored
Normal file
53
.github/workflows/kustomize-test.yml
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
#This tests if our kustomize manifests still work with an update
|
||||
#of kustomize or with an update of our manifests (keeping the image
|
||||
# the same).
|
||||
|
||||
name: Kustomize deploy
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- "**/kured-*.yaml"
|
||||
schedule:
|
||||
- cron: '0 0 1 * *'
|
||||
|
||||
jobs:
|
||||
deploy-with-kustomize:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: "0"
|
||||
|
||||
# We need to unpin kind-action so we can test is new versions of kind
|
||||
# and therefore kubernetes will break with our manifests
|
||||
# This creates a 1 node cluster.
|
||||
- name: Create a default kind cluster
|
||||
uses: helm/kind-action@master
|
||||
|
||||
# Kustomize won't work with symlinks to resources outside its folder
|
||||
# kind-action already installed kind and kubectl.
|
||||
- name: Deploy with kubectl using kustomization
|
||||
run: |
|
||||
cp kured-{ds,rbac}.yaml .github/kustomize/
|
||||
VERSION=$(curl -s https://api.github.com/repos/weaveworks/kured/releases | jq -r .[0].tag_name)
|
||||
sed -i "s#docker.io/weaveworks/kured#docker.io/weaveworks/kured:$VERSION#g" .github/kustomize/kured-dev.yaml
|
||||
kubectl apply -k .github/kustomize/
|
||||
|
||||
- name: Show kured is deploying
|
||||
run: |
|
||||
sleep 10; kubectl describe ds kured -n kube-system
|
||||
|
||||
- name: Ensure kured is up
|
||||
uses: nick-invision/retry@v1
|
||||
with:
|
||||
timeout_minutes: 10
|
||||
max_attempts: 10
|
||||
retry_wait_seconds: 60
|
||||
# DESIRED CURRENT READY UP-TO-DATE AVAILABLE should all be =1
|
||||
command: "kubectl get ds -n kube-system | grep -E 'kured.*1.*1.*1.*1.*1' "
|
||||
|
||||
- name: Show kured is successfully deployed
|
||||
run: |
|
||||
kubectl get ds -n kube-system
|
||||
Reference in New Issue
Block a user