mirror of
https://github.com/Azure/k8s-deploy.git
synced 2026-04-15 19:15:34 +08:00
updated Readme and action.yml
This commit is contained in:
parent
0e57c19ffe
commit
634370ab70
@ -74,6 +74,9 @@ Following are the key capabilities of this action:
|
|||||||
<td>traffic-split-method </br></br>(Optional)</td>
|
<td>traffic-split-method </br></br>(Optional)</td>
|
||||||
<td>Acceptable values: pod/smi.<br> Default value: pod <br>SMI: Percentage traffic split is done at request level using service mesh. Service mesh has to be setup by cluster admin. Orchestration of <a href="https://github.com/servicemeshinterface/smi-spec/blob/master/apis/traffic-split/v1alpha3/traffic-split.md" data-raw-source="TrafficSplit](https://github.com/deislabs/smi-spec/blob/master/traffic-split.md)">TrafficSplit</a> objects of SMI is handled by this action. <br>Pod: Percentage split not possible at request level in the absence of service mesh. Percentage input is used to calculate the replicas for baseline and canary as a percentage of replicas specified in the input manifests for the stable variant.</td>
|
<td>Acceptable values: pod/smi.<br> Default value: pod <br>SMI: Percentage traffic split is done at request level using service mesh. Service mesh has to be setup by cluster admin. Orchestration of <a href="https://github.com/servicemeshinterface/smi-spec/blob/master/apis/traffic-split/v1alpha3/traffic-split.md" data-raw-source="TrafficSplit](https://github.com/deislabs/smi-spec/blob/master/traffic-split.md)">TrafficSplit</a> objects of SMI is handled by this action. <br>Pod: Percentage split not possible at request level in the absence of service mesh. Percentage input is used to calculate the replicas for baseline and canary as a percentage of replicas specified in the input manifests for the stable variant.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>traffic-split-annotations </br></br>(Optional)</td>
|
||||||
|
<td>Annotations in the form of key/value pair can be added to TrafficSplit.</td>
|
||||||
<tr>
|
<tr>
|
||||||
<td>percentage </br></br>(Optional but required if strategy is canary)</td>
|
<td>percentage </br></br>(Optional but required if strategy is canary)</td>
|
||||||
<td>Used to compute the number of replicas of '-baseline' and '-canary' variants of the workloads found in manifest files. For the specified percentage input, if (percentage * numberOfDesirerdReplicas)/100 is not a round number, the floor of this number is used while creating '-baseline' and '-canary'.<br/><br/>For example, if Deployment hello-world was found in the input manifest file with 'replicas: 4' and if 'strategy: canary' and 'percentage: 25' are given as inputs to the action, then the Deployments hello-world-baseline and hello-world-canary are created with 1 replica each. The '-baseline' variant is created with the same image and tag as the stable version (4 replica variant prior to deployment) while the '-canary' variant is created with the image and tag corresponding to the new changes being deployed</td>
|
<td>Used to compute the number of replicas of '-baseline' and '-canary' variants of the workloads found in manifest files. For the specified percentage input, if (percentage * numberOfDesirerdReplicas)/100 is not a round number, the floor of this number is used while creating '-baseline' and '-canary'.<br/><br/>For example, if Deployment hello-world was found in the input manifest file with 'replicas: 4' and if 'strategy: canary' and 'percentage: 25' are given as inputs to the action, then the Deployments hello-world-baseline and hello-world-canary are created with 1 replica each. The '-baseline' variant is created with the same image and tag as the stable version (4 replica variant prior to deployment) while the '-canary' variant is created with the image and tag corresponding to the new changes being deployed</td>
|
||||||
|
|||||||
@ -35,6 +35,10 @@ inputs:
|
|||||||
description: 'Traffic split method to be used. Allowed values are pod and smi'
|
description: 'Traffic split method to be used. Allowed values are pod and smi'
|
||||||
required: false
|
required: false
|
||||||
default: 'pod'
|
default: 'pod'
|
||||||
|
traffic-split-annotations:
|
||||||
|
description: 'Traffic split annotations in the form of key/value pair can be used'
|
||||||
|
required: false
|
||||||
|
default: 0
|
||||||
baseline-and-canary-replicas:
|
baseline-and-canary-replicas:
|
||||||
description: 'Baseline and canary replicas count. Valid value between 0 to 100 (inclusive)'
|
description: 'Baseline and canary replicas count. Valid value between 0 to 100 (inclusive)'
|
||||||
required: false
|
required: false
|
||||||
|
|||||||
@ -78,7 +78,7 @@ export async function fetchResource(
|
|||||||
kubectl: Kubectl,
|
kubectl: Kubectl,
|
||||||
kind: string,
|
kind: string,
|
||||||
name: string,
|
name: string,
|
||||||
annotations: {[key: string] : string} = {}
|
annotations: {[key: string]: string} = {}
|
||||||
) {
|
) {
|
||||||
const result = await kubectl.getResource(kind, name, annotations)
|
const result = await kubectl.getResource(kind, name, annotations)
|
||||||
|
|
||||||
|
|||||||
@ -290,7 +290,7 @@ async function getTrafficSplitObject(
|
|||||||
name: string,
|
name: string,
|
||||||
stableWeight: number,
|
stableWeight: number,
|
||||||
baselineWeight: number,
|
baselineWeight: number,
|
||||||
canaryWeight: number,
|
canaryWeight: number,
|
||||||
annotations: {[key: string]: string} = {}
|
annotations: {[key: string]: string} = {}
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
// cached version
|
// cached version
|
||||||
|
|||||||
@ -289,8 +289,10 @@ describe('Kubectl class', () => {
|
|||||||
it('gets resource', async () => {
|
it('gets resource', async () => {
|
||||||
const resourceType = 'type'
|
const resourceType = 'type'
|
||||||
const name = 'name'
|
const name = 'name'
|
||||||
const annotations: {[key: string] : string} = {}
|
const annotations: {[key: string]: string} = {}
|
||||||
expect(await kubectl.getResource(resourceType, name, annotations)).toBe(execReturn)
|
expect(
|
||||||
|
await kubectl.getResource(resourceType, name, annotations)
|
||||||
|
).toBe(execReturn)
|
||||||
expect(exec.getExecOutput).toBeCalledWith(
|
expect(exec.getExecOutput).toBeCalledWith(
|
||||||
kubectlPath,
|
kubectlPath,
|
||||||
[
|
[
|
||||||
|
|||||||
@ -136,7 +136,7 @@ export class Kubectl {
|
|||||||
public async getResource(
|
public async getResource(
|
||||||
resourceType: string,
|
resourceType: string,
|
||||||
name: string,
|
name: string,
|
||||||
annotations: {[key: string] : string} = {}
|
annotations: {[key: string]: string} = {}
|
||||||
): Promise<ExecOutput> {
|
): Promise<ExecOutput> {
|
||||||
return await this.execute([
|
return await this.execute([
|
||||||
'get',
|
'get',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user