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

Add Degraded Example Resources #352

Open
wants to merge 1 commit into
base: master
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
14 changes: 14 additions & 0 deletions degraded-example/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Degraded Example

This folder contains Kubernetes manifests for a degraded application. The purpose of this app is to demonstrate how ArgoCD displays and manages degraded resources.

## Purpose
The `degraded-example` app is designed to help users understand how ArgoCD handles and displays issues such as:
- Image pull errors
- Misconfigured services
- Missing dependencies (e.g., ConfigMaps, Secrets)
- Storage and scheduling issues

These examples simulate real-world problems that can occur in Kubernetes deployments.

---
23 changes: 23 additions & 0 deletions degraded-example/examples/conflicting-rules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: conflicting-rules-ingress
spec:
rules:
- host: example.com
http:
paths:
- path: /path
pathType: Prefix
backend:
service:
name: service-a
port:
number: 80
- path: /path # Duplicate path causing conflict
pathType: Prefix
backend:
service:
name: service-b
port:
number: 80
18 changes: 18 additions & 0 deletions degraded-example/examples/headless-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: invalid-statefulset
spec:
serviceName: missing-headless-service # Service does not exist
replicas: 1
selector:
matchLabels:
app: invalid-statefulset
template:
metadata:
labels:
app: invalid-statefulset
spec:
containers:
- name: main-container
image: nginx:latest
23 changes: 23 additions & 0 deletions degraded-example/examples/insufficient-resources.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: insufficient-resources
labels:
app: insufficient-resources
spec:
replicas: 1
selector:
matchLabels:
app: insufficient-resources
template:
metadata:
labels:
app: insufficient-resources
spec:
containers:
- name: main-container
image: nginx:latest
resources:
requests:
memory: "10Ti" # Exceeds cluster capacity
cpu: "5000" # Exceeds cluster capacity
30 changes: 30 additions & 0 deletions degraded-example/examples/insufficient-volume-claims.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: insufficient-pvc-statefulset
spec:
serviceName: some-service
replicas: 3
selector:
matchLabels:
app: insufficient-pvc-statefulset
template:
metadata:
labels:
app: insufficient-pvc-statefulset
spec:
containers:
- name: main-container
image: nginx:latest
volumeMounts:
- name: data
mountPath: /data
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 1Gi
storageClassName: non-existent-storage-class # Causes PVC failure
16 changes: 16 additions & 0 deletions degraded-example/examples/invalid-backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: invalid-ingress
spec:
rules:
- host: example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: non-existent-service # Service does not exist
port:
number: 80
6 changes: 6 additions & 0 deletions degraded-example/examples/invalid-key.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: invalid-configmap
data:
invalid-key$: "This key is invalid" # Invalid key name
18 changes: 18 additions & 0 deletions degraded-example/examples/invalid-metrics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: invalid-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: some-deployment
minReplicas: 1
maxReplicas: 10
metrics:
- type: Resource
resource:
name: invalid-metric # Invalid resource metric
target:
type: Utilization
averageUtilization: 50
10 changes: 10 additions & 0 deletions degraded-example/examples/invalid-nodeselector.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: Pod
metadata:
name: degraded-pod
spec:
nodeSelector:
invalid-key: invalid-value # Node selector does not match any node
containers:
- name: main-container
image: nginx:latest
11 changes: 11 additions & 0 deletions degraded-example/examples/invalid-portconfiguration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: invalid-port-service
spec:
selector:
app: some-app
ports:
- protocol: TCP
port: 80
targetPort: 9999 # No container listens on this port
14 changes: 14 additions & 0 deletions degraded-example/examples/invalid-rules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: invalid-networkpolicy
spec:
podSelector: {}
policyTypes:
- Ingress
- Egress
ingress:
- from:
- namespaceSelector:
matchLabels:
non-existent-label: value # No matching namespace
14 changes: 14 additions & 0 deletions degraded-example/examples/invalid-schedule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: invalid-cronjob
spec:
schedule: "invalid-schedule" # Invalid cron expression
jobTemplate:
spec:
template:
spec:
containers:
- name: main-container
image: nginx:latest
restartPolicy: OnFailure
21 changes: 21 additions & 0 deletions degraded-example/examples/invalid-schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: invalid-crd.example.com
spec:
group: example.com
names:
kind: InvalidCRD
plural: invalidcrds
singular: invalidcrd
scope: Namespaced
versions:
- name: v1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: string # Invalid schema (should be an object)
11 changes: 11 additions & 0 deletions degraded-example/examples/invalid-selector.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: degraded-app-service
spec:
selector:
app: non-existent-selector # Selector mismatch to cause Service issues
ports:
- protocol: TCP
port: 80
targetPort: 8080
11 changes: 11 additions & 0 deletions degraded-example/examples/invalid-volumemount.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: Pod
metadata:
name: invalid-volume-pod
spec:
containers:
- name: main-container
image: nginx:latest
volumeMounts:
- mountPath: /data
name: missing-volume # Volume not defined
22 changes: 22 additions & 0 deletions degraded-example/examples/missing-configmap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: degraded-app-config
labels:
app: degraded-app-config
spec:
replicas: 1
selector:
matchLabels:
app: degraded-app-config
template:
metadata:
labels:
app: degraded-app-config
spec:
containers:
- name: main-container
image: nginx:latest
envFrom:
- configMapRef:
name: missing-configmap # ConfigMap not created
11 changes: 11 additions & 0 deletions degraded-example/examples/missing-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: batch/v1
kind: Job
metadata:
name: missing-image-job
spec:
template:
spec:
containers:
- name: main-container
image: missing-image:latest # Non-existent image
restartPolicy: Never
6 changes: 6 additions & 0 deletions degraded-example/examples/missing-secret.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: invalid-serviceaccount
secrets:
- name: missing-secret # Secret not created
21 changes: 21 additions & 0 deletions degraded-example/examples/non-existing-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: degraded-app
labels:
app: degraded-app
spec:
replicas: 2
selector:
matchLabels:
app: degraded-app
template:
metadata:
labels:
app: degraded-app
spec:
containers:
- name: main-container
image: non-existent-image:latest # Non-existent image to cause ImagePullBackOff
ports:
- containerPort: 8080
11 changes: 11 additions & 0 deletions degraded-example/examples/unavailable-storageclass.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: degraded-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: non-existent-storage-class # Invalid storage class
17 changes: 17 additions & 0 deletions degraded-example/examples/zero-replicas.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: zero-replicas-replicaset
spec:
replicas: 0 # No pods will be created
selector:
matchLabels:
app: zero-replicas-replicaset
template:
metadata:
labels:
app: zero-replicas-replicaset
spec:
containers:
- name: main-container
image: nginx:latest