Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(fixing main) Update pod_memory_hog_spec.cr #1987

Merged
merged 8 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,6 @@ jobs:
LOG_LEVEL=info crystal spec --warnings none --tag ${{ matrix.spec }} -v


# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v2

- name: Delete Cluster
if: ${{ always() }}
run: |
Expand Down Expand Up @@ -298,6 +295,7 @@ jobs:
echo "DOCKER USER RATE LIMIT: $AUTH_RATE_LIMIT"
LOG_LEVEL=info crystal spec --warnings none --tag ${{ matrix.tag }} -v


build:
name: Build Release
runs-on: ubuntu-latest
Expand Down
5 changes: 3 additions & 2 deletions spec/workload/resilience/pod_memory_hog_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ describe "Resilience pod memory hog Chaos" do

it "'pod_memory_hog' A 'Good' CNF should not crash when pod memory hog occurs", tags: ["pod_memory_hog"] do
begin
`./cnf-testsuite cnf_setup cnf-config=sample-cnfs/sample-coredns-cnf/cnf-testsuite.yml`
install_log = `./cnf-testsuite cnf_setup cnf-config=sample-cnfs/sample-coredns-cnf/cnf-testsuite.yml`
LOGGING.info = install_log
$?.success?.should be_true
response_s = `./cnf-testsuite pod_memory_hog verbose`
LOGGING.info response_s
Expand All @@ -27,4 +28,4 @@ describe "Resilience pod memory hog Chaos" do
$?.success?.should be_true
end
end
end
end
3 changes: 2 additions & 1 deletion src/tasks/litmus_setup.cr
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ end

module LitmusManager

Version = "2.14.0"
Version = "3.6.0"
RBAC_VERSION = "2.6.0"
# Version = "1.13.8"
# Version = "3.0.0-beta12"
NODE_LABEL = "kubernetes.io/hostname"
Expand Down
53 changes: 20 additions & 33 deletions src/tasks/workload/reliability.cr
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,10 @@ task "pod_network_latency", ["install_litmus"] do |t, args|
KubectlClient::Apply.file("#{OFFLINE_MANIFESTS_PATH}/lat-experiment.yaml")
KubectlClient::Apply.file("#{OFFLINE_MANIFESTS_PATH}/lat-rbac.yaml")
else
# experiment_url = "https://hub.litmuschaos.io/api/chaos/#{LitmusManager::Version}?file=charts/generic/pod-network-latency/experiment.yaml"
experiment_url = "https://raw.githubusercontent.com/litmuschaos/chaos-charts/#{LitmusManager::Version}/charts/generic/pod-network-latency/experiment.yaml"
# rbac_url = "https://hub.litmuschaos.io/api/chaos/#{LitmusManager::Version}?file=charts/generic/pod-network-latency/rbac.yaml"
# https://raw.githubusercontent.com/litmuschaos/chaos-charts/v2.14.x/charts/generic/pod-network-latency/rbac.yaml
rbac_url = "https://raw.githubusercontent.com/litmuschaos/chaos-charts/#{LitmusManager::Version}/charts/generic/pod-network-latency/rbac.yaml"
experiment_url = "https://raw.githubusercontent.com/litmuschaos/chaos-charts/#{LitmusManager::Version}/faults/kubernetes/pod-network-latency/fault.yaml"
rbac_url = "https://raw.githubusercontent.com/litmuschaos/chaos-charts/#{LitmusManager::RBAC_VERSION}/charts/generic/pod-network-latency/rbac.yaml"



