Skip to content

Commit

Permalink
Define a podinfo KRO definition elifesciences/issues#9158
Browse files Browse the repository at this point in the history
  • Loading branch information
scottaubrey committed Jan 31, 2025
1 parent f0d4637 commit 2715d1f
Showing 1 changed file with 107 additions and 0 deletions.
107 changes: 107 additions & 0 deletions kro-definitions/podinfo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
apiVersion: kro.run/v1alpha1
kind: ResourceGraphDefinition
metadata:
name: podinfo
spec:
schema:
apiVersion: v1alpha1
kind: Podinfo # API kind
spec:
env: string
replicas: integer | default=3
image:
repo: string | default="stefanprodan/podinfo"
tag: string | default="latest"
ingress:
enabled: boolean | default=false
host: string
status:
availableReplicas: ${deployment.status.availableReplicas}
conditions: ${deployment.status.conditions}

resources:
- id: deployment
definition:
apiVersion: apps/v1
kind: Deployment
metadata:
name: podinfo-${schema.spec.env}
labels:
app: podinfo-${schema.spec.env}
spec:
replicas: ${schema.spec.replicas}
selector:
matchLabels:
app: podinfo-${schema.spec.env}
template:
metadata:
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "9797"
labels:
app: podinfo-${schema.spec.env}
spec:
containers:
- name: podinfod
image: ${schema.spec.image.repo}:${schema.spec.image.tag}
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: 9898
protocol: TCP
- name: http-metrics
containerPort: 9797
protocol: TCP
- name: grpc
containerPort: 9999
protocol: TCP
command:
- ./podinfo
- --port=9898
- --port-metrics=9797
- --grpc-port=9999
- --grpc-service-name=podinfo
- --level=debug
- --random-delay=false
- --random-error=false
env:
- name: PODINFO_UI_COLOR
value: "#34577c"
livenessProbe:
exec:
command:
- podcli
- check
- http
- localhost:9898/healthz
initialDelaySeconds: 5
timeoutSeconds: 5
readinessProbe:
exec:
command:
- podcli
- check
- http
- localhost:9898/readyz
initialDelaySeconds: 5
timeoutSeconds: 5
resources:
limits:
cpu: 2000m
memory: 512Mi
requests:
cpu: 100m
memory: 64Mi

- id: service
definition:
apiVersion: v1
kind: Service
metadata:
name: podinfo
spec:
selector:
app: podinfo
type: ClusterIP
ports:
- port: 9898

0 comments on commit 2715d1f

Please sign in to comment.