github.com/1aal/kubeblocks@v0.0.0-20231107070852-e1c03e598921/pkg/cli/create/template/node_chaos_template.cue (about) 1 // Copyright (C) 2022-2023 ApeCloud Co., Ltd 2 // 3 // This file is part of KubeBlocks project 4 // 5 // This program is free software: you can redistribute it and/or modify 6 // it under the terms of the GNU Affero General Public License as published by 7 // the Free Software Foundation, either version 3 of the License, or 8 // (at your option) any later version. 9 // 10 // This program is distributed in the hope that it will be useful 11 // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 // GNU Affero General Public License for more details. 14 // 15 // You should have received a copy of the GNU Affero General Public License 16 // along with this program. If not, see <http://www.gnu.org/licenses/>. 17 18 // required, command line input options for parameters and flags 19 options: { 20 kind: string 21 namespace: string 22 action: string 23 secretName: string 24 region: string 25 instance: string 26 volumeID: string 27 deviceName?: string 28 duration: string 29 30 project: string 31 } 32 33 // required, k8s api resource content 34 content: { 35 kind: options.kind 36 apiVersion: "chaos-mesh.org/v1alpha1" 37 metadata: { 38 generateName: "node-chaos-" 39 namespace: options.namespace 40 } 41 spec: { 42 action: options.action 43 secretName: options.secretName 44 duration: options.duration 45 46 if options.kind == "AWSChaos" { 47 awsRegion: options.region 48 ec2Instance: options.instance 49 if options.deviceName != _|_ { 50 volumeID: options.volumeID 51 deviceName: options.deviceName 52 } 53 } 54 55 if options.kind == "GCPChaos" { 56 project: options.project 57 zone: options.region 58 instance: options.instance 59 if options.deviceName != _|_ { 60 deviceNames: [options.deviceName] 61 } 62 63 } 64 } 65 }