experiment_path = LitmusManager.download_template(experiment_url, "#{t.name}_experiment.yaml")
KubectlClient::Apply.file(experiment_path, namespace: app_namespace)
Expand Down Expand Up @@ -216,10 +215,8 @@ task "pod_network_corruption", ["install_litmus"] do |t, args|
KubectlClient::Apply.file("#{OFFLINE_MANIFESTS_PATH}/corr-experiment.yaml")
KubectlClient::Apply.file("#{OFFLINE_MANIFESTS_PATH}/corr-rbac.yaml")
else
experiment_url = "https://hub.litmuschaos.io/api/chaos/#{LitmusManager::Version}?file=charts/generic/pod-network-corruption/experiment.yaml"
experiment_url = "https://raw.githubusercontent.com/litmuschaos/chaos-charts/#{LitmusManager::Version}/charts/generic/pod-network-corruption/experiment.yaml"
# rbac_url = "https://hub.litmuschaos.io/api/chaos/#{LitmusManager::Version}?file=charts/generic/pod-network-corruption/rbac.yaml"
rbac_url = "https://raw.githubusercontent.com/litmuschaos/chaos-charts/#{LitmusManager::Version}/charts/generic/pod-network-corruption/rbac.yaml"
experiment_url = "https://raw.githubusercontent.com/litmuschaos/chaos-charts/#{LitmusManager::Version}/faults/kubernetes/pod-network-corruption/fault.yaml"
rbac_url = "https://raw.githubusercontent.com/litmuschaos/chaos-charts/#{LitmusManager::RBAC_VERSION}/charts/generic/pod-network-corruption/rbac.yaml"

experiment_path = LitmusManager.download_template(experiment_url, "#{t.name}_experiment.yaml")
KubectlClient::Apply.file(experiment_path, namespace: app_namespace)
Expand Down Expand Up @@ -282,10 +279,8 @@ task "pod_network_duplication", ["install_litmus"] do |t, args|
KubectlClient::Apply.file("#{OFFLINE_MANIFESTS_PATH}/dup-experiment.yaml")
KubectlClient::Apply.file("#{OFFLINE_MANIFESTS_PATH}/dup-rbac.yaml")
else
# experiment_url = "https://hub.litmuschaos.io/api/chaos/#{LitmusManager::Version}?file=charts/generic/pod-network-duplication/experiment.yaml"
experiment_url = "https://raw.githubusercontent.com/litmuschaos/chaos-charts/#{LitmusManager::Version}/charts/generic/pod-network-duplication/experiment.yaml"
# rbac_url = "https://hub.litmuschaos.io/api/chaos/#{LitmusManager::Version}?file=charts/generic/pod-network-duplication/rbac.yaml"
rbac_url = "https://raw.githubusercontent.com/litmuschaos/chaos-charts/#{LitmusManager::Version}/charts/generic/pod-network-duplication/rbac.yaml"
experiment_url = "https://raw.githubusercontent.com/litmuschaos/chaos-charts/#{LitmusManager::Version}/faults/kubernetes/pod-network-duplication/fault.yaml"
rbac_url = "https://raw.githubusercontent.com/litmuschaos/chaos-charts/#{LitmusManager::RBAC_VERSION}/charts/generic/pod-network-duplication/rbac.yaml"

experiment_path = LitmusManager.download_template(experiment_url, "#{t.name}_experiment.yaml")
KubectlClient::Apply.file(experiment_path, namespace: app_namespace)
Expand Down Expand Up @@ -346,10 +341,8 @@ task "disk_fill", ["install_litmus"] do |t, args|
KubectlClient::Apply.file("#{OFFLINE_MANIFESTS_PATH}/disk-fill-experiment.yaml")
KubectlClient::Apply.file("#{OFFLINE_MANIFESTS_PATH}/disk-fill-rbac.yaml")
else
# experiment_url = "https://hub.litmuschaos.io/api/chaos/#{LitmusManager::Version}?file=charts/generic/disk-fill/experiment.yaml"
experiment_url = "https://raw.githubusercontent.com/litmuschaos/chaos-charts/#{LitmusManager::Version}/charts/generic/disk-fill/experiment.yaml"
# rbac_url = "https://hub.litmuschaos.io/api/chaos/#{LitmusManager::Version}?file=charts/generic/disk-fill/rbac.yaml"
rbac_url = "https://raw.githubusercontent.com/litmuschaos/chaos-charts/#{LitmusManager::Version}/charts/generic/disk-fill/rbac.yaml"
experiment_url = "https://raw.githubusercontent.com/litmuschaos/chaos-charts/#{LitmusManager::Version}/faults/kubernetes/disk-fill/fault.yaml"
rbac_url = "https://raw.githubusercontent.com/litmuschaos/chaos-charts/#{LitmusManager::RBAC_VERSION}/charts/generic/disk-fill/rbac.yaml"

