mirror of
https://github.com/stefanprodan/podinfo.git
synced 2026-02-14 10:19:52 +00:00
Add database deployment demo
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
5
Makefile
5
Makefile
@@ -81,6 +81,11 @@ version-set:
|
||||
/usr/bin/sed -i '' "s/podinfo:$$current/podinfo:$$next/g" deploy/webapp/backend/deployment.yaml && \
|
||||
/usr/bin/sed -i '' "s/podinfo:$$current/podinfo:$$next/g" deploy/bases/frontend/deployment.yaml && \
|
||||
/usr/bin/sed -i '' "s/podinfo:$$current/podinfo:$$next/g" deploy/bases/backend/deployment.yaml && \
|
||||
/usr/bin/sed -i '' "s/podinfo:$$current/podinfo:$$next/g" deploy/bases/database/statefulset-primary.yaml && \
|
||||
/usr/bin/sed -i '' "s/podinfo:$$current/podinfo:$$next/g" deploy/bases/database/deployment-replica.yaml && \
|
||||
/usr/bin/sed -i '' "s/podinfo:$$current/podinfo:$$next/g" deploy/bases/database/cronjob-rollup-daily.yaml && \
|
||||
/usr/bin/sed -i '' "s/podinfo:$$current/podinfo:$$next/g" deploy/bases/database/cronjob-rollup-weekly.yaml && \
|
||||
/usr/bin/sed -i '' "s/podinfo:$$current/podinfo:$$next/g" deploy/bases/database/cronjob-backup-daily.yaml && \
|
||||
/usr/bin/sed -i '' "s/$$current/$$next/g" timoni/podinfo/values.cue && \
|
||||
echo "Version $$next set in code, deployment, module, chart and kustomize"
|
||||
|
||||
|
||||
@@ -12,14 +12,14 @@ spec:
|
||||
type: RollingUpdate
|
||||
selector:
|
||||
matchLabels:
|
||||
app: backend
|
||||
app.kubernetes.io/name: backend
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
prometheus.io/scrape: "true"
|
||||
prometheus.io/port: "9797"
|
||||
labels:
|
||||
app: backend
|
||||
app.kubernetes.io/name: backend
|
||||
spec:
|
||||
containers:
|
||||
- name: backend
|
||||
|
||||
@@ -5,7 +5,7 @@ metadata:
|
||||
spec:
|
||||
type: ClusterIP
|
||||
selector:
|
||||
app: backend
|
||||
app.kubernetes.io/name: backend
|
||||
ports:
|
||||
- name: http
|
||||
port: 9898
|
||||
|
||||
4
deploy/bases/cache/deployment.yaml
vendored
4
deploy/bases/cache/deployment.yaml
vendored
@@ -5,11 +5,11 @@ metadata:
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: cache
|
||||
app.kubernetes.io/name: cache
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: cache
|
||||
app.kubernetes.io/name: cache
|
||||
spec:
|
||||
containers:
|
||||
- name: redis
|
||||
|
||||
2
deploy/bases/cache/service.yaml
vendored
2
deploy/bases/cache/service.yaml
vendored
@@ -5,7 +5,7 @@ metadata:
|
||||
spec:
|
||||
type: ClusterIP
|
||||
selector:
|
||||
app: cache
|
||||
app.kubernetes.io/name: cache
|
||||
ports:
|
||||
- name: redis
|
||||
port: 6379
|
||||
|
||||
76
deploy/bases/database/README.md
Normal file
76
deploy/bases/database/README.md
Normal file
@@ -0,0 +1,76 @@
|
||||
# Database Setup
|
||||
|
||||
This directory contains the Kubernetes manifests to simulate a database setup
|
||||
with a primary database, read replicas, and scheduled maintenance tasks using CronJobs.
|
||||
|
||||
## Components
|
||||
|
||||
### Core Resources
|
||||
|
||||
| Resource | File | Description |
|
||||
|----------|------|-------------|
|
||||
| ServiceAccount | `serviceaccount.yaml` | Shared service account for all database workloads |
|
||||
| PVC | `pvc-primary.yaml` | 1Gi persistent storage for primary database |
|
||||
| StatefulSet | `statefulset-primary.yaml` | Primary database with persistent storage at `/data` |
|
||||
| Deployment | `deployment-replica.yaml` | Read replica deployment |
|
||||
| Service (Headless) | `service-primary.yaml` | Headless service for StatefulSet |
|
||||
| Service | `service-replica.yaml` | ClusterIP service for replicas |
|
||||
| HPA | `hpa-replica.yaml` | Autoscaler for replicas (2-3 pods, 99% CPU) |
|
||||
|
||||
### CronJobs
|
||||
|
||||
| CronJob | Schedule | Duration | TTL Cleanup | Description |
|
||||
|---------|----------|----------|-------------|-------------|
|
||||
| `rollup-daily` | Every 10 min | ~1 min | 1 hour | Daily rollup simulation (6 iterations) |
|
||||
| `rollup-weekly` | Every 30 min | ~2 min | 1 day | Weekly rollup simulation (12 iterations) |
|
||||
| `backup-daily` | Daily at midnight | ~1 min | 1 day | Backup simulation (configured to fail) |
|
||||
|
||||
### Scripts
|
||||
|
||||
Located in `scripts/` directory:
|
||||
|
||||
- `rollup.sh` - Rollup simulation script with configurable steps via `ROLLUP_STEPS` env var
|
||||
- `backup.sh` - Backup simulation script with configurable exit code via `BACKUP_EXIT` env var
|
||||
|
||||
## Labels
|
||||
|
||||
All resources use Kubernetes recommended labels:
|
||||
|
||||
- `app.kubernetes.io/name` - Component name
|
||||
- `app.kubernetes.io/part-of: database` - Part of database application
|
||||
|
||||
## Configuration
|
||||
|
||||
### Primary Database
|
||||
- **Port**: 3306 (MySQL standard)
|
||||
- **Storage**: 1Gi PersistentVolumeClaim mounted at `/data`
|
||||
- **Service**: Headless (`clusterIP: None`) for StatefulSet
|
||||
|
||||
### Replica Database
|
||||
- **Port**: 3306
|
||||
- **Scaling**: HPA with 2-3 replicas at 99% CPU utilization
|
||||
- **Service**: ClusterIP
|
||||
|
||||
### CronJob Scripts
|
||||
|
||||
The scripts check database-replica health before running:
|
||||
|
||||
```sh
|
||||
podcli check http database-replica:3306/readyz
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Deploy with Kustomize:
|
||||
|
||||
```bash
|
||||
kubectl apply -k deploy/bases/database
|
||||
```
|
||||
|
||||
Or include in an overlay:
|
||||
|
||||
```yaml
|
||||
# kustomization.yaml
|
||||
resources:
|
||||
- ../../bases/database
|
||||
```
|
||||
48
deploy/bases/database/cronjob-backup-daily.yaml
Normal file
48
deploy/bases/database/cronjob-backup-daily.yaml
Normal file
@@ -0,0 +1,48 @@
|
||||
apiVersion: batch/v1
|
||||
kind: CronJob
|
||||
metadata:
|
||||
name: backup-daily
|
||||
spec:
|
||||
# Runs every day at midnight for 1 minute
|
||||
schedule: "0 0 * * *"
|
||||
concurrencyPolicy: Forbid
|
||||
successfulJobsHistoryLimit: 1
|
||||
failedJobsHistoryLimit: 1
|
||||
jobTemplate:
|
||||
spec:
|
||||
# Cleanup after 1 day
|
||||
ttlSecondsAfterFinished: 86400
|
||||
backoffLimit: 1
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: backup-daily
|
||||
app.kubernetes.io/part-of: database
|
||||
spec:
|
||||
serviceAccountName: database
|
||||
restartPolicy: Never
|
||||
containers:
|
||||
- name: backup
|
||||
image: ghcr.io/stefanprodan/podinfo:6.9.4
|
||||
imagePullPolicy: IfNotPresent
|
||||
command:
|
||||
- /bin/sh
|
||||
- /scripts/backup.sh
|
||||
env:
|
||||
- name: BACKUP_EXIT
|
||||
value: "1"
|
||||
resources:
|
||||
limits:
|
||||
cpu: 100m
|
||||
memory: 32Mi
|
||||
requests:
|
||||
cpu: 10m
|
||||
memory: 16Mi
|
||||
volumeMounts:
|
||||
- name: scripts
|
||||
mountPath: /scripts
|
||||
volumes:
|
||||
- name: scripts
|
||||
configMap:
|
||||
name: backup-script
|
||||
defaultMode: 0755
|
||||
48
deploy/bases/database/cronjob-rollup-daily.yaml
Normal file
48
deploy/bases/database/cronjob-rollup-daily.yaml
Normal file
@@ -0,0 +1,48 @@
|
||||
apiVersion: batch/v1
|
||||
kind: CronJob
|
||||
metadata:
|
||||
name: rollup-daily
|
||||
spec:
|
||||
# Runs every 10 minutes for 1 minute
|
||||
schedule: "*/10 * * * *"
|
||||
concurrencyPolicy: Forbid
|
||||
successfulJobsHistoryLimit: 1
|
||||
failedJobsHistoryLimit: 1
|
||||
jobTemplate:
|
||||
spec:
|
||||
# Cleanup after 1 hour
|
||||
ttlSecondsAfterFinished: 3600
|
||||
backoffLimit: 3
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: rollup-daily
|
||||
app.kubernetes.io/part-of: database
|
||||
spec:
|
||||
serviceAccountName: database
|
||||
restartPolicy: OnFailure
|
||||
containers:
|
||||
- name: healthcheck
|
||||
image: ghcr.io/stefanprodan/podinfo:6.9.4
|
||||
imagePullPolicy: IfNotPresent
|
||||
command:
|
||||
- /bin/sh
|
||||
- /scripts/rollup.sh
|
||||
env:
|
||||
- name: ROLLUP_STEPS
|
||||
value: "6"
|
||||
resources:
|
||||
limits:
|
||||
cpu: 100m
|
||||
memory: 32Mi
|
||||
requests:
|
||||
cpu: 10m
|
||||
memory: 16Mi
|
||||
volumeMounts:
|
||||
- name: scripts
|
||||
mountPath: /scripts
|
||||
volumes:
|
||||
- name: scripts
|
||||
configMap:
|
||||
name: rollup-script
|
||||
defaultMode: 0755
|
||||
48
deploy/bases/database/cronjob-rollup-weekly.yaml
Normal file
48
deploy/bases/database/cronjob-rollup-weekly.yaml
Normal file
@@ -0,0 +1,48 @@
|
||||
apiVersion: batch/v1
|
||||
kind: CronJob
|
||||
metadata:
|
||||
name: rollup-weekly
|
||||
spec:
|
||||
# Runs every 30 minutes for 2 minutes
|
||||
schedule: "*/30 * * * *"
|
||||
concurrencyPolicy: Forbid
|
||||
successfulJobsHistoryLimit: 1
|
||||
failedJobsHistoryLimit: 1
|
||||
jobTemplate:
|
||||
spec:
|
||||
# Cleanup after 1 day
|
||||
ttlSecondsAfterFinished: 86400
|
||||
backoffLimit: 3
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: rollup-weekly
|
||||
app.kubernetes.io/part-of: database
|
||||
spec:
|
||||
serviceAccountName: database
|
||||
restartPolicy: OnFailure
|
||||
containers:
|
||||
- name: healthcheck
|
||||
image: ghcr.io/stefanprodan/podinfo:6.9.4
|
||||
imagePullPolicy: IfNotPresent
|
||||
command:
|
||||
- /bin/sh
|
||||
- /scripts/rollup.sh
|
||||
env:
|
||||
- name: ROLLUP_STEPS
|
||||
value: "12"
|
||||
resources:
|
||||
limits:
|
||||
cpu: 100m
|
||||
memory: 32Mi
|
||||
requests:
|
||||
cpu: 10m
|
||||
memory: 16Mi
|
||||
volumeMounts:
|
||||
- name: scripts
|
||||
mountPath: /scripts
|
||||
volumes:
|
||||
- name: scripts
|
||||
configMap:
|
||||
name: rollup-script
|
||||
defaultMode: 0755
|
||||
66
deploy/bases/database/deployment-replica.yaml
Normal file
66
deploy/bases/database/deployment-replica.yaml
Normal file
@@ -0,0 +1,66 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: database-replica
|
||||
spec:
|
||||
minReadySeconds: 3
|
||||
revisionHistoryLimit: 5
|
||||
progressDeadlineSeconds: 60
|
||||
strategy:
|
||||
rollingUpdate:
|
||||
maxUnavailable: 0
|
||||
type: RollingUpdate
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: database-replica
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
prometheus.io/scrape: "true"
|
||||
prometheus.io/port: "9797"
|
||||
labels:
|
||||
app.kubernetes.io/name: database-replica
|
||||
app.kubernetes.io/part-of: database
|
||||
spec:
|
||||
serviceAccountName: database
|
||||
containers:
|
||||
- name: database
|
||||
image: ghcr.io/stefanprodan/podinfo:6.9.4
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- name: db
|
||||
containerPort: 3306
|
||||
protocol: TCP
|
||||
- name: http-metrics
|
||||
containerPort: 9797
|
||||
protocol: TCP
|
||||
command:
|
||||
- ./podinfo
|
||||
- --port=3306
|
||||
- --port-metrics=9797
|
||||
- --level=info
|
||||
livenessProbe:
|
||||
exec:
|
||||
command:
|
||||
- podcli
|
||||
- check
|
||||
- http
|
||||
- localhost:3306/healthz
|
||||
initialDelaySeconds: 5
|
||||
timeoutSeconds: 5
|
||||
readinessProbe:
|
||||
exec:
|
||||
command:
|
||||
- podcli
|
||||
- check
|
||||
- http
|
||||
- localhost:3306/readyz
|
||||
initialDelaySeconds: 5
|
||||
timeoutSeconds: 5
|
||||
resources:
|
||||
limits:
|
||||
cpu: 2000m
|
||||
memory: 512Mi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 32Mi
|
||||
18
deploy/bases/database/hpa-replica.yaml
Normal file
18
deploy/bases/database/hpa-replica.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
apiVersion: autoscaling/v2
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: database-replica
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: database-replica
|
||||
minReplicas: 2
|
||||
maxReplicas: 3
|
||||
metrics:
|
||||
- type: Resource
|
||||
resource:
|
||||
name: cpu
|
||||
target:
|
||||
type: Utilization
|
||||
averageUtilization: 99
|
||||
24
deploy/bases/database/kustomization.yaml
Normal file
24
deploy/bases/database/kustomization.yaml
Normal file
@@ -0,0 +1,24 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- serviceaccount.yaml
|
||||
- pvc-primary.yaml
|
||||
- statefulset-primary.yaml
|
||||
- deployment-replica.yaml
|
||||
- service-primary.yaml
|
||||
- service-replica.yaml
|
||||
- hpa-replica.yaml
|
||||
- cronjob-rollup-daily.yaml
|
||||
- cronjob-rollup-weekly.yaml
|
||||
- cronjob-backup-daily.yaml
|
||||
configMapGenerator:
|
||||
- name: rollup-script
|
||||
files:
|
||||
- scripts/rollup.sh
|
||||
options:
|
||||
disableNameSuffixHash: true
|
||||
- name: backup-script
|
||||
files:
|
||||
- scripts/backup.sh
|
||||
options:
|
||||
disableNameSuffixHash: true
|
||||
10
deploy/bases/database/pvc-primary.yaml
Normal file
10
deploy/bases/database/pvc-primary.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: database-primary
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
12
deploy/bases/database/scripts/backup.sh
Normal file
12
deploy/bases/database/scripts/backup.sh
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# This is a simulation of a backup process.
|
||||
|
||||
EXIT_CODE=${BACKUP_EXIT:-0}
|
||||
|
||||
echo "Starting backup (estimated run time: 60s)"
|
||||
podcli check http database-replica:3306/readyz
|
||||
sleep 60
|
||||
echo "Backup finished"
|
||||
exit $EXIT_CODE
|
||||
15
deploy/bases/database/scripts/rollup.sh
Normal file
15
deploy/bases/database/scripts/rollup.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# This is a simulation of a rollup process.
|
||||
|
||||
STEPS=${ROLLUP_STEPS:-6}
|
||||
echo "Starting rollup with $STEPS steps (estimated run time: $((STEPS * 10))s)"
|
||||
podcli check http database-replica:3306/readyz
|
||||
i=1
|
||||
while [ $i -le $STEPS ]; do
|
||||
echo "Running rollup iteration $i of $STEPS"
|
||||
sleep 10
|
||||
i=$((i + 1))
|
||||
done
|
||||
echo "Rollup finished"
|
||||
14
deploy/bases/database/service-primary.yaml
Normal file
14
deploy/bases/database/service-primary.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: database-primary
|
||||
spec:
|
||||
type: ClusterIP
|
||||
clusterIP: None
|
||||
selector:
|
||||
app.kubernetes.io/name: database-primary
|
||||
ports:
|
||||
- name: db
|
||||
port: 3306
|
||||
protocol: TCP
|
||||
targetPort: db
|
||||
13
deploy/bases/database/service-replica.yaml
Normal file
13
deploy/bases/database/service-replica.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: database-replica
|
||||
spec:
|
||||
type: ClusterIP
|
||||
selector:
|
||||
app.kubernetes.io/name: database-replica
|
||||
ports:
|
||||
- name: db
|
||||
port: 3306
|
||||
protocol: TCP
|
||||
targetPort: db
|
||||
4
deploy/bases/database/serviceaccount.yaml
Normal file
4
deploy/bases/database/serviceaccount.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: database
|
||||
70
deploy/bases/database/statefulset-primary.yaml
Normal file
70
deploy/bases/database/statefulset-primary.yaml
Normal file
@@ -0,0 +1,70 @@
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: database-primary
|
||||
spec:
|
||||
serviceName: database-primary
|
||||
replicas: 1
|
||||
minReadySeconds: 3
|
||||
revisionHistoryLimit: 5
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: database-primary
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
prometheus.io/scrape: "true"
|
||||
prometheus.io/port: "9797"
|
||||
labels:
|
||||
app.kubernetes.io/name: database-primary
|
||||
app.kubernetes.io/part-of: database
|
||||
spec:
|
||||
serviceAccountName: database
|
||||
containers:
|
||||
- name: database
|
||||
image: ghcr.io/stefanprodan/podinfo:6.9.4
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- name: db
|
||||
containerPort: 3306
|
||||
protocol: TCP
|
||||
- name: http-metrics
|
||||
containerPort: 9797
|
||||
protocol: TCP
|
||||
command:
|
||||
- ./podinfo
|
||||
- --port=3306
|
||||
- --port-metrics=9797
|
||||
- --level=info
|
||||
livenessProbe:
|
||||
exec:
|
||||
command:
|
||||
- podcli
|
||||
- check
|
||||
- http
|
||||
- localhost:3306/healthz
|
||||
initialDelaySeconds: 5
|
||||
timeoutSeconds: 5
|
||||
readinessProbe:
|
||||
exec:
|
||||
command:
|
||||
- podcli
|
||||
- check
|
||||
- http
|
||||
- localhost:3306/readyz
|
||||
initialDelaySeconds: 5
|
||||
timeoutSeconds: 5
|
||||
resources:
|
||||
limits:
|
||||
cpu: 2000m
|
||||
memory: 512Mi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 32Mi
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /data
|
||||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: database-primary
|
||||
@@ -12,14 +12,14 @@ spec:
|
||||
type: RollingUpdate
|
||||
selector:
|
||||
matchLabels:
|
||||
app: frontend
|
||||
app.kubernetes.io/name: frontend
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
prometheus.io/scrape: "true"
|
||||
prometheus.io/port: "9797"
|
||||
labels:
|
||||
app: frontend
|
||||
app.kubernetes.io/name: frontend
|
||||
spec:
|
||||
containers:
|
||||
- name: frontend
|
||||
|
||||
@@ -5,7 +5,7 @@ metadata:
|
||||
spec:
|
||||
type: ClusterIP
|
||||
selector:
|
||||
app: frontend
|
||||
app.kubernetes.io/name: frontend
|
||||
ports:
|
||||
- name: http
|
||||
port: 80
|
||||
|
||||
@@ -5,6 +5,7 @@ resources:
|
||||
- ../../bases/backend
|
||||
- ../../bases/frontend
|
||||
- ../../bases/cache
|
||||
- ../../bases/database
|
||||
- namespace.yaml
|
||||
transformers:
|
||||
- labels.yaml
|
||||
|
||||
@@ -3,8 +3,8 @@ kind: LabelTransformer
|
||||
metadata:
|
||||
name: labels
|
||||
labels:
|
||||
env: dev
|
||||
instance: webapp
|
||||
app.kubernetes.io/environment: dev
|
||||
app.kubernetes.io/instance: webapp
|
||||
fieldSpecs:
|
||||
- path: metadata/labels
|
||||
create: true
|
||||
|
||||
@@ -5,6 +5,7 @@ resources:
|
||||
- ../../bases/backend
|
||||
- ../../bases/frontend
|
||||
- ../../bases/cache
|
||||
- ../../bases/database
|
||||
- namespace.yaml
|
||||
transformers:
|
||||
- labels.yaml
|
||||
|
||||
@@ -3,8 +3,8 @@ kind: LabelTransformer
|
||||
metadata:
|
||||
name: labels
|
||||
labels:
|
||||
env: production
|
||||
instance: webapp
|
||||
app.kubernetes.io/environment: production
|
||||
app.kubernetes.io/instance: webapp
|
||||
fieldSpecs:
|
||||
- path: metadata/labels
|
||||
create: true
|
||||
|
||||
@@ -5,6 +5,7 @@ resources:
|
||||
- ../../bases/backend
|
||||
- ../../bases/frontend
|
||||
- ../../bases/cache
|
||||
- ../../bases/database
|
||||
- namespace.yaml
|
||||
transformers:
|
||||
- labels.yaml
|
||||
|
||||
@@ -3,8 +3,8 @@ kind: LabelTransformer
|
||||
metadata:
|
||||
name: labels
|
||||
labels:
|
||||
env: staging
|
||||
instance: webapp
|
||||
app.kubernetes.io/environment: staging
|
||||
app.kubernetes.io/instance: webapp
|
||||
fieldSpecs:
|
||||
- path: metadata/labels
|
||||
create: true
|
||||
|
||||
Reference in New Issue
Block a user