forked from chaos-mesh/chaos-mesh
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Basic node isolation chaos implementation using cilium policy injection
1 parent
4a14670
commit d99e2d0
Showing
41 changed files
with
4,717 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// Copyright 2023 Chaos Mesh Authors. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
package v1alpha1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// +kubebuilder:object:root=true | ||
// +chaos-mesh:experiment | ||
|
||
// CiliumChaos is the control script's spec. | ||
type CiliumChaos struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
// Spec defines the behavior of a node chaos experiment | ||
Spec CiliumChaosSpec `json:"spec"` | ||
|
||
// +optional | ||
// Most recently observed status of the chaos experiment | ||
Status CiliumChaosStatus `json:"status,omitempty"` | ||
} | ||
|
||
var _ InnerObject = (*CiliumChaos)(nil) | ||
|
||
// CiliumChaosSpec defines the attributes that a user creates on a chaos experiment affecting cilium CNI. | ||
type CiliumChaosSpec struct { | ||
NodeSelector `json:",inline"` | ||
|
||
// Duration represents the duration of the chaos action. | ||
Duration *string `json:"duration" webhook:"Duration"` | ||
|
||
// RemoteCluster represents the remote cluster where the chaos will be deployed | ||
// +optional | ||
RemoteCluster string `json:"remoteCluster,omitempty"` | ||
} | ||
|
||
// CiliumChaosStatus represents the current status of the chaos experiment about pods. | ||
type CiliumChaosStatus struct { | ||
ChaosStatus `json:",inline"` | ||
} | ||
|
||
func (obj *CiliumChaos) GetSelectorSpecs() map[string]interface{} { | ||
return map[string]interface{}{ | ||
".": &obj.Spec.NodeSelector, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.