experiment_path = LitmusManager.download_template(experiment_url, "#{t.name}_experiment.yaml")
KubectlClient::Apply.file(experiment_path, namespace: app_namespace)
Expand Down Expand Up @@ -439,17 +432,17 @@ task "pod_delete", ["install_litmus"] do |t, args|
KubectlClient::Apply.file("#{OFFLINE_MANIFESTS_PATH}/pod-delete-experiment.yaml")
KubectlClient::Apply.file("#{OFFLINE_MANIFESTS_PATH}/pod-delete-rbac.yaml")
else
# experiment_url = "https://hub.litmuschaos.io/api/chaos/#{LitmusManager::Version}?file=charts/generic/pod-delete/experiment.yaml"
experiment_url = "https://raw.githubusercontent.com/litmuschaos/chaos-charts/#{LitmusManager::Version}/charts/generic/pod-delete/experiment.yaml"
experiment_url = "https://raw.githubusercontent.com/litmuschaos/chaos-charts/#{LitmusManager::Version}/faults/kubernetes/pod-delete/fault.yaml"
rbac_url = "https://raw.githubusercontent.com/litmuschaos/chaos-charts/#{LitmusManager::RBAC_VERSION}/charts/generic/pod-delete/rbac.yaml"

experiment_path = LitmusManager.download_template(experiment_url, "#{t.name}_experiment.yaml")

# rbac_url = "https://hub.litmuschaos.io/api/chaos/#{LitmusManager::Version}?file=charts/generic/pod-delete/rbac.yaml"
rbac_url = "https://raw.githubusercontent.com/litmuschaos/chaos-charts/#{LitmusManager::Version}/charts/generic/pod-delete/rbac.yaml"
rbac_path = LitmusManager.download_template(rbac_url, "#{t.name}_rbac.yaml")
rbac_yaml = File.read(rbac_path)
rbac_yaml = rbac_yaml.gsub("namespace: default", "namespace: #{app_namespace}")
File.write(rbac_path, rbac_yaml)


KubectlClient::Apply.file(experiment_path, namespace: app_namespace)
KubectlClient::Apply.file(rbac_path)
end
Expand Down Expand Up @@ -523,10 +516,8 @@ task "pod_memory_hog", ["install_litmus"] do |t, args|
KubectlClient::Apply.file("#{OFFLINE_MANIFESTS_PATH}/pod-memory-hog-experiment.yaml")
KubectlClient::Apply.file("#{OFFLINE_MANIFESTS_PATH}/pod-memory-hog-rbac.yaml")
else
# experiment_url = "https://hub.litmuschaos.io/api/chaos/#{LitmusManager::Version}?file=charts/generic/pod-memory-hog/experiment.yaml"
experiment_url = "https://raw.githubusercontent.com/litmuschaos/chaos-charts/#{LitmusManager::Version}/charts/generic/pod-memory-hog/experiment.yaml"
# rbac_url = "https://hub.litmuschaos.io/api/chaos/#{LitmusManager::Version}?file=charts/generic/pod-memory-hog/rbac.yaml"
rbac_url = "https://raw.githubusercontent.com/litmuschaos/chaos-charts/#{LitmusManager::Version}/charts/generic/pod-memory-hog/rbac.yaml"
experiment_url = "https://raw.githubusercontent.com/litmuschaos/chaos-charts/#{LitmusManager::Version}/faults/kubernetes/pod-memory-hog/fault.yaml"
rbac_url = "https://raw.githubusercontent.com/litmuschaos/chaos-charts/#{LitmusManager::RBAC_VERSION}/charts/generic/pod-memory-hog/rbac.yaml"

