Skip to content

Commit

Permalink
feat: add kustomize workflow sample
Browse files Browse the repository at this point in the history
  • Loading branch information
piraces committed Sep 17, 2022
1 parent d06acdb commit 0cfc859
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/test-action-kustomize.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Action CI (Kustomize)

on: [push]

jobs:
test-action-kustomize-job-win32:
runs-on: windows-latest
name: kube-score kustomize (Win32)
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: azure/setup-kubectl@v3
id: install
- name: Make temporal output directory
run: mkdir -p out/kustomize
- name: kustomize build to standard template
run: kubectl kustomize sample-manifests\kustomize\overlays\production > ./out/kustomize/sample-kustomize.yaml
- name: kube-score action step
uses: ./ # Uses an action in the root directory
id: ksga
with:
manifests-folders: './out/kustomize/*.yaml'
ignore-exit-code: 'true'
kube-score-version: '1.14.0'

test-action-kustomize-job-linux:
runs-on: ubuntu-latest
name: kube-score kustomize (Linux)
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: azure/setup-kubectl@v3
id: install
- name: Make temporal output directory
run: mkdir -p out/kustomize
- name: kustomize build to standard template
run: kubectl kustomize sample-manifests/kustomize/overlays/production > ./out/kustomize/sample-kustomize.yaml
- name: kube-score action step
uses: ./ # Uses an action in the root directory
id: ksga
with:
manifests-folders: './out/kustomize/*.yaml'
ignore-exit-code: 'true'
kube-score-version: '1.14.0'

test-action-kustomize-job-macos:
runs-on: macos-latest
name: kube-score kustomize (MacOS)
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: azure/setup-kubectl@v3
id: install
- name: Make temporal output directory
run: mkdir -p out/kustomize
- name: kustomize build to standard template
run: kubectl kustomize sample-manifests/kustomize/overlays/production > ./out/kustomize/sample-kustomize.yaml
- name: kube-score action step
uses: ./ # Uses an action in the root directory
id: ksga
with:
manifests-folders: './out/kustomize/*.yaml'
ignore-exit-code: 'true'
kube-score-version: '1.14.0'
21 changes: 21 additions & 0 deletions sample-manifests/kustomize/base/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.7.9
ports:
- containerPort: 80
4 changes: 4 additions & 0 deletions sample-manifests/kustomize/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
commonLabels:
app: hello
resources:
- deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
commonLabels:
env: production
bases:
- ../../base
patches:
- replica_count.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 100

0 comments on commit 0cfc859

Please sign in to comment.