From da9cf7c7114706e56de4d4733f606a84b14243c4 Mon Sep 17 00:00:00 2001 From: rick <1450685+LinuxSuRen@users.noreply.github.com> Date: Wed, 31 May 2023 16:27:54 +0800 Subject: [PATCH] docs: improve the k8s manifests about podAntiAffinity --- README.md | 4 +++- sample/manifest.yaml | 15 +++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5b5bf88d..d19ed8b9 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ This is a API testing tool. * Validate the response body with [JSON schema](https://json-schema.org/) * Pre and post handle with the API request * Output reference between TestCase -* Run in server mode, and provide the gRPC endpoint +* Run in server mode, and provide the [gRPC endpoint](pkg/server/server.proto) * [VS Code extension](https://github.com/LinuxSuRen/vscode-api-testing) support ## Get started @@ -25,6 +25,8 @@ Install it via [hd](https://github.com/LinuxSuRen/http-downloader) or download f hd install atest ``` +or, you can install it in Kubernetes. See also the [manifests](sample/manifest.yaml). + see the following usage: ```shell diff --git a/sample/manifest.yaml b/sample/manifest.yaml index 3c4d3c8f..b55ba8c0 100644 --- a/sample/manifest.yaml +++ b/sample/manifest.yaml @@ -8,16 +8,28 @@ metadata: name: api-testing spec: replicas: 1 + strategy: + rollingUpdate: + maxSurge: 1 + maxUnavailable: 1 selector: matchLabels: app: api-testing - strategy: {} template: metadata: creationTimestamp: null labels: app: api-testing spec: + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - podAffinityTerm: + labelSelector: + matchLabels: + app: api-testing + topologyKey: kubernetes.io/hostname + weight: 5 containers: - image: ghcr.io/linuxsuren/api-testing name: server @@ -28,7 +40,6 @@ spec: requests: cpu: "100m" memory: 100m -status: {} --- apiVersion: v1 kind: Service