experiment_path = LitmusManager.download_template(experiment_url, "#{t.name}_experiment.yaml")
KubectlClient::Apply.file(experiment_path, namespace: app_namespace)
Expand Down Expand Up @@ -591,10 +582,8 @@ task "pod_io_stress", ["install_litmus"] do |t, args|
KubectlClient::Apply.file("#{OFFLINE_MANIFESTS_PATH}/pod-io-stress-experiment.yaml")
KubectlClient::Apply.file("#{OFFLINE_MANIFESTS_PATH}/pod-io-stress-rbac.yaml")
else
# experiment_url = "https://hub.litmuschaos.io/api/chaos/#{LitmusManager::Version}?file=charts/generic/pod-io-stress/experiment.yaml"
experiment_url = "https://raw.githubusercontent.com/litmuschaos/chaos-charts/#{LitmusManager::Version}/charts/generic/pod-io-stress/experiment.yaml"
# rbac_url = "https://hub.litmuschaos.io/api/chaos/#{LitmusManager::Version}?file=charts/generic/pod-io-stress/rbac.yaml"
rbac_url = "https://raw.githubusercontent.com/litmuschaos/chaos-charts/#{LitmusManager::Version}/charts/generic/pod-io-stress/rbac.yaml"
experiment_url = "https://raw.githubusercontent.com/litmuschaos/chaos-charts/#{LitmusManager::Version}/faults/kubernetes/pod-io-stress/fault.yaml"
rbac_url = "https://raw.githubusercontent.com/litmuschaos/chaos-charts/#{LitmusManager::RBAC_VERSION}/charts/generic/pod-io-stress/rbac.yaml"

experiment_path = LitmusManager.download_template(experiment_url, "#{t.name}_experiment.yaml")
KubectlClient::Apply.file(experiment_path, namespace: app_namespace)
Expand Down Expand Up @@ -666,10 +655,8 @@ task "pod_dns_error", ["install_litmus"] do |t, args|
KubectlClient::Apply.file("#{OFFLINE_MANIFESTS_PATH}/pod-dns-error-experiment.yaml")
KubectlClient::Apply.file("#{OFFLINE_MANIFESTS_PATH}/pod-dns-error-rbac.yaml")
else
# experiment_url = "https://hub.litmuschaos.io/api/chaos/#{LitmusManager::Version}?file=charts/generic/pod-dns-error/experiment.yaml"
experiment_url = "https://raw.githubusercontent.com/litmuschaos/chaos-charts/#{LitmusManager::Version}/charts/generic/pod-dns-error/experiment.yaml"
# rbac_url = "https://hub.litmuschaos.io/api/chaos/#{LitmusManager::Version}?file=charts/generic/pod-dns-error/rbac.yaml"
rbac_url = "https://raw.githubusercontent.com/litmuschaos/chaos-charts/#{LitmusManager::Version}/charts/generic/pod-dns-error/rbac.yaml"
experiment_url = "https://raw.githubusercontent.com/litmuschaos/chaos-charts/#{LitmusManager::Version}/faults/kubernetes/pod-dns-error/fault.yaml"
rbac_url = "https://raw.githubusercontent.com/litmuschaos/chaos-charts/#{LitmusManager::RBAC_VERSION}/charts/generic/pod-dns-error/rbac.yaml"

experiment_path = LitmusManager.download_template(experiment_url, "#{t.name}_experiment.yaml")
KubectlClient::Apply.file(experiment_path, namespace: app_namespace)
Expand Down
15 changes: 10 additions & 5 deletions src/templates/chaos_templates/disk_fill.yml.ecr
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,17 @@ spec:
components:
env:
# specify the fill percentage according to the disk pressure required
- name: EPHEMERAL_STORAGE_MEBIBYTES
value: '500'

#- name: EPHEMERAL_STORAGE_MEBIBYTES
#value: '500'
- name: TOTAL_CHAOS_DURATION
value: '60'
- name: CHAOS_INTERVAL
value: '10'
- name: DISK_FILL_PERCENTAGE
value: '80'
- name: TARGET_CONTAINER
value: ''
- name: FILL_PERCENTAGE
value: ''
#- name: FILL_PERCENTAGE
# value: ''
- name: CONTAINER_PATH
value: '/var/lib/containerd/io.containerd.grpc.v1.cri/containers/'
6 changes: 3 additions & 3 deletions src/templates/chaos_templates/pod_memory_hog.yml.ecr
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ spec:
components:
env:
# Enter the amount of memory in megabytes to be consumed by the application pod
#TODO: Temp Fix, mem hardcode to made dynamic.
- name: MEMORY_CONSUMPTION
value: '500'

value: '100'
- name: TOTAL_CHAOS_DURATION
value: '<%= @total_chaos_duration %>'
- name: TARGET_PODS
Expand All @@ -34,4 +34,4 @@ spec:
# provide the socket file path
# applicable only for containerd and crio runtime
- name: SOCKET_PATH
value: '/run/containerd/containerd.sock'
value: '/run/containerd/containerd.sock'
Loading