add kustomize example

This commit is contained in:
Stephan Girod 2021-03-31 17:26:56 +02:00
parent bddc753b6f
commit a4f8b430c7
No known key found for this signature in database
GPG Key ID: 195D2D232734F829
8 changed files with 138 additions and 0 deletions

View File

@ -0,0 +1,20 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: overlays-example
spec:
replicas: 2
revisionHistoryLimit: 3
selector:
matchLabels:
app: overlays-example
template:
metadata:
labels:
app: overlays-example
spec:
containers:
- image: quay.io/acend/example-web-go
name: overlays-example
ports:
- containerPort: 5000

View File

@ -0,0 +1,17 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
app: overlays-example
app.kubernetes.io/managed-by: kustomize
resources:
- deploymentconfig.yaml
- service.yaml
generatorOptions:
# commonLabels will not be respected by generator
labels:
app: overlays-example
app.kubernetes.io/managed-by: kustomize

View File

@ -0,0 +1,19 @@
---
apiVersion: v1
kind: Service
metadata:
annotations: {}
labels:
app: overlays-example
appStageTag: development
name: overlays-example
spec:
ports:
- name: 8080-tcp
port: 8080
protocol: TCP
targetPort: 8080
selector:
deploymentconfig: overlays-example
sessionAffinity: None
type: ClusterIP

View File

@ -0,0 +1,6 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: overlays-example
spec:
replicas: 4

View File

@ -0,0 +1,20 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
bases:
- ../../base
commonLabels:
appStageTag: production
generatorOptions:
# commonLabels will not be respected by generator
labels:
app: overlays-example
app.kubernetes.io/managed-by: kustomize
appStageTag: production
patchesStrategicMerge:
- deploymentconfig.yaml
# - service.yaml

View File

@ -0,0 +1,20 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: simple-example
spec:
replicas: 2
revisionHistoryLimit: 3
selector:
matchLabels:
app: simple-example
template:
metadata:
labels:
app: simple-example
spec:
containers:
- image: quay.io/acend/example-web-go
name: simple-example
ports:
- containerPort: 5000

View File

@ -0,0 +1,17 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
app: simple-example
app.kubernetes.io/managed-by: kustomize
resources:
- deploymentconfig.yaml
- service.yaml
generatorOptions:
# commonLabels will not be respected by generator
labels:
app: simple-example
app.kubernetes.io/managed-by: kustomize

View File

@ -0,0 +1,19 @@
---
apiVersion: v1
kind: Service
metadata:
annotations: {}
labels:
app: simple-example
appStageTag: development
name: simple-example
spec:
ports:
- name: 8080-tcp
port: 8080
protocol: TCP
targetPort: 8080
selector:
deploymentconfig: simple-example
sessionAffinity: None
type: ClusterIP