diff --git a/charts/kruise-game b/charts/kruise-game index 8adf4b5..b4ab06e 120000 --- a/charts/kruise-game +++ b/charts/kruise-game @@ -1 +1 @@ -../versions/kruise-game/1.0.0 \ No newline at end of file +../versions/kruise-game/1.1.0 \ No newline at end of file diff --git a/charts/kruise-game-observability-demo b/charts/kruise-game-observability-demo new file mode 120000 index 0000000..63c644d --- /dev/null +++ b/charts/kruise-game-observability-demo @@ -0,0 +1 @@ +../versions/kruise-game-observability-demo/0.1.0 \ No newline at end of file diff --git a/versions/kruise-game-observability-demo/0.1.0/Chart.lock b/versions/kruise-game-observability-demo/0.1.0/Chart.lock new file mode 100644 index 0000000..869f6d4 --- /dev/null +++ b/versions/kruise-game-observability-demo/0.1.0/Chart.lock @@ -0,0 +1,24 @@ +dependencies: +- name: kruise + repository: https://openkruise.github.io/charts/ + version: 1.8.0 +- name: kruise-game + repository: file://../../kruise-game/1.1.0 + version: 1.1.0 +- name: opentelemetry-collector + repository: https://open-telemetry.github.io/opentelemetry-helm-charts + version: 0.140.0 +- name: loki + repository: https://grafana.github.io/helm-charts + version: 6.46.0 +- name: tempo + repository: https://grafana.github.io/helm-charts + version: 1.24.1 +- name: prometheus + repository: https://prometheus-community.github.io/helm-charts + version: 27.46.0 +- name: grafana + repository: https://grafana.github.io/helm-charts + version: 10.2.0 +digest: sha256:c102596633de319453dc6699df7c11d901198904906428924572e6ea0cc25df4 +generated: "2025-11-24T19:09:20.028399216-05:00" diff --git a/versions/kruise-game-observability-demo/0.1.0/Chart.yaml b/versions/kruise-game-observability-demo/0.1.0/Chart.yaml new file mode 100644 index 0000000..887a626 --- /dev/null +++ b/versions/kruise-game-observability-demo/0.1.0/Chart.yaml @@ -0,0 +1,43 @@ +apiVersion: v2 +name: kruise-game-observability-demo +description: An out-of-the-box observability demo stack for OpenKruiseGame, including OTel Collector, Prometheus, Loki, Tempo, and Grafana. +type: application +version: 0.1.0 +appVersion: 1.0.0 +dependencies: + # Core OKG components + - name: kruise + version: "1.8.0" + repository: "https://openkruise.github.io/charts/" + condition: kruise.enabled + + - name: kruise-game + version: "1.1.0" + repository: "file://../../kruise-game/1.1.0" + + # Telemetry pipeline + - name: opentelemetry-collector + version: "0.140.0" + repository: "https://open-telemetry.github.io/opentelemetry-helm-charts" + condition: opentelemetry-collector.enabled + + # LGTM "local sinks" + - name: loki + version: "6.46.0" + repository: "https://grafana.github.io/helm-charts" + condition: loki.enabled + + - name: tempo + version: "1.24.1" + repository: "https://grafana.github.io/helm-charts" + condition: tempo.enabled + + - name: prometheus + version: "27.46.0" + repository: "https://prometheus-community.github.io/helm-charts" + condition: prometheus.enabled + + - name: grafana + version: "10.2.0" + repository: "https://grafana.github.io/helm-charts" + condition: grafana.enabled diff --git a/versions/kruise-game-observability-demo/0.1.0/README.md b/versions/kruise-game-observability-demo/0.1.0/README.md new file mode 100644 index 0000000..a108bf3 --- /dev/null +++ b/versions/kruise-game-observability-demo/0.1.0/README.md @@ -0,0 +1,130 @@ +# KruiseGame Observability Demo Chart + +This chart deploys a complete observability stack for KruiseGame, including: +- **OpenKruise** (to provide PodProbeMarker / Advanced StatefulSet CRDs) +- **KruiseGame Controller Manager** (configured to emit telemetry) +- **OpenTelemetry Collector** (receives, processes, and exports telemetry) +- **Prometheus** (Metrics) +- **Loki** (Logs) +- **Tempo** (Traces) +- **Grafana** (Visualization with pre-loaded dashboards) +- **Minecraft demo GameServer** (HostPort network) to generate telemetry (logs/metrics/traces) + +It is designed for **demonstration and testing purposes** to showcase the observability capabilities of KruiseGame out-of-the-box. + +## Prerequisites + +- Kubernetes 1.18+ +- Helm >=3.12 (validated with Helm 4.x) + +## Installation + +### 1. Create Kind Cluster + +For local testing, use the provided kind configuration: + +```bash +kind create cluster --name okg-demo \ + --config charts/versions/kruise-game-observability-demo/0.1.0/kind-conf.yaml +``` + +### 2. Install Chart + +We recommend installing with the release name `okg-demo` in namespace `okg-demo` to ensure all service links work correctly by default. + +```bash +cd charts/versions/kruise-game-observability-demo/0.1.0 +helm upgrade --install okg-demo . \ + --namespace okg-demo --create-namespace \ + --wait --timeout 10m --dependency-update +``` + +> **Note**: The `--dependency-update` flag automatically resolves all chart dependencies. If you choose a different release name, you MUST override the endpoint URLs in `values.yaml` (e.g., `kruise-game.manager.otel.endpoint`, Grafana datasources) to match your release name. + +## Images and tags + +- Default KruiseGame image: `ghcr.io/ballista01/kruise-game-manager:dev` (tracks the latest dev build). +- To pin a specific build, override via Helm: + ```bash + # Use a specific tag (e.g., dev-) + helm upgrade --install okg-demo charts/kruise-game-observability-demo \ + --namespace okg-demo --create-namespace \ + --set kruise-game.image.tag=dev- + + # Or pin by digest (if available) + helm upgrade --install okg-demo charts/kruise-game-observability-demo \ + --namespace okg-demo --create-namespace \ + --set kruise-game.image.digest=sha256: + ``` + +## Verification + +1. **Wait for Pods**: Ensure all pods in `okg-demo` namespace are running. + ```bash + kubectl get pods -n okg-demo -w + ``` + +2. **Access Grafana**: + ```bash + # Use the provided port-forward script + ./port-forward-grafana.sh + # Or manually: + # kubectl port-forward --namespace okg-demo svc/okg-demo-grafana 3000:80 + ``` + Open http://localhost:3000 in your browser (default credentials: admin/admin). + +3. **View Dashboards**: + Go to **Dashboards** -> **Browse**. You will see the "KruiseGame Overview" dashboard. + +4. **Generate Traffic**: + Deploy a GameServerSet to see metrics, logs, and traces populate the dashboard. + +## Exploring Telemetry + +Once the demo is running, here's how to navigate the observability stack: + +### Dashboards (Metrics) +1. Open Grafana at http://localhost:3000 +2. Go to **Dashboards** → **KruiseGame Overview** +3. Key panels: + - **GameServer State Distribution** - Current state of all GameServers + - **Network Ready Duration** - Time for network to become ready + - **Error Rate by Plugin** - Network plugin error rates (look for exemplar dots) + +### Traces (Drilldown/Traces) +1. In Grafana, open **Drilldown** → **Traces** (Tempo). +2. Filter by attributes (e.g., `service.name="okg-controller-manager"`, `game.kruise.io.network.plugin.name="kubernetes_nodeport"`, `status.code=ERROR`). +3. Use the RED view (Rate/Errors/Duration) to spot spikes, then open a trace to inspect the span tree. + +### Logs (Drilldown/Logs) +1. In Grafana, open **Drilldown** → **Logs** (Loki). +2. Filter by labels (e.g., `{namespace="okg-demo"}` or add `|= "error"`). +3. Expand an entry to see `trace_id` and click it to jump back to the corresponding trace. + +### Trace-Log Correlation +The real power is connecting signals: +1. Find an error span in Tempo +2. Note the `trace_id` +3. In Loki, search for that trace ID to see all related logs +4. Or use Grafana's built-in "Logs for this span" feature + +For detailed diagnosis workflows and examples, see the [Observability Usage Guide](https://github.com/openkruise/kruise-game/blob/main/docs/en/observability/observability-usage.md#7-diagnosis-scenarios-cookbook). + +## Configuration + +This chart is a wrapper around several upstream charts. Key configurations are exposed in `values.yaml`, but you can override any sub-chart value. `kruise-game.manager.logFormat` only changes the human-readable Pod stdout; OTLP output stays structured either way. Use `--set kruise-game.manager.logFormat=json` if you prefer JSON logs in stdout. + +| Parameter | Description | Default | +|-----------|-------------|---------| +| `kruise-game.manager.logFormat` | Log output format for KruiseGame manager (`console` or `json`) | `console` | +| `kruise-game.manager.otel.enabled` | Enable OTel in KruiseGame | `true` | +| `opentelemetry-collector.mode` | Deployment mode for collector | `deployment` | +| `loki.enabled` | Enable Loki | `true` | +| `tempo.enabled` | Enable Tempo | `true` | +| `prometheus.enabled` | Enable Prometheus | `true` | +| `grafana.enabled` | Enable Grafana | `true` | +| `demoGameServer.enabled` | Deploy demo GameServerSet (Minecraft, HostPort) | `true` | + +OpenKruise is bundled to install required CRDs (PodProbeMarker, Advanced StatefulSet). Defaults: `kruise.installCRDs=true`, `kruise.installation.namespace=kruise-system`, `kruise.manager.replicaCount=1`. + +For full configuration, refer to the `values.yaml` file and the documentation of the dependency charts. diff --git a/versions/kruise-game-observability-demo/0.1.0/dashboards/kruise-game-dashboard.json b/versions/kruise-game-observability-demo/0.1.0/dashboards/kruise-game-dashboard.json new file mode 100644 index 0000000..c52ed26 --- /dev/null +++ b/versions/kruise-game-observability-demo/0.1.0/dashboards/kruise-game-dashboard.json @@ -0,0 +1,2579 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 40, + "links": [], + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 3, + "x": 0, + "y": 0 + }, + "id": 20, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.4.0-19378664917", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "expr": "sum(okg_gameservers_state_count)", + "fields": [ + { + "jsonPath": "" + } + ], + "method": "GET", + "queryParams": "", + "refId": "A", + "urlPath": "" + } + ], + "title": "GameServers", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 3, + "x": 3, + "y": 0 + }, + "id": 26, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.4.0-19378664917", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "expr": "max(okg_gameservers_state_count{state=\"Ready\"})", + "fields": [ + { + "jsonPath": "" + } + ], + "method": "GET", + "queryParams": "", + "refId": "A", + "urlPath": "" + } + ], + "title": "Ready GameServers", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 3, + "x": 6, + "y": 0 + }, + "id": 22, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.4.0-19378664917", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "expr": "max(okg_gameservers_opsState_count{opsState=\"Maintaining\"})", + "fields": [ + { + "jsonPath": "" + } + ], + "method": "GET", + "queryParams": "", + "refId": "A", + "urlPath": "" + } + ], + "title": "Maintaining GameServers", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 3, + "x": 9, + "y": 0 + }, + "id": 24, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.4.0-19378664917", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "expr": "max(okg_gameservers_opsState_count{opsState=\"WaitToBeDeleted\"})", + "fields": [ + { + "jsonPath": "" + } + ], + "method": "GET", + "queryParams": "", + "refId": "A", + "urlPath": "" + } + ], + "title": "WaitToBeDeleted GameServers", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [] + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 6, + "x": 12, + "y": 0 + }, + "id": 2, + "options": { + "legend": { + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "pieType": "pie", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "sort": "desc", + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.4.0-19378664917", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "editorMode": "code", + "expr": "max(okg_gameservers_state_count{state!=\"\"}) by (state)", + "fields": [ + { + "jsonPath": "" + } + ], + "legendFormat": "{{state}}", + "method": "GET", + "queryParams": "", + "range": true, + "refId": "A", + "urlPath": "" + } + ], + "title": "GameServer State (now)", + "type": "piechart" + }, + { + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [] + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 6, + "x": 18, + "y": 0 + }, + "id": 4, + "options": { + "legend": { + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "pieType": "pie", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "sort": "desc", + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.4.0-19378664917", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "editorMode": "code", + "expr": "max(okg_gameservers_opsState_count) by (opsState)", + "fields": [ + { + "jsonPath": "" + } + ], + "legendFormat": "{{opsState}}", + "method": "GET", + "queryParams": "", + "range": true, + "refId": "A", + "urlPath": "" + } + ], + "title": "GameServer OpsState (now)", + "type": "piechart" + }, + { + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 3, + "x": 0, + "y": 5 + }, + "id": 32, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.4.0-19378664917", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "expr": "max(okg_gameservers_state_count{state=\"Deleting\"})", + "fields": [ + { + "jsonPath": "" + } + ], + "method": "GET", + "queryParams": "", + "refId": "A", + "urlPath": "" + } + ], + "title": "Deleting GameServers", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 3, + "x": 3, + "y": 5 + }, + "id": 28, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.4.0-19378664917", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "expr": "max(okg_gameservers_state_count{state=\"Updating\"})", + "fields": [ + { + "jsonPath": "" + } + ], + "method": "GET", + "queryParams": "", + "refId": "A", + "urlPath": "" + } + ], + "title": "Updating GameServers", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 3, + "x": 6, + "y": 5 + }, + "id": 34, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.4.0-19378664917", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "expr": "max(okg_gameservers_state_count{state=\"NotReady\"})", + "fields": [ + { + "jsonPath": "" + } + ], + "method": "GET", + "queryParams": "", + "refId": "A", + "urlPath": "" + } + ], + "title": "NotReady GameServers", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 3, + "x": 9, + "y": 5 + }, + "id": 30, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.4.0-19378664917", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "expr": "max(okg_gameservers_total)", + "fields": [ + { + "jsonPath": "" + } + ], + "method": "GET", + "queryParams": "", + "refId": "A", + "urlPath": "" + } + ], + "title": "Existed GameServers", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 10 + }, + "id": 16, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.4.0-19378664917", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "editorMode": "code", + "exemplar": false, + "expr": "max(okg_gameservers_state_count{state!=\"\"}) by (state)", + "fields": [ + { + "jsonPath": "" + } + ], + "instant": false, + "interval": "", + "legendFormat": "{{state}}", + "method": "GET", + "queryParams": "", + "range": true, + "refId": "A", + "urlPath": "" + } + ], + "title": "GameServer State (Time series)", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 10 + }, + "id": 18, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.4.0-19378664917", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "editorMode": "code", + "expr": "max(okg_gameservers_opsState_count) by (opsState)", + "fields": [ + { + "jsonPath": "" + } + ], + "legendFormat": "{{opsState}}", + "method": "GET", + "queryParams": "", + "range": true, + "refId": "A", + "urlPath": "" + } + ], + "title": "GameServer OpsState (Time series)", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 18 + }, + "id": 36, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.4.0-19378664917", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "editorMode": "code", + "expr": "max(okg_gameserver_deletion_priority{gsNs=~\"$namespace\",gsName=~\"$gsName\"}) by (gsNs,gsName)", + "fields": [ + { + "jsonPath": "" + } + ], + "legendFormat": "{{gsNs}}/{{gsName}}", + "method": "GET", + "queryParams": "", + "range": true, + "refId": "A", + "urlPath": "" + } + ], + "title": "GameServer Deletion Priority", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 18 + }, + "id": 38, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.4.0-19378664917", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "editorMode": "code", + "expr": "max(okg_gameserver_update_priority{gsNs=~\"$namespace\",gsName=~\"$gsName\"}) by (gsNs,gsName)", + "fields": [ + { + "jsonPath": "" + } + ], + "legendFormat": "{{gsNs}}/{{gsName}}", + "method": "GET", + "queryParams": "", + "range": true, + "refId": "A", + "urlPath": "" + } + ], + "title": "GameServer Update Priority", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 26 + }, + "id": 12, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.4.0-19378664917", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "editorMode": "code", + "exemplar": false, + "expr": "max(okg_gameserversets_replicas_count{gsStatus=\"current\",gssNs=~\"$namespace\",gssName=~\"$gssName\"}) by (gssNs,gssName)", + "fields": [ + { + "jsonPath": "" + } + ], + "instant": false, + "interval": "", + "legendFormat": "{{gssNs}}/{{gssName}}", + "method": "GET", + "queryParams": "", + "range": true, + "refId": "A", + "urlPath": "" + } + ], + "title": "The Number of Current Gs in GameServerSet", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 26 + }, + "id": 6, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.4.0-19378664917", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "editorMode": "code", + "expr": "max(okg_gameserversets_replicas_count{gsStatus=\"available\",gssNs=~\"$namespace\",gssName=~\"$gssName\"}) by (gssNs,gssName)", + "fields": [ + { + "jsonPath": "" + } + ], + "legendFormat": "{{gssNs}}/{{gssName}}", + "method": "GET", + "queryParams": "", + "range": true, + "refId": "A", + "urlPath": "" + } + ], + "title": "The Number of Available Gs in GameServerSet", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 34 + }, + "id": 10, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.4.0-19378664917", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "editorMode": "code", + "expr": "max(okg_gameserversets_replicas_count{gsStatus=\"maintaining\",gssNs=~\"$namespace\",gssName=~\"$gssName\"}) by (gssNs,gssName)", + "fields": [ + { + "jsonPath": "" + } + ], + "legendFormat": "{{gssNs}}/{{gssName}}", + "method": "GET", + "queryParams": "", + "range": true, + "refId": "A", + "urlPath": "" + } + ], + "title": "The Number of Maintaining Gs in GameServerSet", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 34 + }, + "id": 8, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.4.0-19378664917", + "targets": [ + { + "cacheDurationSeconds": 300, + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "editorMode": "code", + "expr": "max(okg_gameserversets_replicas_count{gsStatus=\"waitToBeDeleted\",gssNs=~\"$namespace\",gssName=~\"$gssName\"}) by (gssNs,gssName)", + "fields": [ + { + "jsonPath": "" + } + ], + "legendFormat": "{{gssNs}}/{{gssName}}", + "method": "GET", + "queryParams": "", + "range": true, + "refId": "A", + "urlPath": "" + } + ], + "title": "The Number of WaitToBeDeleted Gs in GameServerSet", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 42 + }, + "id": 41, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.4.0-19378664917", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "(\r\n sum(\r\n rate(okg_network_calls_total{\r\n span_name=~\"$span\",\r\n game_kruise_io_network_status=\"ready\"\r\n }[$__rate_interval])\r\n ) by (game_kruise_io_network_plugin_name, cloud_provider)\r\n)\r\n/\r\nclamp_min(\r\n sum(\r\n rate(okg_network_calls_total{\r\n span_name=~\"$span\"\r\n }[$__rate_interval])\r\n ) by (game_kruise_io_network_plugin_name, cloud_provider),\r\n 1e-6\r\n) * 100\r\n", + "range": true, + "refId": "A" + } + ], + "title": "Ready Rate by Plugin and Cloud Provider", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 42 + }, + "id": 40, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.4.0-19378664917", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "histogram_quantile(\r\n 0.95,\r\n sum(\r\n rate(okg_network_duration_seconds_bucket{\r\n game_kruise_io_network_plugin_name=~\"$plugin\",\r\n cloud_provider=~\"$cloud\"\r\n }[$__rate_interval])\r\n ) by (le, span_name)\r\n)\r\n", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "P95 Latency by Phase (Span Name)", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 50 + }, + "id": 44, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.4.0-19378664917", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "(\r\n sum(\r\n rate(okg_network_calls_total{\r\n span_name=~\"$span\",\r\n game_kruise_io_network_status=\"waiting\"\r\n }[$__rate_interval])\r\n ) by (game_kruise_io_network_plugin_name, cloud_provider)\r\n)\r\n/\r\nclamp_min(\r\n sum(\r\n rate(okg_network_calls_total{\r\n span_name=~\"$span\"\r\n }[$__rate_interval])\r\n ) by (game_kruise_io_network_plugin_name, cloud_provider),\r\n 1e-6\r\n) * 100\r\n", + "range": true, + "refId": "A" + } + ], + "title": "Waiting Rate by Plugin and Cloud Provider", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 50 + }, + "id": 46, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.4.0-19378664917", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "editorMode": "code", + "expr": "sum(\r\n rate(okg_network_duration_seconds_sum{\r\n game_kruise_io_network_plugin_name=~\"$plugin\",\r\n cloud_provider=~\"$cloud\"\r\n }[$__rate_interval])\r\n) by (span_name)\r\n/\r\nsum(\r\n rate(okg_network_duration_seconds_count{\r\n game_kruise_io_network_plugin_name=~\"$plugin\",\r\n cloud_provider=~\"$cloud\"\r\n }[$__rate_interval])\r\n) by (span_name)\r\n", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Average Latency by Phase (Span Name)", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 58 + }, + "id": 43, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.4.0-19378664917", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "(\r\n sum(\r\n rate(okg_network_calls_total{\r\n span_name=~\"$span\",\r\n game_kruise_io_network_status=\"not_ready\"\r\n }[$__rate_interval])\r\n ) by (game_kruise_io_network_plugin_name, cloud_provider)\r\n)\r\n/\r\nclamp_min(\r\n sum(\r\n rate(okg_network_calls_total{\r\n span_name=~\"$span\"\r\n }[$__rate_interval])\r\n ) by (game_kruise_io_network_plugin_name, cloud_provider),\r\n 1e-6\r\n) * 100\r\n", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "\"not_ready\" Rate by Plugin and Cloud Provider", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 58 + }, + "id": 39, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.4.0-19378664917", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "histogram_quantile(\r\n 0.95,\r\n sum(\r\n rate(okg_network_duration_seconds_bucket{\r\n span_name=~\"$span\",\r\n cloud_provider=~\"$cloud\"\r\n }[$__rate_interval])\r\n ) by (le, game_kruise_io_network_plugin_name)\r\n)\r\n", + "format": "heatmap", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "P95 Network Plugin Latency by Span and Cloud Provider", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 66 + }, + "id": 45, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.4.0-19378664917", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "(\r\n sum by (game_kruise_io_network_plugin_name, cloud_provider) (\r\n rate(okg_network_calls_total{\r\n span_name=~\"$span\",\r\n status_code=~\"STATUS_CODE_ERROR|ERROR\"\r\n }[$__rate_interval])\r\n )\r\nor\r\n sum by (game_kruise_io_network_plugin_name, cloud_provider) (\r\n rate(okg_network_calls_total{\r\n span_name=~\"$span\",\r\n game_kruise_io_network_status=\"error\"\r\n }[$__rate_interval])\r\n )\r\n)\r\n/ clamp_min(\r\n sum by (game_kruise_io_network_plugin_name, cloud_provider) (\r\n rate(okg_network_calls_total{span_name=~\"$span\"}[$__rate_interval])\r\n ),\r\n 1e-6\r\n) * 100\r\n", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Error Rate by Plugin and Cloud Provider", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": 0 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 66 + }, + "id": 47, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.4.0-19378664917", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "editorMode": "code", + "exemplar": true, + "expr": "histogram_quantile(\r\n 0.95,\r\n sum(\r\n rate(okg_network_duration_seconds_bucket{\r\n game_kruise_io_network_plugin_name=~\"$plugin\",\r\n span_name=~\"$span\"\r\n }[$__rate_interval])\r\n ) by (le, game_kruise_io_network_status)\r\n)\r\n", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "P95 Latency by Network Status (Ready vs Not Ready)", + "type": "timeseries" + } + ], + "preload": false, + "refresh": "", + "schemaVersion": 42, + "tags": [], + "templating": { + "list": [ + { + "current": { + "text": "All", + "value": "$__all" + }, + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "definition": "label_values(okg_gameserversets_replicas_count, gssNs)", + "includeAll": true, + "name": "namespace", + "options": [], + "query": { + "query": "label_values(okg_gameserversets_replicas_count, gssNs)", + "refId": "temp-namespace-Variable-Query" + }, + "refresh": 1, + "regex": "", + "type": "query" + }, + { + "current": { + "text": "All", + "value": "$__all" + }, + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "definition": "label_values(okg_gameserversets_replicas_count, gssName) ", + "includeAll": true, + "name": "gssName", + "options": [], + "query": { + "query": "label_values(okg_gameserversets_replicas_count, gssName) ", + "refId": "temp-gssName-Variable-Query" + }, + "refresh": 1, + "regex": "", + "type": "query" + }, + { + "current": { + "text": "All", + "value": "$__all" + }, + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "definition": "label_values(okg_gameserver_deletion_priority, gsName) ", + "includeAll": true, + "name": "gsName", + "options": [], + "query": { + "query": "label_values(okg_gameserver_deletion_priority, gsName) ", + "refId": "temp-gsName-Variable-Query" + }, + "refresh": 1, + "regex": "", + "type": "query" + }, + { + "allValue": ".*", + "current": { + "text": "All", + "value": "$__all" + }, + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "definition": "label_values(okg_network_calls_total,span_name)", + "includeAll": true, + "multi": true, + "name": "span", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(okg_network_calls_total,span_name)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "type": "query" + }, + { + "allValue": ".*", + "current": { + "text": "All", + "value": "$__all" + }, + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "definition": "label_values(okg_network_calls_total,cloud_provider)", + "includeAll": true, + "multi": true, + "name": "cloud", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(okg_network_calls_total,cloud_provider)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "type": "query" + }, + { + "allValue": ".*", + "current": { + "text": "All", + "value": "$__all" + }, + "datasource": { + "type": "prometheus", + "uid": "Prometheus" + }, + "definition": "label_values(okg_gameserver_network_ready_duration_seconds,game_kruise_io_network_plugin_name)", + "includeAll": true, + "multi": true, + "name": "plugin", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(okg_gameserver_network_ready_duration_seconds,game_kruise_io_network_plugin_name)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "type": "query" + } + ] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "OKG Metrics Statics", + "uid": "c76d0cb9-fdb4-4775-ab85-99d5c1c2089e", + "version": 5 +} \ No newline at end of file diff --git a/versions/kruise-game-observability-demo/0.1.0/kind-conf.yaml b/versions/kruise-game-observability-demo/0.1.0/kind-conf.yaml new file mode 100644 index 0000000..cebee6d --- /dev/null +++ b/versions/kruise-game-observability-demo/0.1.0/kind-conf.yaml @@ -0,0 +1,5 @@ +kind: Cluster +apiVersion: kind.x-k8s.io/v1alpha4 +nodes: + - role: control-plane + - role: worker diff --git a/versions/kruise-game-observability-demo/0.1.0/port-forward-grafana.sh b/versions/kruise-game-observability-demo/0.1.0/port-forward-grafana.sh new file mode 100755 index 0000000..e1a16fd --- /dev/null +++ b/versions/kruise-game-observability-demo/0.1.0/port-forward-grafana.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +# Helper: Port-forward Grafana from the okg-demo chart in kind/local clusters. +# Usage: +# NAMESPACE=okg-demo RELEASE=okg-demo LOCAL_PORT=3000 ./port-forward-grafana.sh +# Defaults match the demo chart (`okg-demo` release/namespace, service ${RELEASE}-grafana). + +set -euo pipefail + +NAMESPACE="${NAMESPACE:-okg-demo}" +RELEASE="${RELEASE:-okg-demo}" +SERVICE="${SERVICE:-${RELEASE}-grafana}" +LOCAL_PORT="${LOCAL_PORT:-3000}" +REMOTE_PORT="${REMOTE_PORT:-80}" + +command -v kubectl >/dev/null || { echo "kubectl not found" >&2; exit 1; } + +if ! kubectl -n "${NAMESPACE}" get svc "${SERVICE}" >/dev/null 2>&1; then + echo "Service ${SERVICE} not found in namespace ${NAMESPACE}. Is the demo chart installed?" >&2 + exit 1 +fi + +echo "Port-forwarding svc/${SERVICE} ${LOCAL_PORT}->${REMOTE_PORT} in namespace ${NAMESPACE}..." +echo "Press Ctrl+C to stop." + +kubectl port-forward -n "${NAMESPACE}" "svc/${SERVICE}" "${LOCAL_PORT}:${REMOTE_PORT}" diff --git a/versions/kruise-game-observability-demo/0.1.0/templates/dashboards-configmap.yaml b/versions/kruise-game-observability-demo/0.1.0/templates/dashboards-configmap.yaml new file mode 100644 index 0000000..ba4fe04 --- /dev/null +++ b/versions/kruise-game-observability-demo/0.1.0/templates/dashboards-configmap.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.Name }}-dashboards + labels: + grafana_dashboard: "1" +data: + kruise-game-dashboard.json: |- +{{ .Files.Get "dashboards/kruise-game-dashboard.json" | indent 4 }} diff --git a/versions/kruise-game-observability-demo/0.1.0/templates/demo-gameserver.yaml b/versions/kruise-game-observability-demo/0.1.0/templates/demo-gameserver.yaml new file mode 100644 index 0000000..5dbe39a --- /dev/null +++ b/versions/kruise-game-observability-demo/0.1.0/templates/demo-gameserver.yaml @@ -0,0 +1,59 @@ +{{- if .Values.demoGameServer.enabled }} +apiVersion: game.kruise.io/v1alpha1 +kind: GameServerSet +metadata: + name: {{ .Values.demoGameServer.name }} + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: {{ .Values.demoGameServer.name }} + app.kubernetes.io/instance: {{ .Release.Name }} +spec: + replicas: {{ .Values.demoGameServer.replicas }} + updateStrategy: + rollingUpdate: + podUpdatePolicy: InPlaceIfPossible + {{- if .Values.demoGameServer.network }} + network: + networkType: {{ .Values.demoGameServer.network.type }} + {{- if .Values.demoGameServer.network.networkConf }} + networkConf: + {{- range .Values.demoGameServer.network.networkConf }} + - name: {{ .name }} + value: {{ .value | quote }} + {{- end }} + {{- else }} + networkConf: + - name: ContainerPorts + value: {{ .Values.demoGameServer.network.containerPorts | quote }} + {{- end }} + {{- end }} + gameServerTemplate: + spec: + containers: + - name: {{ .Values.demoGameServer.containerName }} + image: {{ .Values.demoGameServer.image }} + env: + - name: GS_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + {{- if .Values.demoGameServer.resources }} + resources: + {{- toYaml .Values.demoGameServer.resources | nindent 12 }} + {{- end }} +--- +{{- if .Values.demoGameServer.headlessService.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ .Values.demoGameServer.name }} + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: {{ .Values.demoGameServer.name }} + app.kubernetes.io/instance: {{ .Release.Name }} +spec: + clusterIP: None + selector: + game.kruise.io/owner-gss: {{ .Values.demoGameServer.name }} +{{- end }} +{{- end }} diff --git a/versions/kruise-game-observability-demo/0.1.0/values.yaml b/versions/kruise-game-observability-demo/0.1.0/values.yaml new file mode 100644 index 0000000..ae7846b --- /dev/null +++ b/versions/kruise-game-observability-demo/0.1.0/values.yaml @@ -0,0 +1,437 @@ +# Default values for kruise-game-observability-demo. +# This is a wrapper chart, so most configuration is for sub-charts. + +# 0. OpenKruise (installs CRDs required by KruiseGame) +kruise: + enabled: true + installCRDs: true + installation: + namespace: kruise-system + manager: + replicaCount: 1 + +# 1. KruiseGame Configuration +kruise-game: + # Default dev tag always points to the latest build; override tag or set digest for pinning + image: + repository: ghcr.io/ballista01/kruise-game-manager + tag: dev + digest: "" + pullPolicy: Always + manager: + # Log output format for manager. Allowed: console, json + logFormat: console + otel: + enabled: true + # Leave empty to use the default derived endpoint (ReleaseName-collector.ReleaseNamespace.svc:4317) + endpoint: "" + sampleRate: 1.0 + prometheus: + enabled: true + +# 2. OpenTelemetry Collector Configuration +opentelemetry-collector: + enabled: true + mode: deployment + image: + repository: "otel/opentelemetry-collector-contrib" + tag: "0.140.0" + extraEnvs: + - name: KUBE_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + # We will inject the full config in later steps based on E2E + config: + receivers: + otlp: + protocols: + grpc: + endpoint: 0.0.0.0:4317 + http: + endpoint: 0.0.0.0:4318 + prometheus/native: + config: + global: + scrape_interval: 15s + scrape_configs: + - job_name: okg-controller + scheme: http + scrape_interval: 30s + kubernetes_sd_configs: + - role: endpoints + namespaces: + names: ["kruise-game-system"] + relabel_configs: + - source_labels: [__meta_kubernetes_service_name, __meta_kubernetes_endpoint_port_name] + regex: .*controller-manager-metrics-service;.* + action: keep + + processors: + batch: + timeout: 5s + send_batch_size: 512 + filter/network_only: + error_mode: ignore + spans: + include: + match_type: strict + attributes: + - key: game.kruise.io.network.plugin.name + + # Memory limiter to prevent OOM + memory_limiter: + check_interval: 1s + limit_mib: 400 + spike_limit_mib: 100 + + # K8s attributes processor for E2E tests + # Only enrich fields that workload cannot inject by itself(Pod UID/IP) + k8sattributes: + auth_type: serviceAccount + passthrough: false + filter: + node_from_env_var: KUBE_NODE_NAME + extract: + metadata: + - k8s.pod.uid + pod_association: + - sources: + - from: resource_attribute + name: game.kruise.io.k8s.pod_ip + - sources: + - from: resource_attribute + name: k8s.pod.uid + - sources: + - from: connection + + transform/log_trace_labels: + log_statements: + - context: log + statements: + - set(attributes["trace_id"], trace_id.string) + - set(attributes["span_id"], span_id.string) + + # Tail sampling for intelligent trace sampling + tail_sampling: + decision_wait: 10s + num_traces: 100000 + expected_new_traces_per_sec: 100 + policies: + - name: errors + type: status_code + status_code: + status_codes: [ERROR] + - name: slow + type: latency + latency: + threshold_ms: 1000 + - name: sample_all + type: probabilistic + probabilistic: + sampling_percentage: 100 + + connectors: + spanmetrics/network: + namespace: okg_network + histogram: + unit: s + explicit: + buckets: ["0.01s", "0.1s", "0.25s", "0.5s", "1s", "2s", "5s", "10s"] + dimensions: + - name: game.kruise.io.network.plugin.name + - name: cloud.provider + - name: game.kruise.io.network.status + exemplars: + enabled: true + aggregation_temporality: cumulative + + exporters: + otlp/tempo: + endpoint: "okg-demo-tempo:4317" + tls: + insecure: true + + otlphttp/loki: + endpoint: "http://okg-demo-loki:3100/otlp" + tls: + insecure: true + + prometheus/local: + endpoint: 0.0.0.0:8889 + enable_open_metrics: true + + debug: + verbosity: detailed + sampling_initial: 5 + sampling_thereafter: 200 + + extensions: + health_check: + endpoint: 0.0.0.0:13133 + + service: + extensions: [health_check] + pipelines: + traces/network: + receivers: [otlp] + processors: [memory_limiter, k8sattributes, filter/network_only, batch] + exporters: [spanmetrics/network] + metrics/network: + receivers: [spanmetrics/network] + processors: [memory_limiter, batch] + exporters: [prometheus/local] + metrics/native: + receivers: [prometheus/native] + processors: [memory_limiter, batch] + exporters: [prometheus/local] + traces/storage: + receivers: [otlp] + processors: [memory_limiter, k8sattributes, batch, tail_sampling] + exporters: [otlp/tempo, debug] + logs: + receivers: [otlp] + processors: [memory_limiter, k8sattributes, transform/log_trace_labels, batch] + exporters: [otlphttp/loki] + + telemetry: + logs: + level: debug + metrics: + level: detailed + readers: + - pull: + exporter: + prometheus: + host: 0.0.0.0 + port: 8888 + without_units: true + without_type_suffix: true + without_scope_info: true + ports: + otlp: + enabled: true + containerPort: 4317 + servicePort: 4317 + hostPort: 4317 + protocol: TCP + otlp-http: + enabled: true + containerPort: 4318 + servicePort: 4318 + hostPort: 4318 + protocol: TCP + metrics: + enabled: true + containerPort: 8888 + servicePort: 8888 + hostPort: 8888 + protocol: TCP + prom-exporter: + enabled: true + containerPort: 8889 + servicePort: 8889 + hostPort: 8889 + protocol: TCP + health: + enabled: true + containerPort: 13133 + servicePort: 13133 + hostPort: 13133 + protocol: TCP + # Grant permissions for k8sattributes processor + clusterRole: + create: true + name: "" + rules: + - apiGroups: [""] + resources: ["pods", "namespaces", "nodes"] + verbs: ["get", "watch", "list"] + - apiGroups: [""] + resources: ["services", "endpoints"] + verbs: ["get", "list", "watch"] + +# 3. Loki Configuration +loki: + enabled: true + deploymentMode: SingleBinary + loki: + auth_enabled: false + commonConfig: + replication_factor: 1 + storage: + type: filesystem + schemaConfig: + configs: + - from: "2024-04-01" + store: tsdb + object_store: filesystem + schema: v13 + index: + prefix: index_ + period: 24h + singleBinary: + replicas: 1 + persistence: + enabled: false + extraVolumeMounts: + - name: storage + mountPath: /var/loki + extraVolumes: + - name: storage + emptyDir: {} + # Explicitly disable scalable components to avoid validation errors + read: + replicas: 0 + write: + replicas: 0 + backend: + replicas: 0 + + # Fix for nil pointer error in chart template (helpers sometimes need these even in SingleBinary) + storage: + type: filesystem + bucketNames: + chunks: chunks + ruler: ruler + admin: admin + +# 4. Tempo Configuration +tempo: + enabled: true + persistence: + enabled: false # Ephemeral for demo + tempo: + metricsGenerator: + enabled: true + remoteWriteUrl: "http://okg-demo-prometheus-server/api/v1/write" + overrides: + defaults: + metrics_generator: + processors: [local-blocks] + +# 5. Prometheus Configuration +prometheus: + enabled: true + server: + persistentVolume: + enabled: false # Ephemeral for demo + extraFlags: + - enable-feature=exemplar-storage + - web.enable-remote-write-receiver + global: + scrape_interval: 15s + evaluation_interval: 15s + external_labels: + cluster: okg-demo + alertmanager: + enabled: false + pushgateway: + enabled: false + nodeExporter: + enabled: false + serverFiles: + prometheus.yml: + scrape_configs: + - job_name: otel-collector + static_configs: + - targets: ['okg-demo-opentelemetry-collector:8888'] + + - job_name: okg-metrics + static_configs: + - targets: ['okg-demo-opentelemetry-collector:8889'] + + - job_name: tempo + static_configs: + - targets: ['okg-demo-tempo:3200'] + + - job_name: prometheus + static_configs: + - targets: ['localhost:9090'] + +# 6. Grafana Configuration +grafana: + enabled: true + persistence: + enabled: false # Ephemeral for demo + adminPassword: "admin" # Simple password for demo + # Datasources will be auto-configured via sidecar or values + datasources: + datasources.yaml: + apiVersion: 1 + datasources: + - name: Prometheus + type: prometheus + uid: prometheus + url: http://okg-demo-prometheus-server + access: proxy + isDefault: true + - name: Loki + type: loki + uid: loki + url: http://okg-demo-loki:3100 + access: proxy + jsonData: + derivedFields: + - name: trace_id + datasourceUid: tempo + matcherRegex: trace_id + matcherType: label + url: '$${__value.raw}' + urlDisplayLabel: 'View trace' + - name: Tempo + type: tempo + uid: tempo + url: http://okg-demo-tempo:3200 + access: proxy + jsonData: + nodeGraph: + enabled: true + tracesToLogs: + datasourceUid: loki + # widen the log query window relative to span start/end to avoid missing nearby errors + spanStartTimeShift: "-5m" + spanEndTimeShift: "5m" + filterByTraceID: true + filterBySpanID: false + lokiSearch: + datasourceUid: loki + + # Dashboards will be loaded from ConfigMap via sidecar + sidecar: + dashboards: + enabled: true + label: grafana_dashboard + searchNamespace: ALL + dashboardProviders: + dashboardproviders.yaml: + apiVersion: 1 + providers: + - name: 'default' + orgId: 1 + folder: '' + type: file + disableDeletion: false + editable: true + options: + path: /var/lib/grafana/dashboards/default + +# 7. Demo GameServer (Minecraft via HostPort) to generate telemetry +demoGameServer: + enabled: true + name: minecraft + replicas: 1 + image: registry.cn-hangzhou.aliyuncs.com/acs/minecraft-demo:1.12.2 + containerName: minecraft + network: + type: Kubernetes-HostPort + containerPorts: "minecraft:25565/TCP" # containerName:port/protocol + headlessService: + enabled: true + resources: + limits: + cpu: 500m + memory: 2Gi + requests: + cpu: 200m + memory: 1Gi diff --git a/versions/kruise-game/1.1.0/.helmignore b/versions/kruise-game/1.1.0/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/versions/kruise-game/1.1.0/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/versions/kruise-game/1.1.0/Chart.yaml b/versions/kruise-game/1.1.0/Chart.yaml new file mode 100644 index 0000000..c09d925 --- /dev/null +++ b/versions/kruise-game/1.1.0/Chart.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +name: kruise-game +description: Helm chart for kruise-game components +version: 1.1.0 +appVersion: 1.1.0 +kubeVersion: ">= 1.18.0-0" +sources: + - https://github.com/openkruise/kruise-game +annotations: + artifacthub.io/changes: | + - "[Changed]: https://github.com/openkruise/kruise-game/blob/master/CHANGELOG.md" diff --git a/versions/kruise-game/1.1.0/README.md b/versions/kruise-game/1.1.0/README.md new file mode 100644 index 0000000..ade7688 --- /dev/null +++ b/versions/kruise-game/1.1.0/README.md @@ -0,0 +1,66 @@ +# Kruise Game v1.0.0 + +## Configuration + +The following table lists the configurable parameters of the kruise-game chart and their default values. + +| Parameter | Description | Default | +|--------------------------------------------|-----------------------------------------------------------------------------|----------------------------------| +| `installation.namespace` | Namespace for kruise-game operation installation | `kruise-game-system` | +| `installation.createNamespace` | Whether to create the installation.namespace | `true` | +| `kruiseGame.fullname` | Nick name for kruise-game deployment and other configurations | `kruise-game-controller-manager` | +| `kruiseGame.healthBindPort` | Port for checking health of kruise-game container | `8082` | +| `kruiseGame.webhook.port` | Port of webhook served by kruise-game container | `443` | +| `kruiseGame.webhook.targetPort` | ObjectSelector for workloads in MutatingWebhookConfigurations | `9876` | +| `kruiseGame.apiServerQps` | Indicates the maximum QPS to the master from kruise-game-controller-manager | `5` | +| `kruiseGame.apiServerQpsBurst` | Maximum burst for throttle of kruise-game-controller-manager | `10` | +| `kruiseGame.gameserverWorkers` | Max concurrent workers for GameServer controller | `10` | +| `kruiseGame.gameserversetWorkers` | Max concurrent workers for GameServerSet controller | `10` | +| `replicaCount` | Replicas of kruise-game deployment | `1` | +| `image.repository` | Repository for kruise-game image | `ghcr.io/ballista01/kruise-game-manager` | +| `image.tag` | Tag for kruise-game image | `dev` | +| `image.digest` | Optional image digest to pin a build (overrides tag when set) | `` | +| `image.pullPolicy` | ImagePullPolicy for kruise-game container | `Always` | +| `serviceAccount.annotations` | The annotations for serviceAccount of kruise-game | ` ` | +| `service.port` | Port of kruise-game service | `8443` | +| `resources.limits.cpu` | CPU resource limit of kruise-game container | `500m` | +| `resources.limits.memory` | Memory resource limit of kruise-game container | `1Gi` | +| `resources.requests.cpu` | CPU resource request of kruise-game container | `10m` | +| `resources.requests.memory` | Memory resource request of kruise-game container | `64Mi` | +| `prometheus.enabled` | Whether to bind metric endpoint | `true` | +| `prometheus.monitorService.port` | Port of the monitorservice bind to | `8080` | +| `scale.service.port` | Port of the external scaler server binds to | `6000` | +| `scale.service.targetPort` | TargetPort of the external scaler server binds to | `6000` | +| `network.totalWaitTime` | Maximum time to wait for network ready, the unit is seconds | `60` | +| `network.probeIntervalTime` | Time interval for detecting network status, the unit is seconds | `5` | +| `cloudProvider.installCRD` | Whether to install CloudProvider CRD | `true` | +| `indexOffsetScheduler.enabled` | Whether to install index-offset-scheduler | `false` | +| `certificates.autoGenerated` | Whether to auto-generate webhook certificates | `true` | +| `certificates.secretName` | Name of the secret containing webhook certificates | `kruise-game-certs` | +| `certificates.mountPath` | Path to mount webhook certificates in container | `/tmp/webhook-certs/` | +| `certificates.certManager.enabled` | Whether to use cert-manager for certificate management | `false` | +| `certificates.certManager.duration` | Certificate validity duration | `8760h0m0s` | +| `certificates.certManager.renewBefore` | Time before expiry to renew certificate | `5840h0m0s` | +| `certificates.certManager.generateCA` | Whether to generate a Certificate Authority | `true` | +| `certificates.certManager.caSecretName` | Name of the secret containing the CA certificate | `kruise-game-ca` | +| `certificates.certManager.issuer.generate` | Whether to generate the issuer automatically | `true` | +| `certificates.certManager.issuer.name` | Name of the certificate issuer | `kruise-ca` | +| `certificates.certManager.issuer.kind` | Type of the certificate issuer | `ClusterIssuer` | +| `certificates.certManager.issuer.group` | API group of the certificate issuer | `cert-manager.io` | +| `manager.logFormat` | Log output format for manager (`console` or `json`); only affects stdout, OTLP remains structured. Use `--set manager.logFormat=json` if you want JSON in stdout. | `console` | +| `manager.otel.enabled` | Whether to enable OpenTelemetry tracing | `false` | +| `manager.otel.endpoint` | The OTLP gRPC endpoint of the collector (e.g., otel-collector:4317) | `otel-collector:4317` | +| `manager.otel.sampleRate` | Trace sampling probability (0.0 to 1.0) | `0.1` | + + + +Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, + +### Optional: the local image for China + +If you are in China and have problem to pull image from official DockerHub, you can use the registry hosted on Alibaba Cloud: + +```bash +$ helm install kruise-game https://... --set image.repository=registry.cn-hangzhou.aliyuncs.com/acs/kruise-game-manager +... +``` diff --git a/versions/kruise-game/1.1.0/crds/alibabacloud.com_poddnats.yaml b/versions/kruise-game/1.1.0/crds/alibabacloud.com_poddnats.yaml new file mode 100644 index 0000000..98700dc --- /dev/null +++ b/versions/kruise-game/1.1.0/crds/alibabacloud.com_poddnats.yaml @@ -0,0 +1,102 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.16.5 + name: poddnats.alibabacloud.com +spec: + group: alibabacloud.com + names: + kind: PodDNAT + listKind: PodDNATList + plural: poddnats + singular: poddnat + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + description: PodDNAT is the Schema for the poddnats API + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: PodDNATSpec defines the desired state of PodDNAT + properties: + eni: + type: string + entryId: + type: string + externalIP: + type: string + externalPort: + type: string + internalIP: + type: string + internalPort: + type: string + portMapping: + items: + properties: + externalPort: + type: string + internalPort: + type: string + type: object + type: array + protocol: + type: string + tableId: + type: string + vswitch: + type: string + zoneID: + type: string + type: object + status: + description: PodDNATStatus defines the observed state of PodDNAT + properties: + created: + description: created create status + type: string + entries: + description: entries + items: + description: Entry record for forwardEntry + properties: + externalIP: + type: string + externalPort: + type: string + forwardEntryId: + type: string + internalIP: + type: string + internalPort: + type: string + ipProtocol: + type: string + type: object + type: array + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/versions/kruise-game/1.1.0/crds/alibabacloud.com_podeips.yaml b/versions/kruise-game/1.1.0/crds/alibabacloud.com_podeips.yaml new file mode 100644 index 0000000..b2b772f --- /dev/null +++ b/versions/kruise-game/1.1.0/crds/alibabacloud.com_podeips.yaml @@ -0,0 +1,113 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.16.5 + name: podeips.alibabacloud.com +spec: + group: alibabacloud.com + names: + kind: PodEIP + listKind: PodEIPList + plural: podeips + singular: podeip + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + description: PodEIP is the Schema for the podeips API + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: PodEIPSpec defines the desired state of PodEIP + properties: + allocationID: + type: string + allocationType: + description: AllocationType ip type and release strategy + properties: + releaseAfter: + type: string + releaseStrategy: + allOf: + - enum: + - Follow + - TTL + - Never + - enum: + - Follow + - TTL + - Never + description: ReleaseStrategy is the type for eip release strategy + type: string + type: + default: Auto + description: IPAllocType is the type for eip alloc strategy + enum: + - Auto + - Static + type: string + required: + - releaseStrategy + - type + type: object + bandwidthPackageID: + type: string + required: + - allocationID + - allocationType + type: object + status: + description: PodEIPStatus defines the observed state of PodEIP + properties: + bandwidthPackageID: + description: BandwidthPackageID + type: string + eipAddress: + description: eip + type: string + internetChargeType: + type: string + isp: + type: string + name: + type: string + networkInterfaceID: + description: eni + type: string + podLastSeen: + description: PodLastSeen is the timestamp when pod resource last seen + format: date-time + type: string + privateIPAddress: + type: string + publicIpAddressPoolID: + type: string + resourceGroupID: + type: string + status: + type: string + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/versions/kruise-game/1.1.0/crds/game.kruise.io_gameservers.yaml b/versions/kruise-game/1.1.0/crds/game.kruise.io_gameservers.yaml new file mode 100644 index 0000000..33d3505 --- /dev/null +++ b/versions/kruise-game/1.1.0/crds/game.kruise.io_gameservers.yaml @@ -0,0 +1,1411 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.16.5 + name: gameservers.game.kruise.io +spec: + group: game.kruise.io + names: + kind: GameServer + listKind: GameServerList + plural: gameservers + shortNames: + - gs + singular: gameserver + scope: Namespaced + versions: + - additionalPrinterColumns: + - description: The current state of GameServer + jsonPath: .status.currentState + name: STATE + type: string + - description: The operations state of GameServer + jsonPath: .spec.opsState + name: OPSSTATE + type: string + - description: The current deletionPriority of GameServer + jsonPath: .status.deletionPriority + name: DP + type: string + - description: The current updatePriority of GameServer + jsonPath: .status.updatePriority + name: UP + type: string + - description: The age of GameServer + jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: GameServer is the Schema for the gameservers API + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: GameServerSpec defines the desired state of GameServer + properties: + containers: + description: |- + Containers can be used to make the corresponding GameServer container fields + different from the fields defined by GameServerTemplate in GameServerSetSpec. + items: + properties: + image: + description: |- + Image indicates the image of the container to update. + When Image updated, pod.spec.containers[*].image will be updated immediately. + type: string + name: + description: Name indicates the name of the container to update. + type: string + resources: + description: |- + Resources indicates the resources of the container to update. + When Resources updated, pod.spec.containers[*].Resources will be not updated immediately, + which will be updated when pod recreate. + properties: + claims: + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + This field is immutable. It can only be set for containers. + items: + description: ResourceClaim references one entry in PodSpec.ResourceClaims. + properties: + name: + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available + inside a container. + type: string + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: |- + Limits describes the maximum amount of compute resources allowed. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: |- + Requests describes the minimum amount of compute resources required. + If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, + otherwise to an implementation-defined value. Requests cannot exceed Limits. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + type: object + type: object + required: + - name + type: object + type: array + deletionPriority: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + networkDisabled: + type: boolean + opsState: + type: string + updatePriority: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + type: object + status: + description: GameServerStatus defines the observed state of GameServer + properties: + conditions: + description: Conditions is an array of current observed GameServer + conditions. + items: + properties: + lastProbeTime: + description: Last time we probed the condition. + format: date-time + type: string + lastTransitionTime: + description: Last time the condition transitioned from one status + to another. + format: date-time + type: string + message: + description: Human-readable message indicating details about + last transition. + type: string + reason: + description: Unique, one-word, CamelCase reason for the condition's + last transition. + type: string + status: + description: |- + Status is the status of the condition. + Can be True, False, Unknown. + type: string + type: + description: Type is the type of the condition. + type: string + required: + - status + - type + type: object + type: array + currentState: + type: string + deletionPriority: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + desiredState: + description: |- + INSERT ADDITIONAL STATUS FIELD - define observed state of cluster + Important: Run "make" to regenerate code after modifying this file + type: string + lastTransitionTime: + format: date-time + type: string + networkStatus: + properties: + createTime: + format: date-time + type: string + currentNetworkState: + type: string + desiredNetworkState: + type: string + externalAddresses: + items: + properties: + endPoint: + type: string + ip: + type: string + portRange: + properties: + portRange: + type: string + protocol: + description: Protocol defines network protocols supported + for things like container ports. + type: string + type: object + ports: + items: + properties: + name: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + protocol: + description: Protocol defines network protocols supported + for things like container ports. + type: string + required: + - name + type: object + type: array + required: + - ip + type: object + type: array + internalAddresses: + items: + properties: + endPoint: + type: string + ip: + type: string + portRange: + properties: + portRange: + type: string + protocol: + description: Protocol defines network protocols supported + for things like container ports. + type: string + type: object + ports: + items: + properties: + name: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + protocol: + description: Protocol defines network protocols supported + for things like container ports. + type: string + required: + - name + type: object + type: array + required: + - ip + type: object + type: array + lastTransitionTime: + format: date-time + type: string + networkType: + type: string + type: object + podStatus: + description: |- + PodStatus represents information about the status of a pod. Status may trail the actual + state of a system, especially if the node that hosts the pod cannot contact the control + plane. + properties: + conditions: + description: |- + Current service state of pod. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions + items: + description: PodCondition contains details for the current condition + of this pod. + properties: + lastProbeTime: + description: Last time we probed the condition. + format: date-time + type: string + lastTransitionTime: + description: Last time the condition transitioned from one + status to another. + format: date-time + type: string + message: + description: Human-readable message indicating details about + last transition. + type: string + reason: + description: Unique, one-word, CamelCase reason for the + condition's last transition. + type: string + status: + description: |- + Status is the status of the condition. + Can be True, False, Unknown. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions + type: string + type: + description: |- + Type is the type of the condition. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions + type: string + required: + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + containerStatuses: + description: |- + The list has one entry per container in the manifest. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-and-container-status + items: + description: ContainerStatus contains details for the current + status of this container. + properties: + allocatedResources: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: |- + AllocatedResources represents the compute resources allocated for this container by the + node. Kubelet sets this value to Container.Resources.Requests upon successful pod admission + and after successfully admitting desired pod resize. + type: object + containerID: + description: |- + ContainerID is the ID of the container in the format '://'. + Where type is a container runtime identifier, returned from Version call of CRI API + (for example "containerd"). + type: string + image: + description: |- + Image is the name of container image that the container is running. + The container image may not match the image used in the PodSpec, + as it may have been resolved by the runtime. + More info: https://kubernetes.io/docs/concepts/containers/images. + type: string + imageID: + description: |- + ImageID is the image ID of the container's image. The image ID may not + match the image ID of the image used in the PodSpec, as it may have been + resolved by the runtime. + type: string + lastState: + description: |- + LastTerminationState holds the last termination state of the container to + help debug container crashes and restarts. This field is not + populated if the container is still running and RestartCount is 0. + properties: + running: + description: Details about a running container + properties: + startedAt: + description: Time at which the container was last + (re-)started + format: date-time + type: string + type: object + terminated: + description: Details about a terminated container + properties: + containerID: + description: Container's ID in the format '://' + type: string + exitCode: + description: Exit status from the last termination + of the container + format: int32 + type: integer + finishedAt: + description: Time at which the container last terminated + format: date-time + type: string + message: + description: Message regarding the last termination + of the container + type: string + reason: + description: (brief) reason from the last termination + of the container + type: string + signal: + description: Signal from the last termination of + the container + format: int32 + type: integer + startedAt: + description: Time at which previous execution of + the container started + format: date-time + type: string + required: + - exitCode + type: object + waiting: + description: Details about a waiting container + properties: + message: + description: Message regarding why the container + is not yet running. + type: string + reason: + description: (brief) reason the container is not + yet running. + type: string + type: object + type: object + name: + description: |- + Name is a DNS_LABEL representing the unique name of the container. + Each container in a pod must have a unique name across all container types. + Cannot be updated. + type: string + ready: + description: |- + Ready specifies whether the container is currently passing its readiness check. + The value will change as readiness probes keep executing. If no readiness + probes are specified, this field defaults to true once the container is + fully started (see Started field). + + The value is typically used to determine whether a container is ready to + accept traffic. + type: boolean + resources: + description: |- + Resources represents the compute resource requests and limits that have been successfully + enacted on the running container after it has been started or has been successfully resized. + properties: + claims: + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + This field is immutable. It can only be set for containers. + items: + description: ResourceClaim references one entry in + PodSpec.ResourceClaims. + properties: + name: + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available + inside a container. + type: string + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: |- + Limits describes the maximum amount of compute resources allowed. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: |- + Requests describes the minimum amount of compute resources required. + If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, + otherwise to an implementation-defined value. Requests cannot exceed Limits. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + type: object + type: object + restartCount: + description: |- + RestartCount holds the number of times the container has been restarted. + Kubelet makes an effort to always increment the value, but there + are cases when the state may be lost due to node restarts and then the value + may be reset to 0. The value is never negative. + format: int32 + type: integer + started: + description: |- + Started indicates whether the container has finished its postStart lifecycle hook + and passed its startup probe. + Initialized as false, becomes true after startupProbe is considered + successful. Resets to false when the container is restarted, or if kubelet + loses state temporarily. In both cases, startup probes will run again. + Is always true when no startupProbe is defined and container is running and + has passed the postStart lifecycle hook. The null value must be treated the + same as false. + type: boolean + state: + description: State holds details about the container's current + condition. + properties: + running: + description: Details about a running container + properties: + startedAt: + description: Time at which the container was last + (re-)started + format: date-time + type: string + type: object + terminated: + description: Details about a terminated container + properties: + containerID: + description: Container's ID in the format '://' + type: string + exitCode: + description: Exit status from the last termination + of the container + format: int32 + type: integer + finishedAt: + description: Time at which the container last terminated + format: date-time + type: string + message: + description: Message regarding the last termination + of the container + type: string + reason: + description: (brief) reason from the last termination + of the container + type: string + signal: + description: Signal from the last termination of + the container + format: int32 + type: integer + startedAt: + description: Time at which previous execution of + the container started + format: date-time + type: string + required: + - exitCode + type: object + waiting: + description: Details about a waiting container + properties: + message: + description: Message regarding why the container + is not yet running. + type: string + reason: + description: (brief) reason the container is not + yet running. + type: string + type: object + type: object + volumeMounts: + description: Status of volume mounts. + items: + description: VolumeMountStatus shows status of volume + mounts. + properties: + mountPath: + description: MountPath corresponds to the original + VolumeMount. + type: string + name: + description: Name corresponds to the name of the original + VolumeMount. + type: string + readOnly: + description: ReadOnly corresponds to the original + VolumeMount. + type: boolean + recursiveReadOnly: + description: |- + RecursiveReadOnly must be set to Disabled, Enabled, or unspecified (for non-readonly mounts). + An IfPossible value in the original VolumeMount must be translated to Disabled or Enabled, + depending on the mount result. + type: string + required: + - mountPath + - name + type: object + type: array + x-kubernetes-list-map-keys: + - mountPath + x-kubernetes-list-type: map + required: + - image + - imageID + - name + - ready + - restartCount + type: object + type: array + x-kubernetes-list-type: atomic + ephemeralContainerStatuses: + description: Status for any ephemeral containers that have run + in this pod. + items: + description: ContainerStatus contains details for the current + status of this container. + properties: + allocatedResources: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: |- + AllocatedResources represents the compute resources allocated for this container by the + node. Kubelet sets this value to Container.Resources.Requests upon successful pod admission + and after successfully admitting desired pod resize. + type: object + containerID: + description: |- + ContainerID is the ID of the container in the format '://'. + Where type is a container runtime identifier, returned from Version call of CRI API + (for example "containerd"). + type: string + image: + description: |- + Image is the name of container image that the container is running. + The container image may not match the image used in the PodSpec, + as it may have been resolved by the runtime. + More info: https://kubernetes.io/docs/concepts/containers/images. + type: string + imageID: + description: |- + ImageID is the image ID of the container's image. The image ID may not + match the image ID of the image used in the PodSpec, as it may have been + resolved by the runtime. + type: string + lastState: + description: |- + LastTerminationState holds the last termination state of the container to + help debug container crashes and restarts. This field is not + populated if the container is still running and RestartCount is 0. + properties: + running: + description: Details about a running container + properties: + startedAt: + description: Time at which the container was last + (re-)started + format: date-time + type: string + type: object + terminated: + description: Details about a terminated container + properties: + containerID: + description: Container's ID in the format '://' + type: string + exitCode: + description: Exit status from the last termination + of the container + format: int32 + type: integer + finishedAt: + description: Time at which the container last terminated + format: date-time + type: string + message: + description: Message regarding the last termination + of the container + type: string + reason: + description: (brief) reason from the last termination + of the container + type: string + signal: + description: Signal from the last termination of + the container + format: int32 + type: integer + startedAt: + description: Time at which previous execution of + the container started + format: date-time + type: string + required: + - exitCode + type: object + waiting: + description: Details about a waiting container + properties: + message: + description: Message regarding why the container + is not yet running. + type: string + reason: + description: (brief) reason the container is not + yet running. + type: string + type: object + type: object + name: + description: |- + Name is a DNS_LABEL representing the unique name of the container. + Each container in a pod must have a unique name across all container types. + Cannot be updated. + type: string + ready: + description: |- + Ready specifies whether the container is currently passing its readiness check. + The value will change as readiness probes keep executing. If no readiness + probes are specified, this field defaults to true once the container is + fully started (see Started field). + + The value is typically used to determine whether a container is ready to + accept traffic. + type: boolean + resources: + description: |- + Resources represents the compute resource requests and limits that have been successfully + enacted on the running container after it has been started or has been successfully resized. + properties: + claims: + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + This field is immutable. It can only be set for containers. + items: + description: ResourceClaim references one entry in + PodSpec.ResourceClaims. + properties: + name: + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available + inside a container. + type: string + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: |- + Limits describes the maximum amount of compute resources allowed. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: |- + Requests describes the minimum amount of compute resources required. + If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, + otherwise to an implementation-defined value. Requests cannot exceed Limits. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + type: object + type: object + restartCount: + description: |- + RestartCount holds the number of times the container has been restarted. + Kubelet makes an effort to always increment the value, but there + are cases when the state may be lost due to node restarts and then the value + may be reset to 0. The value is never negative. + format: int32 + type: integer + started: + description: |- + Started indicates whether the container has finished its postStart lifecycle hook + and passed its startup probe. + Initialized as false, becomes true after startupProbe is considered + successful. Resets to false when the container is restarted, or if kubelet + loses state temporarily. In both cases, startup probes will run again. + Is always true when no startupProbe is defined and container is running and + has passed the postStart lifecycle hook. The null value must be treated the + same as false. + type: boolean + state: + description: State holds details about the container's current + condition. + properties: + running: + description: Details about a running container + properties: + startedAt: + description: Time at which the container was last + (re-)started + format: date-time + type: string + type: object + terminated: + description: Details about a terminated container + properties: + containerID: + description: Container's ID in the format '://' + type: string + exitCode: + description: Exit status from the last termination + of the container + format: int32 + type: integer + finishedAt: + description: Time at which the container last terminated + format: date-time + type: string + message: + description: Message regarding the last termination + of the container + type: string + reason: + description: (brief) reason from the last termination + of the container + type: string + signal: + description: Signal from the last termination of + the container + format: int32 + type: integer + startedAt: + description: Time at which previous execution of + the container started + format: date-time + type: string + required: + - exitCode + type: object + waiting: + description: Details about a waiting container + properties: + message: + description: Message regarding why the container + is not yet running. + type: string + reason: + description: (brief) reason the container is not + yet running. + type: string + type: object + type: object + volumeMounts: + description: Status of volume mounts. + items: + description: VolumeMountStatus shows status of volume + mounts. + properties: + mountPath: + description: MountPath corresponds to the original + VolumeMount. + type: string + name: + description: Name corresponds to the name of the original + VolumeMount. + type: string + readOnly: + description: ReadOnly corresponds to the original + VolumeMount. + type: boolean + recursiveReadOnly: + description: |- + RecursiveReadOnly must be set to Disabled, Enabled, or unspecified (for non-readonly mounts). + An IfPossible value in the original VolumeMount must be translated to Disabled or Enabled, + depending on the mount result. + type: string + required: + - mountPath + - name + type: object + type: array + x-kubernetes-list-map-keys: + - mountPath + x-kubernetes-list-type: map + required: + - image + - imageID + - name + - ready + - restartCount + type: object + type: array + x-kubernetes-list-type: atomic + hostIP: + description: |- + hostIP holds the IP address of the host to which the pod is assigned. Empty if the pod has not started yet. + A pod can be assigned to a node that has a problem in kubelet which in turns mean that HostIP will + not be updated even if there is a node is assigned to pod + type: string + hostIPs: + description: |- + hostIPs holds the IP addresses allocated to the host. If this field is specified, the first entry must + match the hostIP field. This list is empty if the pod has not started yet. + A pod can be assigned to a node that has a problem in kubelet which in turns means that HostIPs will + not be updated even if there is a node is assigned to this pod. + items: + description: HostIP represents a single IP address allocated + to the host. + properties: + ip: + description: IP is the IP address assigned to the host + type: string + required: + - ip + type: object + type: array + x-kubernetes-list-type: atomic + initContainerStatuses: + description: |- + The list has one entry per init container in the manifest. The most recent successful + init container will have ready = true, the most recently started container will have + startTime set. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-and-container-status + items: + description: ContainerStatus contains details for the current + status of this container. + properties: + allocatedResources: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: |- + AllocatedResources represents the compute resources allocated for this container by the + node. Kubelet sets this value to Container.Resources.Requests upon successful pod admission + and after successfully admitting desired pod resize. + type: object + containerID: + description: |- + ContainerID is the ID of the container in the format '://'. + Where type is a container runtime identifier, returned from Version call of CRI API + (for example "containerd"). + type: string + image: + description: |- + Image is the name of container image that the container is running. + The container image may not match the image used in the PodSpec, + as it may have been resolved by the runtime. + More info: https://kubernetes.io/docs/concepts/containers/images. + type: string + imageID: + description: |- + ImageID is the image ID of the container's image. The image ID may not + match the image ID of the image used in the PodSpec, as it may have been + resolved by the runtime. + type: string + lastState: + description: |- + LastTerminationState holds the last termination state of the container to + help debug container crashes and restarts. This field is not + populated if the container is still running and RestartCount is 0. + properties: + running: + description: Details about a running container + properties: + startedAt: + description: Time at which the container was last + (re-)started + format: date-time + type: string + type: object + terminated: + description: Details about a terminated container + properties: + containerID: + description: Container's ID in the format '://' + type: string + exitCode: + description: Exit status from the last termination + of the container + format: int32 + type: integer + finishedAt: + description: Time at which the container last terminated + format: date-time + type: string + message: + description: Message regarding the last termination + of the container + type: string + reason: + description: (brief) reason from the last termination + of the container + type: string + signal: + description: Signal from the last termination of + the container + format: int32 + type: integer + startedAt: + description: Time at which previous execution of + the container started + format: date-time + type: string + required: + - exitCode + type: object + waiting: + description: Details about a waiting container + properties: + message: + description: Message regarding why the container + is not yet running. + type: string + reason: + description: (brief) reason the container is not + yet running. + type: string + type: object + type: object + name: + description: |- + Name is a DNS_LABEL representing the unique name of the container. + Each container in a pod must have a unique name across all container types. + Cannot be updated. + type: string + ready: + description: |- + Ready specifies whether the container is currently passing its readiness check. + The value will change as readiness probes keep executing. If no readiness + probes are specified, this field defaults to true once the container is + fully started (see Started field). + + The value is typically used to determine whether a container is ready to + accept traffic. + type: boolean + resources: + description: |- + Resources represents the compute resource requests and limits that have been successfully + enacted on the running container after it has been started or has been successfully resized. + properties: + claims: + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + This field is immutable. It can only be set for containers. + items: + description: ResourceClaim references one entry in + PodSpec.ResourceClaims. + properties: + name: + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available + inside a container. + type: string + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: |- + Limits describes the maximum amount of compute resources allowed. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: |- + Requests describes the minimum amount of compute resources required. + If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, + otherwise to an implementation-defined value. Requests cannot exceed Limits. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + type: object + type: object + restartCount: + description: |- + RestartCount holds the number of times the container has been restarted. + Kubelet makes an effort to always increment the value, but there + are cases when the state may be lost due to node restarts and then the value + may be reset to 0. The value is never negative. + format: int32 + type: integer + started: + description: |- + Started indicates whether the container has finished its postStart lifecycle hook + and passed its startup probe. + Initialized as false, becomes true after startupProbe is considered + successful. Resets to false when the container is restarted, or if kubelet + loses state temporarily. In both cases, startup probes will run again. + Is always true when no startupProbe is defined and container is running and + has passed the postStart lifecycle hook. The null value must be treated the + same as false. + type: boolean + state: + description: State holds details about the container's current + condition. + properties: + running: + description: Details about a running container + properties: + startedAt: + description: Time at which the container was last + (re-)started + format: date-time + type: string + type: object + terminated: + description: Details about a terminated container + properties: + containerID: + description: Container's ID in the format '://' + type: string + exitCode: + description: Exit status from the last termination + of the container + format: int32 + type: integer + finishedAt: + description: Time at which the container last terminated + format: date-time + type: string + message: + description: Message regarding the last termination + of the container + type: string + reason: + description: (brief) reason from the last termination + of the container + type: string + signal: + description: Signal from the last termination of + the container + format: int32 + type: integer + startedAt: + description: Time at which previous execution of + the container started + format: date-time + type: string + required: + - exitCode + type: object + waiting: + description: Details about a waiting container + properties: + message: + description: Message regarding why the container + is not yet running. + type: string + reason: + description: (brief) reason the container is not + yet running. + type: string + type: object + type: object + volumeMounts: + description: Status of volume mounts. + items: + description: VolumeMountStatus shows status of volume + mounts. + properties: + mountPath: + description: MountPath corresponds to the original + VolumeMount. + type: string + name: + description: Name corresponds to the name of the original + VolumeMount. + type: string + readOnly: + description: ReadOnly corresponds to the original + VolumeMount. + type: boolean + recursiveReadOnly: + description: |- + RecursiveReadOnly must be set to Disabled, Enabled, or unspecified (for non-readonly mounts). + An IfPossible value in the original VolumeMount must be translated to Disabled or Enabled, + depending on the mount result. + type: string + required: + - mountPath + - name + type: object + type: array + x-kubernetes-list-map-keys: + - mountPath + x-kubernetes-list-type: map + required: + - image + - imageID + - name + - ready + - restartCount + type: object + type: array + x-kubernetes-list-type: atomic + message: + description: A human readable message indicating details about + why the pod is in this condition. + type: string + nominatedNodeName: + description: |- + nominatedNodeName is set only when this pod preempts other pods on the node, but it cannot be + scheduled right away as preemption victims receive their graceful termination periods. + This field does not guarantee that the pod will be scheduled on this node. Scheduler may decide + to place the pod elsewhere if other nodes become available sooner. Scheduler may also decide to + give the resources on this node to a higher priority pod that is created after preemption. + As a result, this field may be different than PodSpec.nodeName when the pod is + scheduled. + type: string + phase: + description: |- + The phase of a Pod is a simple, high-level summary of where the Pod is in its lifecycle. + The conditions array, the reason and message fields, and the individual container status + arrays contain more detail about the pod's status. + There are five possible phase values: + + Pending: The pod has been accepted by the Kubernetes system, but one or more of the + container images has not been created. This includes time before being scheduled as + well as time spent downloading images over the network, which could take a while. + Running: The pod has been bound to a node, and all of the containers have been created. + At least one container is still running, or is in the process of starting or restarting. + Succeeded: All containers in the pod have terminated in success, and will not be restarted. + Failed: All containers in the pod have terminated, and at least one container has + terminated in failure. The container either exited with non-zero status or was terminated + by the system. + Unknown: For some reason the state of the pod could not be obtained, typically due to an + error in communicating with the host of the pod. + + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-phase + type: string + podIP: + description: |- + podIP address allocated to the pod. Routable at least within the cluster. + Empty if not yet allocated. + type: string + podIPs: + description: |- + podIPs holds the IP addresses allocated to the pod. If this field is specified, the 0th entry must + match the podIP field. Pods may be allocated at most 1 value for each of IPv4 and IPv6. This list + is empty if no IPs have been allocated yet. + items: + description: PodIP represents a single IP address allocated + to the pod. + properties: + ip: + description: IP is the IP address assigned to the pod + type: string + required: + - ip + type: object + type: array + x-kubernetes-list-map-keys: + - ip + x-kubernetes-list-type: map + qosClass: + description: |- + The Quality of Service (QOS) classification assigned to the pod based on resource requirements + See PodQOSClass type for available QOS classes + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-qos/#quality-of-service-classes + type: string + reason: + description: |- + A brief CamelCase message indicating details about why the pod is in this state. + e.g. 'Evicted' + type: string + resize: + description: |- + Status of resources resize desired for pod's containers. + It is empty if no resources resize is pending. + Any changes to container resources will automatically set this to "Proposed" + type: string + resourceClaimStatuses: + description: Status of resource claims. + items: + description: |- + PodResourceClaimStatus is stored in the PodStatus for each PodResourceClaim + which references a ResourceClaimTemplate. It stores the generated name for + the corresponding ResourceClaim. + properties: + name: + description: |- + Name uniquely identifies this resource claim inside the pod. + This must match the name of an entry in pod.spec.resourceClaims, + which implies that the string must be a DNS_LABEL. + type: string + resourceClaimName: + description: |- + ResourceClaimName is the name of the ResourceClaim that was + generated for the Pod in the namespace of the Pod. It this is + unset, then generating a ResourceClaim was not necessary. The + pod.spec.resourceClaims entry can be ignored in this case. + type: string + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + startTime: + description: |- + RFC 3339 date and time at which the object was acknowledged by the Kubelet. + This is before the Kubelet pulled the container image(s) for the pod. + format: date-time + type: string + type: object + serviceQualitiesConditions: + items: + properties: + lastActionTransitionTime: + format: date-time + type: string + lastProbeTime: + format: date-time + type: string + lastTransitionTime: + format: date-time + type: string + name: + type: string + result: + description: Result indicate the probe message returned by the + script + type: string + status: + type: string + required: + - name + type: object + type: array + updatePriority: + anyOf: + - type: integer + - type: string + description: Lifecycle defines the lifecycle hooks for Pods pre-delete, + in-place update. + x-kubernetes-int-or-string: true + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/versions/kruise-game/1.1.0/crds/game.kruise.io_gameserversets.yaml b/versions/kruise-game/1.1.0/crds/game.kruise.io_gameserversets.yaml new file mode 100644 index 0000000..1ede6f8 --- /dev/null +++ b/versions/kruise-game/1.1.0/crds/game.kruise.io_gameserversets.yaml @@ -0,0 +1,1060 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.16.5 + name: gameserversets.game.kruise.io +spec: + group: game.kruise.io + names: + kind: GameServerSet + listKind: GameServerSetList + plural: gameserversets + shortNames: + - gss + singular: gameserverset + scope: Namespaced + versions: + - additionalPrinterColumns: + - description: The desired number of GameServers. + jsonPath: .spec.replicas + name: DESIRED + type: integer + - description: The number of currently all GameServers. + jsonPath: .status.currentReplicas + name: CURRENT + type: integer + - description: The number of GameServers updated. + jsonPath: .status.updatedReplicas + name: UPDATED + type: integer + - description: The number of GameServers ready. + jsonPath: .status.readyReplicas + name: READY + type: integer + - description: The number of GameServers Maintaining. + jsonPath: .status.maintainingReplicas + name: Maintaining + type: integer + - description: The number of GameServers WaitToBeDeleted. + jsonPath: .status.waitToBeDeletedReplicas + name: WaitToBeDeleted + type: integer + - description: The number of GameServers PreDelete. + jsonPath: .status.preDeleteReplicas + name: PreDelete + type: integer + - description: The age of GameServerSet. + jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: GameServerSet is the Schema for the gameserversets API + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: GameServerSetSpec defines the desired state of GameServerSet + properties: + gameServerTemplate: + description: |- + INSERT ADDITIONAL SPEC FIELDS - desired state of cluster + Important: Run "make" to regenerate code after modifying this file + properties: + reclaimPolicy: + description: |- + ReclaimPolicy indicates the reclaim policy for GameServer. + Default is Cascade. + type: string + volumeClaimTemplates: + items: + description: PersistentVolumeClaim is a user's request for and + claim to a persistent volume + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + description: |- + Standard object's metadata. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + properties: + annotations: + additionalProperties: + type: string + type: object + finalizers: + items: + type: string + type: array + labels: + additionalProperties: + type: string + type: object + name: + type: string + namespace: + type: string + type: object + spec: + description: |- + spec defines the desired characteristics of a volume requested by a pod author. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims + properties: + accessModes: + description: |- + accessModes contains the desired access modes the volume should have. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1 + items: + type: string + type: array + x-kubernetes-list-type: atomic + dataSource: + description: |- + dataSource field can be used to specify either: + * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) + * An existing PVC (PersistentVolumeClaim) + If the provisioner or an external controller can support the specified data source, + it will create a new volume based on the contents of the specified data source. + When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, + and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. + If the namespace is specified, then dataSourceRef will not be copied to dataSource. + properties: + apiGroup: + description: |- + APIGroup is the group for the resource being referenced. + If APIGroup is not specified, the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. + type: string + kind: + description: Kind is the type of resource being + referenced + type: string + name: + description: Name is the name of resource being + referenced + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + dataSourceRef: + description: |- + dataSourceRef specifies the object from which to populate the volume with data, if a non-empty + volume is desired. This may be any object from a non-empty API group (non + core object) or a PersistentVolumeClaim object. + When this field is specified, volume binding will only succeed if the type of + the specified object matches some installed volume populator or dynamic + provisioner. + This field will replace the functionality of the dataSource field and as such + if both fields are non-empty, they must have the same value. For backwards + compatibility, when namespace isn't specified in dataSourceRef, + both fields (dataSource and dataSourceRef) will be set to the same + value automatically if one of them is empty and the other is non-empty. + When namespace is specified in dataSourceRef, + dataSource isn't set to the same value and must be empty. + There are three important differences between dataSource and dataSourceRef: + * While dataSource only allows two specific types of objects, dataSourceRef + allows any non-core object, as well as PersistentVolumeClaim objects. + * While dataSource ignores disallowed values (dropping them), dataSourceRef + preserves all values, and generates an error if a disallowed value is + specified. + * While dataSource only allows local objects, dataSourceRef allows objects + in any namespaces. + (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. + (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled. + properties: + apiGroup: + description: |- + APIGroup is the group for the resource being referenced. + If APIGroup is not specified, the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. + type: string + kind: + description: Kind is the type of resource being + referenced + type: string + name: + description: Name is the name of resource being + referenced + type: string + namespace: + description: |- + Namespace is the namespace of resource being referenced + Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. + (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled. + type: string + required: + - kind + - name + type: object + resources: + description: |- + resources represents the minimum resources the volume should have. + If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements + that are lower than previous value but must still be higher than capacity recorded in the + status field of the claim. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: |- + Limits describes the maximum amount of compute resources allowed. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: |- + Requests describes the minimum amount of compute resources required. + If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, + otherwise to an implementation-defined value. Requests cannot exceed Limits. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + type: object + type: object + selector: + description: selector is a label query over volumes + to consider for binding. + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are ANDed. + items: + description: |- + A label selector requirement is a selector that contains values, a key, and an operator that + relates the key and values. + properties: + key: + description: key is the label key that the + selector applies to. + type: string + operator: + description: |- + operator represents a key's relationship to a set of values. + Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: |- + values is an array of string values. If the operator is In or NotIn, + the values array must be non-empty. If the operator is Exists or DoesNotExist, + the values array must be empty. This array is replaced during a strategic + merge patch. + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + description: |- + matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, whose key field is "key", the + operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + storageClassName: + description: |- + storageClassName is the name of the StorageClass required by the claim. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1 + type: string + volumeAttributesClassName: + description: |- + volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim. + If specified, the CSI driver will create or update the volume with the attributes defined + in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName, + it can be changed after the claim is created. An empty string value means that no VolumeAttributesClass + will be applied to the claim but it's not allowed to reset this field to empty string once it is set. + If unspecified and the PersistentVolumeClaim is unbound, the default VolumeAttributesClass + will be set by the persistentvolume controller if it exists. + If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be + set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource + exists. + More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/ + (Alpha) Using this field requires the VolumeAttributesClass feature gate to be enabled. + type: string + volumeMode: + description: |- + volumeMode defines what type of volume is required by the claim. + Value of Filesystem is implied when not included in claim spec. + type: string + volumeName: + description: volumeName is the binding reference to + the PersistentVolume backing this claim. + type: string + type: object + status: + description: |- + status represents the current information/status of a persistent volume claim. + Read-only. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims + properties: + accessModes: + description: |- + accessModes contains the actual access modes the volume backing the PVC has. + More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1 + items: + type: string + type: array + x-kubernetes-list-type: atomic + allocatedResourceStatuses: + additionalProperties: + description: |- + When a controller receives persistentvolume claim update with ClaimResourceStatus for a resource + that it does not recognizes, then it should ignore that update and let other controllers + handle it. + type: string + description: "allocatedResourceStatuses stores status + of resource being resized for the given PVC.\nKey + names follow standard Kubernetes label syntax. Valid + values are either:\n\t* Un-prefixed keys:\n\t\t- storage + - the capacity of the volume.\n\t* Custom resources + must use implementation-defined prefixed names such + as \"example.com/my-custom-resource\"\nApart from + above values - keys that are unprefixed or have kubernetes.io + prefix are considered\nreserved and hence may not + be used.\n\nClaimResourceStatus can be in any of following + states:\n\t- ControllerResizeInProgress:\n\t\tState + set when resize controller starts resizing the volume + in control-plane.\n\t- ControllerResizeFailed:\n\t\tState + set when resize has failed in resize controller with + a terminal error.\n\t- NodeResizePending:\n\t\tState + set when resize controller has finished resizing the + volume but further resizing of\n\t\tvolume is needed + on the node.\n\t- NodeResizeInProgress:\n\t\tState + set when kubelet starts resizing the volume.\n\t- + NodeResizeFailed:\n\t\tState set when resizing has + failed in kubelet with a terminal error. Transient + errors don't set\n\t\tNodeResizeFailed.\nFor example: + if expanding a PVC for more capacity - this field + can be one of the following states:\n\t- pvc.status.allocatedResourceStatus['storage'] + = \"ControllerResizeInProgress\"\n - pvc.status.allocatedResourceStatus['storage'] + = \"ControllerResizeFailed\"\n - pvc.status.allocatedResourceStatus['storage'] + = \"NodeResizePending\"\n - pvc.status.allocatedResourceStatus['storage'] + = \"NodeResizeInProgress\"\n - pvc.status.allocatedResourceStatus['storage'] + = \"NodeResizeFailed\"\nWhen this field is not set, + it means that no resize operation is in progress for + the given PVC.\n\nA controller that receives PVC update + with previously unknown resourceName or ClaimResourceStatus\nshould + ignore the update for the purpose it was designed. + For example - a controller that\nonly is responsible + for resizing capacity of the volume, should ignore + PVC updates that change other valid\nresources associated + with PVC.\n\nThis is an alpha field and requires enabling + RecoverVolumeExpansionFailure feature." + type: object + x-kubernetes-map-type: granular + allocatedResources: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: "allocatedResources tracks the resources + allocated to a PVC including its capacity.\nKey names + follow standard Kubernetes label syntax. Valid values + are either:\n\t* Un-prefixed keys:\n\t\t- storage + - the capacity of the volume.\n\t* Custom resources + must use implementation-defined prefixed names such + as \"example.com/my-custom-resource\"\nApart from + above values - keys that are unprefixed or have kubernetes.io + prefix are considered\nreserved and hence may not + be used.\n\nCapacity reported here may be larger than + the actual capacity when a volume expansion operation\nis + requested.\nFor storage quota, the larger value from + allocatedResources and PVC.spec.resources is used.\nIf + allocatedResources is not set, PVC.spec.resources + alone is used for quota calculation.\nIf a volume + expansion capacity request is lowered, allocatedResources + is only\nlowered if there are no expansion operations + in progress and if the actual volume capacity\nis + equal or lower than the requested capacity.\n\nA controller + that receives PVC update with previously unknown resourceName\nshould + ignore the update for the purpose it was designed. + For example - a controller that\nonly is responsible + for resizing capacity of the volume, should ignore + PVC updates that change other valid\nresources associated + with PVC.\n\nThis is an alpha field and requires enabling + RecoverVolumeExpansionFailure feature." + type: object + capacity: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: capacity represents the actual resources + of the underlying volume. + type: object + conditions: + description: |- + conditions is the current Condition of persistent volume claim. If underlying persistent volume is being + resized then the Condition will be set to 'Resizing'. + items: + description: PersistentVolumeClaimCondition contains + details about state of pvc + properties: + lastProbeTime: + description: lastProbeTime is the time we probed + the condition. + format: date-time + type: string + lastTransitionTime: + description: lastTransitionTime is the time the + condition transitioned from one status to another. + format: date-time + type: string + message: + description: message is the human-readable message + indicating details about last transition. + type: string + reason: + description: |- + reason is a unique, this should be a short, machine understandable string that gives the reason + for condition's last transition. If it reports "Resizing" that means the underlying + persistent volume is being resized. + type: string + status: + type: string + type: + description: PersistentVolumeClaimConditionType + is a valid value of PersistentVolumeClaimCondition.Type + type: string + required: + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + currentVolumeAttributesClassName: + description: |- + currentVolumeAttributesClassName is the current name of the VolumeAttributesClass the PVC is using. + When unset, there is no VolumeAttributeClass applied to this PersistentVolumeClaim + This is an alpha field and requires enabling VolumeAttributesClass feature. + type: string + modifyVolumeStatus: + description: |- + ModifyVolumeStatus represents the status object of ControllerModifyVolume operation. + When this is unset, there is no ModifyVolume operation being attempted. + This is an alpha field and requires enabling VolumeAttributesClass feature. + properties: + status: + description: "status is the status of the ControllerModifyVolume + operation. It can be in any of following states:\n + - Pending\n Pending indicates that the PersistentVolumeClaim + cannot be modified due to unmet requirements, + such as\n the specified VolumeAttributesClass + not existing.\n - InProgress\n InProgress indicates + that the volume is being modified.\n - Infeasible\n + \ Infeasible indicates that the request has been + rejected as invalid by the CSI driver. To\n\t + \ resolve the error, a valid VolumeAttributesClass + needs to be specified.\nNote: New statuses can + be added in the future. Consumers should check + for unknown statuses and fail appropriately." + type: string + targetVolumeAttributesClassName: + description: targetVolumeAttributesClassName is + the name of the VolumeAttributesClass the PVC + currently being reconciled + type: string + required: + - status + type: object + phase: + description: phase represents the current phase of PersistentVolumeClaim. + type: string + type: object + type: object + type: array + type: object + x-kubernetes-preserve-unknown-fields: true + lifecycle: + description: Lifecycle contains the hooks for Pod lifecycle. + properties: + inPlaceUpdate: + description: InPlaceUpdate is the hook before Pod to update and + after Pod has been updated. + properties: + finalizersHandler: + items: + type: string + type: array + labelsHandler: + additionalProperties: + type: string + type: object + markPodNotReady: + description: |- + MarkPodNotReady = true means: + - Pod will be set to 'NotReady' at preparingDelete/preparingUpdate state. + - Pod will be restored to 'Ready' at Updated state if it was set to 'NotReady' at preparingUpdate state. + Currently, MarkPodNotReady only takes effect on InPlaceUpdate & PreDelete hook. + Default to false. + type: boolean + type: object + preDelete: + description: PreDelete is the hook before Pod to be deleted. + properties: + finalizersHandler: + items: + type: string + type: array + labelsHandler: + additionalProperties: + type: string + type: object + markPodNotReady: + description: |- + MarkPodNotReady = true means: + - Pod will be set to 'NotReady' at preparingDelete/preparingUpdate state. + - Pod will be restored to 'Ready' at Updated state if it was set to 'NotReady' at preparingUpdate state. + Currently, MarkPodNotReady only takes effect on InPlaceUpdate & PreDelete hook. + Default to false. + type: boolean + type: object + preNormal: + description: PreNormal is the hook after Pod to be created and + ready to be Normal. + properties: + finalizersHandler: + items: + type: string + type: array + labelsHandler: + additionalProperties: + type: string + type: object + markPodNotReady: + description: |- + MarkPodNotReady = true means: + - Pod will be set to 'NotReady' at preparingDelete/preparingUpdate state. + - Pod will be restored to 'Ready' at Updated state if it was set to 'NotReady' at preparingUpdate state. + Currently, MarkPodNotReady only takes effect on InPlaceUpdate & PreDelete hook. + Default to false. + type: boolean + type: object + type: object + network: + properties: + networkConf: + items: + properties: + name: + type: string + value: + type: string + type: object + type: array + networkType: + type: string + type: object + persistentVolumeClaimRetentionPolicy: + description: |- + PersistentVolumeClaimRetentionPolicy describes the policy used for PVCs created from + the StatefulSet VolumeClaimTemplates. This requires the + StatefulSetAutoDeletePVC feature gate to be enabled, which is alpha. + properties: + whenDeleted: + description: |- + WhenDeleted specifies what happens to PVCs created from StatefulSet + VolumeClaimTemplates when the StatefulSet is deleted. The default policy + of `Retain` causes PVCs to not be affected by StatefulSet deletion. The + `Delete` policy causes those PVCs to be deleted. + type: string + whenScaled: + description: |- + WhenScaled specifies what happens to PVCs created from StatefulSet + VolumeClaimTemplates when the StatefulSet is scaled down. The default + policy of `Retain` causes PVCs to not be affected by a scaledown. The + `Delete` policy causes the associated PVCs for any excess pods above + the replica count to be deleted. + type: string + type: object + replicas: + description: |- + replicas is the desired number of replicas of the given Template. + These are replicas in the sense that they are instantiations of the + same Template, but individual replicas also have a consistent identity. + format: int32 + minimum: 0 + type: integer + reserveGameServerIds: + items: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + type: array + scaleStrategy: + properties: + maxUnavailable: + anyOf: + - type: integer + - type: string + description: |- + The maximum number of pods that can be unavailable during scaling. + Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). + Absolute number is calculated from percentage by rounding down. + It can just be allowed to work with Parallel podManagementPolicy. + x-kubernetes-int-or-string: true + scaleDownStrategyType: + description: |- + ScaleDownStrategyType indicates the scaling down strategy. + Default is GeneralScaleDownStrategyType + type: string + type: object + serviceName: + type: string + serviceQualities: + items: + properties: + containerName: + type: string + exec: + description: Exec specifies the action to take. + properties: + command: + description: |- + Command is the command line to execute inside the container, the working directory for the + command is root ('/') in the container's filesystem. The command is simply exec'd, it is + not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use + a shell, you need to explicitly call out to that shell. + Exit status of 0 is treated as live/healthy and non-zero is unhealthy. + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + failureThreshold: + description: |- + Minimum consecutive failures for the probe to be considered failed after having succeeded. + Defaults to 3. Minimum value is 1. + format: int32 + type: integer + grpc: + description: GRPC specifies an action involving a GRPC port. + properties: + port: + description: Port number of the gRPC service. Number must + be in the range 1 to 65535. + format: int32 + type: integer + service: + default: "" + description: |- + Service is the name of the service to place in the gRPC HealthCheckRequest + (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). + + If this is not specified, the default behavior is defined by gRPC. + type: string + required: + - port + type: object + httpGet: + description: HTTPGet specifies the http request to perform. + properties: + host: + description: |- + Host name to connect to, defaults to the pod IP. You probably want to set + "Host" in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the request. HTTP + allows repeated headers. + items: + description: HTTPHeader describes a custom header to be + used in HTTP probes + properties: + name: + description: |- + The header field name. + This will be canonicalized upon output, so case-variant names will be understood as the same header. + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + path: + description: Path to access on the HTTP server. + type: string + port: + anyOf: + - type: integer + - type: string + description: |- + Name or number of the port to access on the container. + Number must be in the range 1 to 65535. + Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: |- + Scheme to use for connecting to the host. + Defaults to HTTP. + type: string + required: + - port + type: object + initialDelaySeconds: + description: |- + Number of seconds after the container has started before liveness probes are initiated. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + format: int32 + type: integer + name: + type: string + periodSeconds: + description: |- + How often (in seconds) to perform the probe. + Default to 10 seconds. Minimum value is 1. + format: int32 + type: integer + permanent: + description: |- + Whether to make GameServerSpec not change after the ServiceQualityAction is executed. + When Permanent is true, regardless of the detection results, ServiceQualityAction will only be executed once. + When Permanent is false, ServiceQualityAction can be executed again even though ServiceQualityAction has been executed. + type: boolean + serviceQualityAction: + items: + properties: + annotations: + additionalProperties: + type: string + type: object + containers: + description: |- + Containers can be used to make the corresponding GameServer container fields + different from the fields defined by GameServerTemplate in GameServerSetSpec. + items: + properties: + image: + description: |- + Image indicates the image of the container to update. + When Image updated, pod.spec.containers[*].image will be updated immediately. + type: string + name: + description: Name indicates the name of the container + to update. + type: string + resources: + description: |- + Resources indicates the resources of the container to update. + When Resources updated, pod.spec.containers[*].Resources will be not updated immediately, + which will be updated when pod recreate. + properties: + claims: + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + This field is immutable. It can only be set for containers. + items: + description: ResourceClaim references one + entry in PodSpec.ResourceClaims. + properties: + name: + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available + inside a container. + type: string + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: |- + Limits describes the maximum amount of compute resources allowed. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: |- + Requests describes the minimum amount of compute resources required. + If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, + otherwise to an implementation-defined value. Requests cannot exceed Limits. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + type: object + type: object + required: + - name + type: object + type: array + deletionPriority: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + labels: + additionalProperties: + type: string + type: object + networkDisabled: + type: boolean + opsState: + type: string + result: + description: |- + Result indicate the probe message returned by the script. + When Result is defined, it would exec action only when the according Result is actually returns. + type: string + state: + type: boolean + updatePriority: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - state + type: object + type: array + successThreshold: + description: |- + Minimum consecutive successes for the probe to be considered successful after having failed. + Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. + format: int32 + type: integer + tcpSocket: + description: TCPSocket specifies an action involving a TCP port. + properties: + host: + description: 'Optional: Host name to connect to, defaults + to the pod IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: |- + Number or name of the port to access on the container. + Number must be in the range 1 to 65535. + Name must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + description: |- + Optional duration in seconds the pod needs to terminate gracefully upon probe failure. + The grace period is the duration in seconds after the processes running in the pod are sent + a termination signal and the time when the processes are forcibly halted with a kill signal. + Set this value longer than the expected cleanup time for your process. + If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this + value overrides the value provided by the pod spec. + Value must be non-negative integer. The value zero indicates stop immediately via + the kill signal (no opportunity to shut down). + This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. + Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. + format: int64 + type: integer + timeoutSeconds: + description: |- + Number of seconds after which the probe times out. + Defaults to 1 second. Minimum value is 1. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + format: int32 + type: integer + required: + - name + - permanent + type: object + type: array + updateStrategy: + properties: + rollingUpdate: + description: RollingUpdate is used to communicate parameters when + Type is RollingUpdateStatefulSetStrategyType. + properties: + inPlaceUpdateStrategy: + description: |- + UnorderedUpdate contains strategies for non-ordered update. + If it is not nil, pods will be updated with non-ordered sequence. + Noted that UnorderedUpdate can only be allowed to work with Parallel podManagementPolicy + UnorderedUpdate *kruiseV1beta1.UnorderedUpdateStrategy `json:"unorderedUpdate,omitempty"` + InPlaceUpdateStrategy contains strategies for in-place update. + properties: + gracePeriodSeconds: + description: |- + GracePeriodSeconds is the timespan between set Pod status to not-ready and update images in Pod spec + when in-place update a Pod. + format: int32 + type: integer + type: object + maxUnavailable: + anyOf: + - type: integer + - type: string + description: |- + The maximum number of pods that can be unavailable during the update. + Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). + Absolute number is calculated from percentage by rounding down. + Also, maxUnavailable can just be allowed to work with Parallel podManagementPolicy. + Defaults to 1. + x-kubernetes-int-or-string: true + minReadySeconds: + description: |- + MinReadySeconds indicates how long will the pod be considered ready after it's updated. + MinReadySeconds works with both OrderedReady and Parallel podManagementPolicy. + It affects the pod scale up speed when the podManagementPolicy is set to be OrderedReady. + Combined with MaxUnavailable, it affects the pod update speed regardless of podManagementPolicy. + Default value is 0, max is 300. + format: int32 + type: integer + partition: + description: |- + Partition indicates the ordinal at which the StatefulSet should be partitioned by default. + But if unorderedUpdate has been set: + - Partition indicates the number of pods with non-updated revisions when rolling update. + - It means controller will update $(replicas - partition) number of pod. + Default value is 0. + format: int32 + type: integer + paused: + description: |- + Paused indicates that the StatefulSet is paused. + Default value is false + type: boolean + podUpdatePolicy: + description: |- + PodUpdatePolicy indicates how pods should be updated + Default value is "ReCreate" + type: string + type: object + type: + description: |- + Type indicates the type of the StatefulSetUpdateStrategy. + Default is RollingUpdate. + type: string + type: object + required: + - replicas + type: object + status: + description: GameServerSetStatus defines the observed state of GameServerSet + properties: + availableReplicas: + format: int32 + type: integer + currentReplicas: + format: int32 + type: integer + labelSelector: + description: LabelSelector is label selectors for query over pods + that should match the replica count used by HPA. + type: string + maintainingReplicas: + format: int32 + type: integer + observedGeneration: + description: The generation observed by the controller. + format: int64 + type: integer + preDeleteReplicas: + format: int32 + type: integer + readyReplicas: + format: int32 + type: integer + replicas: + description: replicas from advancedStatefulSet + format: int32 + type: integer + updatedReadyReplicas: + format: int32 + type: integer + updatedReplicas: + format: int32 + type: integer + waitToBeDeletedReplicas: + format: int32 + type: integer + required: + - availableReplicas + - currentReplicas + - readyReplicas + - replicas + - updatedReplicas + type: object + type: object + served: true + storage: true + subresources: + scale: + labelSelectorPath: .status.labelSelector + specReplicasPath: .spec.replicas + statusReplicasPath: .status.replicas + status: {} diff --git a/versions/kruise-game/1.1.0/crds/networking.cloud.tencent.com_dedicatedclblisteners.yaml b/versions/kruise-game/1.1.0/crds/networking.cloud.tencent.com_dedicatedclblisteners.yaml new file mode 100644 index 0000000..f4d6267 --- /dev/null +++ b/versions/kruise-game/1.1.0/crds/networking.cloud.tencent.com_dedicatedclblisteners.yaml @@ -0,0 +1,125 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.16.5 + name: dedicatedclblisteners.networking.cloud.tencent.com +spec: + group: networking.cloud.tencent.com + names: + kind: DedicatedCLBListener + listKind: DedicatedCLBListenerList + plural: dedicatedclblisteners + singular: dedicatedclblistener + scope: Namespaced + versions: + - additionalPrinterColumns: + - description: CLB ID + jsonPath: .spec.lbId + name: LbId + type: string + - description: Port of CLB Listener + jsonPath: .spec.lbPort + name: LbPort + type: integer + - description: Pod name of target pod + jsonPath: .spec.targetPod.podName + name: Pod + type: string + - description: State of the dedicated clb listener + jsonPath: .status.state + name: State + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + description: DedicatedCLBListener is the Schema for the dedicatedclblisteners + API + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: DedicatedCLBListenerSpec defines the desired state of DedicatedCLBListener + properties: + extensiveParameters: + type: string + lbId: + type: string + x-kubernetes-validations: + - message: Value is immutable + rule: self == oldSelf + lbPort: + format: int64 + type: integer + x-kubernetes-validations: + - message: Value is immutable + rule: self == oldSelf + lbRegion: + type: string + x-kubernetes-validations: + - message: Value is immutable + rule: self == oldSelf + protocol: + enum: + - TCP + - UDP + type: string + x-kubernetes-validations: + - message: Value is immutable + rule: self == oldSelf + targetPod: + properties: + podName: + type: string + targetPort: + format: int64 + type: integer + required: + - podName + - targetPort + type: object + required: + - lbId + - lbPort + - protocol + type: object + status: + description: DedicatedCLBListenerStatus defines the observed state of + DedicatedCLBListener + properties: + address: + type: string + listenerId: + type: string + message: + type: string + state: + enum: + - Bound + - Available + - Pending + - Failed + - Deleting + type: string + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/versions/kruise-game/1.1.0/templates/_helpers.tpl b/versions/kruise-game/1.1.0/templates/_helpers.tpl new file mode 100644 index 0000000..f41cfbb --- /dev/null +++ b/versions/kruise-game/1.1.0/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "kruise-game.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "kruise-game.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "kruise-game.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "kruise-game.labels" -}} +helm.sh/chart: {{ include "kruise-game.chart" . }} +{{ include "kruise-game.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "kruise-game.selectorLabels" -}} +app.kubernetes.io/name: {{ include "kruise-game.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "kruise-game.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "kruise-game.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/versions/kruise-game/1.1.0/templates/cert-manager/okg-issuer.yaml b/versions/kruise-game/1.1.0/templates/cert-manager/okg-issuer.yaml new file mode 100644 index 0000000..efeb542 --- /dev/null +++ b/versions/kruise-game/1.1.0/templates/cert-manager/okg-issuer.yaml @@ -0,0 +1,10 @@ +{{- if and .Values.certificates.certManager.enabled .Values.certificates.certManager.issuer.generate }} +apiVersion: cert-manager.io/v1 +kind: Issuer +metadata: + name: {{ .Values.kruiseGame.fullname }}-issuer + namespace: {{ .Values.installation.namespace }} +spec: + ca: + secretName: {{ .Values.certificates.certManager.caSecretName }} +{{- end }} diff --git a/versions/kruise-game/1.1.0/templates/cert-manager/okg-tls-certificate.yaml b/versions/kruise-game/1.1.0/templates/cert-manager/okg-tls-certificate.yaml new file mode 100644 index 0000000..cb441ff --- /dev/null +++ b/versions/kruise-game/1.1.0/templates/cert-manager/okg-tls-certificate.yaml @@ -0,0 +1,39 @@ +{{- if .Values.certificates.certManager.enabled }} +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: {{ .Values.kruiseGame.fullname }}-cert + namespace: {{ .Values.installation.namespace }} +spec: + commonName: {{ .Values.kruiseGame.fullname }} + dnsNames: + - {{ .Values.kruiseGame.webhook.serviceName }}.{{ .Values.installation.namespace }} + - {{ .Values.kruiseGame.webhook.serviceName }}.{{ .Values.installation.namespace }}.svc + - {{ .Values.kruiseGame.webhook.serviceName }}.{{ .Values.installation.namespace }}.svc.{{ .Values.clusterDomain }} + secretName: {{ .Values.certificates.secretName }} + usages: + - server auth + - client auth + privateKey: + rotationPolicy: Always + algorithm: RSA + size: 2048 + duration: {{ .Values.certificates.certManager.duration }} + renewBefore: {{ .Values.certificates.certManager.renewBefore }} + issuerRef: + {{- if .Values.certificates.certManager.issuer.generate }} + name: {{ .Values.kruiseGame.fullname }}-issuer + kind: Issuer + group: cert-manager.io + {{- else }} + {{- if .Values.certificates.certManager.issuer.name }} + name: {{ .Values.certificates.certManager.issuer.name }} + {{- end }} + {{- if .Values.certificates.certManager.issuer.kind }} + kind: {{ .Values.certificates.certManager.issuer.kind }} + {{- end }} + {{- if .Values.certificates.certManager.issuer.group }} + group: {{ .Values.certificates.certManager.issuer.group }} + {{- end }} + {{- end }} +{{- end }} diff --git a/versions/kruise-game/1.1.0/templates/cert-manager/self-ca.yaml b/versions/kruise-game/1.1.0/templates/cert-manager/self-ca.yaml new file mode 100644 index 0000000..82fc605 --- /dev/null +++ b/versions/kruise-game/1.1.0/templates/cert-manager/self-ca.yaml @@ -0,0 +1,21 @@ +{{- if and .Values.certificates.certManager.enabled .Values.certificates.certManager.generateCA .Values.certificates.certManager.issuer.generate }} +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: {{ .Values.kruiseGame.fullname }}-ca + namespace: {{ .Values.installation.namespace }} +spec: + isCA: true + commonName: {{ .Values.kruiseGame.fullname }} + secretName: {{ .Values.certificates.certManager.caSecretName }} + privateKey: + rotationPolicy: Always + algorithm: RSA + size: 2048 + duration: 8760h0m0s # 1 year + renewBefore: 720h0m0s # 1 month + issuerRef: + name: {{ .Values.kruiseGame.fullname }}-selfsigned-issuer + kind: Issuer + group: cert-manager.io +{{- end }} diff --git a/versions/kruise-game/1.1.0/templates/cert-manager/self-issuer.yaml b/versions/kruise-game/1.1.0/templates/cert-manager/self-issuer.yaml new file mode 100644 index 0000000..d6e1904 --- /dev/null +++ b/versions/kruise-game/1.1.0/templates/cert-manager/self-issuer.yaml @@ -0,0 +1,13 @@ +{{- if and .Values.certificates.certManager.enabled .Values.certificates.certManager.generateCA .Values.certificates.certManager.issuer.generate }} +apiVersion: cert-manager.io/v1 +kind: Issuer +metadata: + {{- with .Values.additionalAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} + name: {{ .Values.kruiseGame.fullname }}-selfsigned-issuer + namespace: {{ .Values.installation.namespace }} +spec: + selfSigned: {} +{{- end }} diff --git a/versions/kruise-game/1.1.0/templates/controller_manager_config.yaml b/versions/kruise-game/1.1.0/templates/controller_manager_config.yaml new file mode 100644 index 0000000..cd4d5dd --- /dev/null +++ b/versions/kruise-game/1.1.0/templates/controller_manager_config.yaml @@ -0,0 +1,77 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: kruise-game-manager-config + namespace: {{ .Values.installation.namespace }} +data: + config.toml: | + [kubernetes] + enable = true + [kubernetes.hostPort] + max_port = 9000 + min_port = 8000 + + [alibabacloud] + enable = true + [alibabacloud.slb] + max_port = 700 + min_port = 500 + block_ports = [593] + [alibabacloud.nlb] + max_port = 1502 + min_port = 1000 + block_ports = [1025, 1434, 1068] + + [volcengine] + enable = true + [volcengine.clb] + max_port = 600 + min_port = 550 + block_ports = [593] + + [aws] + enable = false + [aws.nlb] + max_port = 30050 + min_port = 30001 + + [jdcloud] + enable = false + [jdcloud.nlb] + max_port = 700 + min_port = 500 + + [tencentcloud] + enable = true + + [hwcloud] + enable = false + [hwcloud.elb] + max_port = 700 + min_port = 500 + block_ports = [] + + controller_manager_config.yaml: | + apiVersion: controller-runtime.sigs.k8s.io/v1alpha1 + kind: ControllerManagerConfig + health: + healthProbeBindAddress: :8081 + metrics: + bindAddress: 127.0.0.1:8080 + webhook: + port: 9443 + leaderElection: + leaderElect: true + resourceName: c637bb1e.my.domain +# leaderElectionReleaseOnCancel defines if the leader should step down volume +# when the Manager ends. This requires the binary to immediately end when the +# Manager is stopped, otherwise, this setting is unsafe. Setting this significantly +# speeds up voluntary leader transitions as the new leader don't have to wait +# LeaseDuration time first. +# In the default scaffold provided, the program ends immediately after +# the manager stops, so would be fine to enable this option. However, +# if you are doing or is intended to do any operation such as perform cleanups +# after the manager stops then its usage might be unsafe. +# leaderElectionReleaseOnCancel: true + + diff --git a/versions/kruise-game/1.1.0/templates/index-offset-scheduler.yaml b/versions/kruise-game/1.1.0/templates/index-offset-scheduler.yaml new file mode 100644 index 0000000..cfd4060 --- /dev/null +++ b/versions/kruise-game/1.1.0/templates/index-offset-scheduler.yaml @@ -0,0 +1,299 @@ +{{- if .Values.indexOffsetScheduler.enabled }} +# service account +apiVersion: v1 +kind: ServiceAccount +metadata: + name: index-offset-scheduler + namespace: kruise-game-system +--- +# clusterRole +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + annotations: + rbac.authorization.kubernetes.io/autoupdate: 'true' + name: index-offset-scheduler +rules: + - apiGroups: + - '' + - events.k8s.io + resources: + - events + verbs: + - create + - patch + - update + - apiGroups: + - coordination.k8s.io + resources: + - leases + verbs: + - create + - apiGroups: + - coordination.k8s.io + resourceNames: + - kube-scheduler + - index-offset-scheduler + resources: + - leases + verbs: + - get + - list + - update + - watch + - apiGroups: + - coordination.k8s.io + resources: + - leasecandidates + verbs: + - create + - delete + - deletecollection + - get + - list + - patch + - update + - watch + - apiGroups: + - '' + resources: + - nodes + verbs: + - get + - list + - watch + - apiGroups: + - '' + resources: + - pods + verbs: + - delete + - get + - list + - watch + - apiGroups: + - '' + resources: + - bindings + - pods/binding + verbs: + - create + - apiGroups: + - '' + resources: + - pods/status + verbs: + - patch + - update + - apiGroups: + - '' + resources: + - replicationcontrollers + - services + verbs: + - get + - list + - watch + - apiGroups: + - apps + - extensions + resources: + - replicasets + verbs: + - get + - list + - watch + - apiGroups: + - apps + resources: + - statefulsets + verbs: + - get + - list + - watch + - apiGroups: + - policy + resources: + - poddisruptionbudgets + verbs: + - get + - list + - watch + - apiGroups: + - '' + resources: + - persistentvolumeclaims + - persistentvolumes + verbs: + - get + - list + - watch + - apiGroups: + - authentication.k8s.io + resources: + - tokenreviews + verbs: + - create + - apiGroups: + - authorization.k8s.io + resources: + - subjectaccessreviews + verbs: + - create + - apiGroups: + - storage.k8s.io + resources: + - csinodes + verbs: + - get + - list + - watch + - apiGroups: + - '' + resources: + - namespaces + verbs: + - get + - list + - watch + - apiGroups: + - storage.k8s.io + resources: + - csidrivers + verbs: + - get + - list + - watch + - apiGroups: + - storage.k8s.io + resources: + - csistoragecapacities + verbs: + - get + - list + - watch + - apiGroups: + - "" + resourceNames: + - kube-scheduler + - index-offset-scheduler + resources: + - endpoints + verbs: + - delete + - get + - patch + - update + +--- +# ClusterRoleBinding: index-offset-scheduler +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: index-offset-scheduler-as-kube-scheduler +subjects: + - kind: ServiceAccount + name: index-offset-scheduler + namespace: kruise-game-system +roleRef: + kind: ClusterRole + name: index-offset-scheduler + apiGroup: rbac.authorization.k8s.io +--- +# ClusterRoleBinding: system:volume-scheduler +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: index-offset-scheduler-as-volume-scheduler +subjects: + - kind: ServiceAccount + name: index-offset-scheduler + namespace: kruise-game-system +roleRef: + kind: ClusterRole + name: system:volume-scheduler + apiGroup: rbac.authorization.k8s.io +--- +# RoleBinding: apiserver +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: index-offset-scheduler-extension-apiserver-authentication-reader + namespace: kube-system +roleRef: + kind: Role + name: extension-apiserver-authentication-reader + apiGroup: rbac.authorization.k8s.io +subjects: + - kind: ServiceAccount + name: index-offset-scheduler + namespace: kruise-game-system +--- +# configmap +apiVersion: v1 +kind: ConfigMap +metadata: + name: index-offset-scheduler-config + namespace: kruise-game-system +data: + scheduler-config.yaml: | + # stable v1 after version 1.25 + apiVersion: kubescheduler.config.k8s.io/v1 + kind: KubeSchedulerConfiguration + leaderElection: + leaderElect: false + resourceNamespace: kruise-game-system + resourceName: index-offset-scheduler + profiles: + - schedulerName: index-offset-scheduler + plugins: + score: + enabled: + - name: index-offset-scheduler + weight: {{ .Values.indexOffsetScheduler.weight }} +--- +# deployment +apiVersion: apps/v1 +kind: Deployment +metadata: + name: index-offset-scheduler + namespace: kruise-game-system + labels: + app: index-offset-scheduler +spec: + replicas: 1 + selector: + matchLabels: + app: index-offset-scheduler + template: + metadata: + labels: + app: index-offset-scheduler + spec: + serviceAccountName: index-offset-scheduler + containers: + - name: scheduler + # change your image + image: openkruise/kruise-game-scheduler-index-offset:v1.0 + imagePullPolicy: Always + command: + - /app/index-offset-scheduler + - --config=/etc/kubernetes/scheduler-config.yaml + - --v=5 + resources: + requests: + cpu: 100m + memory: 50Mi + limits: + cpu: 500m + memory: 512Mi + volumeMounts: + - name: config + mountPath: /etc/kubernetes + # imagePullSecrets: + # - name: + volumes: + - name: config + configMap: + name: index-offset-scheduler-config +{{- end }} \ No newline at end of file diff --git a/versions/kruise-game/1.1.0/templates/manager.yaml b/versions/kruise-game/1.1.0/templates/manager.yaml new file mode 100644 index 0000000..1f5880f --- /dev/null +++ b/versions/kruise-game/1.1.0/templates/manager.yaml @@ -0,0 +1,153 @@ +{{- if .Values.installation.createNamespace }} +apiVersion: v1 +kind: Namespace +metadata: + labels: + control-plane: {{ .Values.kruiseGame.fullname }} + name: {{ .Values.installation.namespace }} + {{- end }} +--- +apiVersion: v1 +kind: Service +metadata: + name: kruise-game-controller-manager-metrics-service + namespace: {{ .Values.installation.namespace }} + labels: + control-plane: {{ .Values.kruiseGame.fullname }} +spec: + ports: + - name: http-metrics + port: {{ .Values.prometheus.monitorService.port }} + protocol: TCP + targetPort: metrics + selector: + control-plane: {{ .Values.kruiseGame.fullname }} +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Values.kruiseGame.fullname }} + namespace: {{ .Values.installation.namespace }} + labels: + control-plane: {{ .Values.kruiseGame.fullname }} +spec: + selector: + matchLabels: + control-plane: {{ .Values.kruiseGame.fullname }} + replicas: {{ .Values.replicaCount }} + template: + metadata: + annotations: + kubectl.kubernetes.io/default-container: manager + labels: + control-plane: {{ .Values.kruiseGame.fullname }} + spec: + # securityContext: + # runAsNonRoot: true + # TODO(user): For common cases that do not require escalating privileges + # it is recommended to ensure that all your Pods/Containers are restrictive. + # More info: https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted + # Please uncomment the following code if your project does NOT have to work on old Kubernetes + # versions < 1.19 or on vendors versions which do NOT support this field by default (i.e. Openshift < 4.11 ). + # seccompProfile: + # type: RuntimeDefault + containers: + - command: + - /manager + args: + - --leader-elect=false + - --provider-config=/etc/kruise-game/config.toml + - --log-format={{ .Values.manager.logFormat }} + - --api-server-qps={{ .Values.kruiseGame.apiServerQps }} + - --api-server-qps-burst={{ .Values.kruiseGame.apiServerQpsBurst }} + - --gameserver-workers={{ .Values.kruiseGame.gameserverWorkers }} + - --gameserverset-workers={{ .Values.kruiseGame.gameserversetWorkers }} + - --scale-server-bind-address=:{{ .Values.scale.service.targetPort }} + {{- if .Values.manager.otel.enabled }} + {{- $otelEndpoint := .Values.manager.otel.endpoint | default (printf "%s-opentelemetry-collector.%s.svc:4317" .Release.Name .Release.Namespace) }} + - --enable-tracing=true + - --otel-collector-endpoint={{ $otelEndpoint }} + - --otel-sampling-rate={{ .Values.manager.otel.sampleRate }} + {{- end }} + {{- if .Values.prometheus.enabled }} + - --metrics-bind-address=:{{ .Values.prometheus.monitorService.port }} + {{- end }} + {{- if not .Values.certificates.autoGenerated }} + - --enable-cert-generation={{ .Values.certificates.autoGenerated }} + {{- end }} + {{- if .Values.image.digest }} + image: "{{ .Values.image.repository }}@{{ .Values.image.digest }}" + {{- else }} + {{- if .Values.image.digest }} + image: "{{ .Values.image.repository }}@{{ .Values.image.digest }}" + {{- else }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + {{- end }} + {{- end }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + name: manager + env: + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: POD_UID + valueFrom: + fieldRef: + fieldPath: metadata.uid + - name: "NETWORK_TOTAL_WAIT_TIME" + value: {{ .Values.network.totalWaitTime | quote }} + - name: "NETWORK_PROBE_INTERVAL_TIME" + value: {{ .Values.network.probeIntervalTime | quote }} + ports: + - name: metrics + containerPort: {{ .Values.prometheus.monitorService.port }} + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - "ALL" + livenessProbe: + httpGet: + path: /healthz + port: {{ .Values.kruiseGame.healthBindPort }} + initialDelaySeconds: 5 + periodSeconds: 5 + readinessProbe: + httpGet: + path: /readyz + port: {{ .Values.kruiseGame.healthBindPort }} + initialDelaySeconds: 5 + periodSeconds: 5 + # TODO(user): Configure the resources accordingly based on the project requirements. + # More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + resources: + {{- toYaml .Values.resources | nindent 12 }} + volumeMounts: + - mountPath: /etc/kruise-game + name: provider-config + {{- if not .Values.certificates.autoGenerated }} + - mountPath: {{ .Values.certificates.mountPath }} + name: certificates + {{- end }} + serviceAccountName: {{ .Values.kruiseGame.fullname }} + terminationGracePeriodSeconds: 10 + volumes: + - configMap: + defaultMode: 420 + items: + - key: config.toml + path: config.toml + name: kruise-game-manager-config + name: provider-config + {{- if not .Values.certificates.autoGenerated }} + - name: certificates + secret: + defaultMode: 420 + secretName: {{ .Values.certificates.secretName}} + optional: {{ and .Values.certificates.autoGenerated ( not .Values.certificates.certManager.enabled ) }} + {{- end }} diff --git a/versions/kruise-game/1.1.0/templates/prometheus-monitor.yaml b/versions/kruise-game/1.1.0/templates/prometheus-monitor.yaml new file mode 100644 index 0000000..fda157f --- /dev/null +++ b/versions/kruise-game/1.1.0/templates/prometheus-monitor.yaml @@ -0,0 +1,17 @@ +{{- if and .Values.prometheus.enabled (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") }} +# Prometheus Monitor Service (Metrics) +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + labels: + control-plane: {{ .Values.kruiseGame.fullname }} + name: kruise-game-controller-manager-metrics-monitor + namespace: {{ .Values.installation.namespace }} +spec: + endpoints: + - path: /metrics + port: http-metrics + selector: + matchLabels: + control-plane: {{ .Values.kruiseGame.fullname }} +{{- end }} diff --git a/versions/kruise-game/1.1.0/templates/rbac_role.yaml b/versions/kruise-game/1.1.0/templates/rbac_role.yaml new file mode 100644 index 0000000..5e30db5 --- /dev/null +++ b/versions/kruise-game/1.1.0/templates/rbac_role.yaml @@ -0,0 +1,404 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ .Values.kruiseGame.fullname }} + namespace: {{ .Values.installation.namespace }} +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: kruise-game-leader-election-role + namespace: {{ .Values.installation.namespace }} +rules: + - apiGroups: + - "" + resources: + - configmaps + verbs: + - get + - list + - watch + - create + - update + - patch + - delete + - apiGroups: + - coordination.k8s.io + resources: + - leases + verbs: + - get + - list + - watch + - create + - update + - patch + - delete + - apiGroups: + - "" + resources: + - events + verbs: + - create + - patch +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + creationTimestamp: null + name: kruise-game-manager-role +rules: + - apiGroups: + - "" + resources: + - events + verbs: + - create + - patch + - apiGroups: + - admissionregistration.k8s.io + resources: + - mutatingwebhookconfigurations + verbs: + - create + - get + - list + - patch + - update + - watch + - apiGroups: + - admissionregistration.k8s.io + resources: + - validatingwebhookconfigurations + verbs: + - create + - get + - list + - patch + - update + - watch + - apiGroups: + - alibabacloud.com + resources: + - poddnats + verbs: + - get + - list + - watch + - apiGroups: + - alibabacloud.com + resources: + - poddnats/status + verbs: + - get + - apiGroups: + - alibabacloud.com + resources: + - podeips + verbs: + - get + - list + - watch + - apiGroups: + - alibabacloud.com + resources: + - podeips/status + verbs: + - get + - apiGroups: + - apiextensions.k8s.io + resources: + - customresourcedefinitions + verbs: + - get + - list + - patch + - update + - watch + - apiGroups: + - apps.kruise.io + resources: + - podprobemarkers + verbs: + - create + - delete + - get + - list + - patch + - update + - watch + - apiGroups: + - apps.kruise.io + resources: + - statefulsets + verbs: + - create + - delete + - get + - list + - patch + - update + - watch + - apiGroups: + - apps.kruise.io + resources: + - statefulsets/status + verbs: + - get + - patch + - update + - apiGroups: + - "" + resources: + - nodes + verbs: + - get + - list + - watch + - apiGroups: + - "" + resources: + - nodes/status + verbs: + - get + - apiGroups: + - "" + resources: + - persistentvolumeclaims + verbs: + - get + - list + - watch + - apiGroups: + - "" + resources: + - persistentvolumeclaims/status + verbs: + - get + - apiGroups: + - "" + resources: + - persistentvolumes + verbs: + - get + - list + - watch + - apiGroups: + - "" + resources: + - persistentvolumes/status + verbs: + - get + - apiGroups: + - "" + resources: + - pods + verbs: + - create + - delete + - get + - list + - patch + - update + - watch + - apiGroups: + - "" + resources: + - pods/status + verbs: + - get + - patch + - update + - apiGroups: + - "" + resources: + - services + verbs: + - create + - delete + - get + - list + - patch + - update + - watch + - apiGroups: + - "" + resources: + - services/status + verbs: + - get + - patch + - update + - apiGroups: + - elbv2.k8s.aws + resources: + - targetgroupbindings + verbs: + - create + - get + - list + - patch + - update + - watch + - apiGroups: + - elbv2.services.k8s.aws + resources: + - listeners + verbs: + - create + - get + - list + - patch + - update + - watch + - apiGroups: + - elbv2.services.k8s.aws + resources: + - targetgroups + verbs: + - create + - get + - list + - patch + - update + - watch + - apiGroups: + - game.kruise.io + resources: + - gameservers + verbs: + - create + - delete + - get + - list + - patch + - update + - watch + - apiGroups: + - game.kruise.io + resources: + - gameservers/finalizers + verbs: + - update + - apiGroups: + - game.kruise.io + resources: + - gameservers/status + verbs: + - get + - patch + - update + - apiGroups: + - game.kruise.io + resources: + - gameserversets + verbs: + - create + - delete + - get + - list + - patch + - update + - watch + - apiGroups: + - game.kruise.io + resources: + - gameserversets/finalizers + verbs: + - update + - apiGroups: + - game.kruise.io + resources: + - gameserversets/status + verbs: + - get + - patch + - update + - apiGroups: + - networking.k8s.io + resources: + - ingresses + verbs: + - create + - delete + - get + - list + - patch + - update + - watch + - apiGroups: + - networking.k8s.io + resources: + - ingresses/status + verbs: + - get + - patch + - update +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: kruise-game-metrics-reader +rules: + - nonResourceURLs: + - "/metrics" + verbs: + - get +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: kruise-game-proxy-role +rules: + - apiGroups: + - authentication.k8s.io + resources: + - tokenreviews + verbs: + - create + - apiGroups: + - authorization.k8s.io + resources: + - subjectaccessreviews + verbs: + - create +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: kruise-game-leader-election-rolebinding + namespace: {{ .Values.installation.namespace }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: kruise-game-leader-election-role +subjects: + - kind: ServiceAccount + name: {{ .Values.kruiseGame.fullname }} + namespace: {{ .Values.installation.namespace }} +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: kruise-game-manager-rolebinding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: kruise-game-manager-role +subjects: + - kind: ServiceAccount + name: {{ .Values.kruiseGame.fullname }} + namespace: {{ .Values.installation.namespace }} +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: kruise-game-proxy-rolebinding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: proxy-role +subjects: + - kind: ServiceAccount + name: {{ .Values.kruiseGame.fullname }} + namespace: {{ .Values.installation.namespace }} \ No newline at end of file diff --git a/versions/kruise-game/1.1.0/templates/scaler-service.yaml b/versions/kruise-game/1.1.0/templates/scaler-service.yaml new file mode 100644 index 0000000..3551606 --- /dev/null +++ b/versions/kruise-game/1.1.0/templates/scaler-service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: kruise-game-external-scaler + namespace: {{ .Values.installation.namespace }} +spec: + ports: + - port: {{ .Values.scale.service.port }} + targetPort: {{ .Values.scale.service.targetPort }} + selector: + control-plane: {{ .Values.kruiseGame.fullname }} \ No newline at end of file diff --git a/versions/kruise-game/1.1.0/templates/webhooks/mutatingconfiguration.yaml b/versions/kruise-game/1.1.0/templates/webhooks/mutatingconfiguration.yaml new file mode 100644 index 0000000..cd5428b --- /dev/null +++ b/versions/kruise-game/1.1.0/templates/webhooks/mutatingconfiguration.yaml @@ -0,0 +1,44 @@ +{{- if not .Values.certificates.autoGenerated }} +apiVersion: admissionregistration.k8s.io/v1 +kind: MutatingWebhookConfiguration +metadata: + annotations: + {{- if .Values.certificates.certManager.enabled }} + {{- if and (not .Values.certificates.certManager.generateCA) .Values.certificates.certManager.issuer.generate }} + cert-manager.io/inject-ca-from-secret: {{ .Values.installation.namespace }}/{{ .Values.certificates.certManager.caSecretName }} + {{- else }} + cert-manager.io/inject-ca-from: {{ .Values.installation.namespace }}/{{ .Values.kruiseGame.fullname }}-cert + {{- end }} + {{- end }} + labels: + app.kubernetes.io/name: {{ .Values.kruiseGame.fullname }} + name: kruise-game-mutating-webhook +webhooks: +- admissionReviewVersions: + - v1 + - v1beta1 + clientConfig: + service: + name: {{ .Values.kruiseGame.webhook.serviceName }} + namespace: {{ .Values.installation.namespace }} + path: /mutate-v1-pod + failurePolicy: {{ .Values.kruiseGame.webhook.failurePolicy }} + matchPolicy: Equivalent + name: mgameserverset.kb.io + rules: + - operations: + - CREATE + - UPDATE + - DELETE + apiGroups: + - "" + apiVersions: + - v1 + resources: + - pods + objectSelector: + matchExpressions: + - key: game.kruise.io/owner-gss + operator: Exists + sideEffects: None +{{- end }} \ No newline at end of file diff --git a/versions/kruise-game/1.1.0/templates/webhooks/service.yaml b/versions/kruise-game/1.1.0/templates/webhooks/service.yaml new file mode 100644 index 0000000..9a334f6 --- /dev/null +++ b/versions/kruise-game/1.1.0/templates/webhooks/service.yaml @@ -0,0 +1,12 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ .Values.kruiseGame.webhook.serviceName }} + namespace: {{ .Values.installation.namespace }} +spec: + ports: + - port: {{ .Values.kruiseGame.webhook.port }} + targetPort: {{ .Values.kruiseGame.webhook.targetPort }} + selector: + control-plane: {{ .Values.kruiseGame.fullname }} \ No newline at end of file diff --git a/versions/kruise-game/1.1.0/templates/webhooks/validatingconfiguration.yaml b/versions/kruise-game/1.1.0/templates/webhooks/validatingconfiguration.yaml new file mode 100644 index 0000000..ec42e37 --- /dev/null +++ b/versions/kruise-game/1.1.0/templates/webhooks/validatingconfiguration.yaml @@ -0,0 +1,42 @@ +{{- if not .Values.certificates.autoGenerated }} +apiVersion: admissionregistration.k8s.io/v1 +kind: ValidatingWebhookConfiguration +metadata: + annotations: + {{- if .Values.certificates.certManager.enabled }} + {{- if and (not .Values.certificates.certManager.generateCA) .Values.certificates.certManager.issuer.generate }} + cert-manager.io/inject-ca-from-secret: {{ .Values.installation.namespace }}/{{ .Values.certificates.certManager.caSecretName }} + {{- else }} + cert-manager.io/inject-ca-from: {{ .Values.installation.namespace }}/{{ .Values.kruiseGame.fullname }}-cert + {{- end }} + {{- end }} + labels: + app.kubernetes.io/name: {{ .Values.kruiseGame.fullname }} + name: kruise-game-validating-webhook +webhooks: +- admissionReviewVersions: + - v1 + - v1beta1 + clientConfig: + service: + name: {{ .Values.kruiseGame.webhook.serviceName }} + namespace: {{ .Values.installation.namespace }} + path: /validate-v1alpha1-gss + failurePolicy: {{ .Values.kruiseGame.webhook.failurePolicy }} + matchPolicy: Equivalent + name: vgameserverset.kb.io + namespaceSelector: {} + objectSelector: {} + rules: + - apiGroups: + - game.kruise.io + apiVersions: + - v1alpha1 + operations: + - CREATE + - UPDATE + resources: + - gameserversets + sideEffects: None + timeoutSeconds: 10 +{{- end }} \ No newline at end of file diff --git a/versions/kruise-game/1.1.0/values.yaml b/versions/kruise-game/1.1.0/values.yaml new file mode 100644 index 0000000..3a8aadc --- /dev/null +++ b/versions/kruise-game/1.1.0/values.yaml @@ -0,0 +1,103 @@ +# Default values for kruise-game. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +# values for kruise-game installation +installation: + namespace: kruise-game-system + createNamespace: true + +kruiseGame: + fullname: kruise-game-controller-manager + healthBindPort: "8082" + webhook: + serviceName: kruise-game-webhook-service + port: 443 + targetPort: 9876 + failurePolicy: Fail + apiServerQps: 5 + apiServerQpsBurst: 10 + gameserverWorkers: 10 + gameserversetWorkers: 10 + +replicaCount: 1 + +image: + repository: ghcr.io/ballista01/kruise-game-manager + tag: dev + digest: "" + pullPolicy: Always + # Overrides the image tag whose default is the chart appVersion. + +serviceAccount: + # Annotations to add to the service account + annotations: {} + +service: + port: 8080 + +resources: + limits: + cpu: 500m + memory: 1024Mi + requests: + cpu: 10m + memory: 64Mi + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +prometheus: + enabled: false + monitorService: + port: 8080 +scale: + service: + port: 6000 + targetPort: 6000 + +network: + totalWaitTime: 60 + probeIntervalTime: 5 + +cloudProvider: + installCRD: true + +indexOffsetScheduler: + enabled: false + weight: 100 + +# Kubernetes cluster domain +clusterDomain: cluster.local + +certificates: + autoGenerated: true + secretName: kruise-game-certs + mountPath: /tmp/webhook-certs/ + certManager: + enabled: false + duration: 8760h0m0s # 1 year + renewBefore: 5840h0m0s # 8 months + generateCA: true + caSecretName: "kruise-game-ca" + # -- Reference to custom Issuer. If issuer.generate is false, then issuer.group, issuer.kind and issuer.name are required + issuer: + generate: true + name: kruise-ca + kind: ClusterIssuer + group: cert-manager.io + +manager: + # -- Log output format for manager. Allowed: console, json + logFormat: console + otel: + enabled: false + endpoint: "otel-collector:4317" + sampleRate: 0.1