Skip to content

Commit

Permalink
Improved values schema
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianeicher committed Mar 22, 2021
1 parent f33234c commit 58c1a0c
Show file tree
Hide file tree
Showing 2 changed files with 123 additions and 18 deletions.
139 changes: 121 additions & 18 deletions charts/generic-service/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"properties": {
"name": {
"type": "string",
"description": "The name of the service (used for `app.kubernetes.io/name` label)"
"description": "The name of the service (used for app.kubernetes.io/name label)"
},
"fullname": {
"type": "string",
"description": "The name of the service instance (used for resource names and `app.kubernetes.io/instance` label)"
"description": "The name of the service instance (used for resource names and app.kubernetes.io/instance label)"
},
"image": {
"type": "object",
Expand All @@ -23,12 +23,13 @@
},
"tag": {
"type": "string",
"description": "The tag of the Docker Image to run (also used for `app.kubernetes.io/version` label)"
"description": "The tag of the Docker Image to run (also used for app.kubernetes.io/version label)"
},
"pullPolicy": {
"type": "string",
"enum": ["Never", "IfNotPresent", "Alawys"],
"description": "Set to `Always` to try to pull new versions of the Docker Image"
"enum": ["Never", "IfNotPresent", "Always"],
"default": "IfNotPresent",
"description": "Set to Always to try to pull new versions of the Docker Image"
}
},
"required": [
Expand Down Expand Up @@ -58,11 +59,51 @@
},
"livenessProbe": {
"type": "object",
"description": "Probe that causes the service to be restarted when failing"
"description": "Probe that causes the service to be restarted when failing",
"properties": {
"initialDelaySeconds": {"type": "integer"},
"periodSeconds": {"type": "integer"},
"httpGet": {
"type": "object",
"properties": {
"port": {"type": "string"},
"path": {"type": "string"}
}
},
"exec": {
"type": "object",
"properties": {
"command": {
"type": "array",
"items": [{"type": "string"}]
}
}
}
}
},
"readinessProbe": {
"type": "object",
"description": "Probe that prevents the service from receiving traffic when failing"
"description": "Probe that prevents the service from receiving traffic when failing",
"properties": {
"initialDelaySeconds": {"type": "integer"},
"periodSeconds": {"type": "integer"},
"httpGet": {
"type": "object",
"properties": {
"port": {"type": "string"},
"path": {"type": "string"}
}
},
"exec": {
"type": "object",
"properties": {
"command": {
"type": "array",
"items": [{"type": "string"}]
}
}
}
}
},
"labels": {
"type": "object",
Expand All @@ -79,47 +120,60 @@
"properties": {
"requests": {
"type": "object",
"description": "The minimum resources requested/reserved for the service",
"properties": {
"memory": {"type": "string"},
"cpu": {"type": "string"}
},
"description": "The minimum resources requested/reserved for the service"
"memory": {
"type": "string",
"default": "64M"
},
"cpu": {
"type": "string"
}
}
},
"limits": {
"type": "object",
"description": "The maximum resources the service can use",
"properties": {
"properties": {
"memory": {"type": "string"},
"cpu": {"type": "string"}
"memory": {
"type": "string",
"default": "128M"
},
"cpu": {
"type": "string"
}
},
"description": "The maximum resources the service can use"
}
}
}
},
"replicas": {
"type": "integer",
"default": 1,
"description": "The number of instances of the service to run (set at least 2 for Pod Disruption Budget)"
},
"autoscaling": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"default": false,
"description": "Enables automatic starting of additional instances based on CPU load"
},
"maxReplicas": {
"type": "integer",
"default": 3,
"description": "The maximum number of instances to run (must be larger than replicas)"
},
"targetCpu": {
"type": "integer",
"default": 80,
"description": "The desired average CPU load in percent"
}
}
},
"rollingUpdate": {
"type": "boolean",
"default": true,
"description": "Controls whether to wait for new versions to be up and running before shutting down old version"
},
"nodeSelector": {
Expand All @@ -132,6 +186,7 @@
"properties": {
"enabled": {
"type": "boolean",
"default": false,
"description": "Enables persistent storage for the service"
},
"storageClass": {
Expand All @@ -140,6 +195,7 @@
},
"size": {
"type": "string",
"default": "1G",
"description": "The size of the persistent volume to create for the service"
},
"mountPath": {
Expand Down Expand Up @@ -184,14 +240,17 @@
"properties": {
"enabled": {
"type": "boolean",
"default": false,
"description": "Enables ingress into the service (either cluster-internal or public)"
},
"port": {
"type": "integer",
"default": 80,
"description": "The container port ingress traffic is routed to"
},
"protocol": {
"type": "string",
"default": "http",
"description": "The protocol used for ingress (e.g., http or grpc)"
},
"domains": {
Expand Down Expand Up @@ -223,6 +282,7 @@
"properties": {
"enabled": {
"type": "boolean",
"default": false,
"description": "Use Istio VirtualService instead of Kubernetes Ingress resource"
},
"gateways": {
Expand All @@ -241,6 +301,7 @@
},
"timeout": {
"type": "string",
"default": "15s",
"description": "Istio timeout (see https://istio.io/docs/tasks/traffic-management/request-timeouts/)"
},
"retries": {
Expand All @@ -256,11 +317,39 @@
"properties": {
"enabled": {
"type": "boolean",
"default": false,
"description": "Use Flagger for canary rollouts"
},
"canaryAnalysis": {
"type": "object",
"description": "Configuration for canary analysis"
"description": "Configuration for canary analysis",
"properties": {
"threshold": {
"type": "integer",
"default": 5
},
"maxWeight": {
"type": "integer",
"default": 50
},
"stepWeight": {
"type": "integer",
"default": 10
},
"metrics": {
"type": "array",
"items": [
{
"type": "object",
"properties": {
"name": {"type": "string"},
"threshold": {"type": "integer"},
"interval": {"type": "string"}
}
}
]
}
}
}
}
},
Expand All @@ -269,10 +358,12 @@
"properties": {
"enabled": {
"type": "boolean",
"default": false,
"description": "Enable tracing with Jaeger agent (injected as sidecar)"
},
"probability": {
"type": "integer",
"default": 1.0,
"description": "Probability of any single trace being sampled; can be overridden for incoming requests e.g. via Istio"
}
}
Expand All @@ -282,18 +373,22 @@
"properties": {
"enabled": {
"type": "boolean",
"default": false,
"description": "Use Prometheus for monitoring / metrics scraping"
},
"port": {
"type": "integer",
"default": 9100,
"description": "The port to be scraped for monitoring data"
},
"path": {
"type": "string",
"default": "/metrics",
"description": "The path to be scraped for monitoring data"
},
"interval": {
"type": "string",
"default": "1m",
"description": "The interval at which monitoring data is scraped"
}
}
Expand All @@ -303,7 +398,8 @@
"properties": {
"enabled": {
"type": "boolean",
"default": "Applies default alert rules like unavailable pods or RAM usage (if monitoring.enabled is true)"
"default": true,
"description": "Applies default alert rules like unavailable pods or RAM usage (if monitoring.enabled is true)"
},
"labels": {
"type": "object",
Expand All @@ -315,6 +411,7 @@
"properties": {
"thresholdFactor": {
"type": "number",
"default": "0.9",
"description": "The maximum factor (between 0 and 1) of memory usage allowed before alerting"
}
}
Expand All @@ -324,14 +421,17 @@
"properties": {
"sampleInterval": {
"type": "string",
"default": "5m",
"description": "The time interval in which to measure ratio of HTTP 4xx responses for the current state"
},
"referenceInterval": {
"type": "string",
"default": "1d",
"description": "The time interval in which to measure ratio of HTTP 4xx responses as a reference for the normal state"
},
"thresholdFactor": {
"type": "number",
"default": "1.5",
"description": "The maximum factor between the current state and the normal state of HTTP 4xx response ratio allowed"
}
}
Expand All @@ -341,14 +441,17 @@
"properties": {
"sampleInterval": {
"type": "string",
"default": "1h",
"description": "The time interval in which to measure average HTTP response times for the current state"
},
"referenceInterval": {
"type": "string",
"default": "1d",
"description": "The time interval in which to measure average HTTP response times for the normal state"
},
"thresholdFactor": {
"type": "number",
"default": "1.5",
"description": "The maximum factor between the current state and the normal state of HTTP response times allowed"
}
}
Expand Down
2 changes: 2 additions & 0 deletions charts/generic-service/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ annotations: {}
resources:
requests:
memory: 64M
# cpu:
limits:
memory: 128M
# cpu:

replicas: 1

Expand Down

0 comments on commit 58c1a0c

Please sign in to comment.