chore(pod-nuke): remove pod-nuke experiment
This commit is contained in:
@@ -1,32 +0,0 @@
|
||||
# Patterns to ignore when building packages.
|
||||
# This supports shell glob matching, relative path matching, and
|
||||
# negation (prefixed with !). Only one pattern per line.
|
||||
.DS_Store
|
||||
# Common VCS dirs
|
||||
.git/
|
||||
.gitignore
|
||||
.bzr/
|
||||
.bzrignore
|
||||
.hg/
|
||||
.hgignore
|
||||
.svn/
|
||||
# Common backup files
|
||||
*.swp
|
||||
*.bak
|
||||
*.tmp
|
||||
*~
|
||||
# Various IDEs
|
||||
.project
|
||||
.idea/
|
||||
*.tmproj
|
||||
.vscode/
|
||||
# OWNERS file for Kubernetes
|
||||
OWNERS
|
||||
# helm-docs templates
|
||||
*.gotmpl
|
||||
# docs folder
|
||||
/docs
|
||||
# icon
|
||||
icon.png
|
||||
icon.webp
|
||||
icon-small.webp
|
||||
@@ -1,36 +0,0 @@
|
||||
annotations:
|
||||
max_scale_version: 24.04.1
|
||||
min_scale_version: 24.04.0
|
||||
truecharts.org/category: operators
|
||||
truecharts.org/max_helm_version: "3.15"
|
||||
truecharts.org/min_helm_version: "3.11"
|
||||
truecharts.org/train: system
|
||||
apiVersion: v2
|
||||
appVersion: 0.0.2
|
||||
dependencies:
|
||||
- name: common
|
||||
version: 25.4.10
|
||||
repository: oci://tccr.io/truecharts
|
||||
condition: ""
|
||||
alias: ""
|
||||
tags: []
|
||||
import-values: []
|
||||
deprecated: false
|
||||
description: Watches for failed nodes and force-removes any pods on them after a timer runes out
|
||||
home: https://truecharts.org/charts/system/pod-nuke
|
||||
icon: https://truecharts.org/img/hotlink-ok/chart-icons/pod-nuke.webp
|
||||
keywords:
|
||||
- pod-nuke
|
||||
kubeVersion: '>=1.24.0-0'
|
||||
maintainers:
|
||||
- name: TrueCharts
|
||||
email: info@truecharts.org
|
||||
url: https://truecharts.org
|
||||
name: pod-nuke
|
||||
sources:
|
||||
- https://github.com/pod-nuke/pod-nuke
|
||||
- https://github.com/truecharts/charts/tree/master/charts/system/pod-nuke
|
||||
- https://github.com/truecharts/containers/tree/master/apps/pod-nuke
|
||||
- https://pod-nuke.universe.tf
|
||||
type: application
|
||||
version: 0.0.3
|
||||
@@ -1,106 +0,0 @@
|
||||
Business Source License 1.1
|
||||
|
||||
Parameters
|
||||
|
||||
Licensor: The TrueCharts Project, it's owner and it's contributors
|
||||
Licensed Work: The TrueCharts "Blocky" Helm Chart
|
||||
Additional Use Grant: You may use the licensed work in production, as long
|
||||
as it is directly sourced from a TrueCharts provided
|
||||
official repository, catalog or source. You may also make private
|
||||
modification to the directly sourced licenced work,
|
||||
when used in production.
|
||||
|
||||
The following cases are, due to their nature, also
|
||||
defined as 'production use' and explicitly prohibited:
|
||||
- Bundling, including or displaying the licensed work
|
||||
with(in) another work intended for production use,
|
||||
with the apparent intend of facilitating and/or
|
||||
promoting production use by third parties in
|
||||
violation of this license.
|
||||
|
||||
Change Date: 2050-01-01
|
||||
|
||||
Change License: 3-clause BSD license
|
||||
|
||||
For information about alternative licensing arrangements for the Software,
|
||||
please contact: legal@truecharts.org
|
||||
|
||||
Notice
|
||||
|
||||
The Business Source License (this document, or the “License”) is not an Open
|
||||
Source license. However, the Licensed Work will eventually be made available
|
||||
under an Open Source License, as stated in this License.
|
||||
|
||||
License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
|
||||
“Business Source License” is a trademark of MariaDB Corporation Ab.
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Business Source License 1.1
|
||||
|
||||
Terms
|
||||
|
||||
The Licensor hereby grants you the right to copy, modify, create derivative
|
||||
works, redistribute, and make non-production use of the Licensed Work. The
|
||||
Licensor may make an Additional Use Grant, above, permitting limited
|
||||
production use.
|
||||
|
||||
Effective on the Change Date, or the fourth anniversary of the first publicly
|
||||
available distribution of a specific version of the Licensed Work under this
|
||||
License, whichever comes first, the Licensor hereby grants you rights under
|
||||
the terms of the Change License, and the rights granted in the paragraph
|
||||
above terminate.
|
||||
|
||||
If your use of the Licensed Work does not comply with the requirements
|
||||
currently in effect as described in this License, you must purchase a
|
||||
commercial license from the Licensor, its affiliated entities, or authorized
|
||||
resellers, or you must refrain from using the Licensed Work.
|
||||
|
||||
All copies of the original and modified Licensed Work, and derivative works
|
||||
of the Licensed Work, are subject to this License. This License applies
|
||||
separately for each version of the Licensed Work and the Change Date may vary
|
||||
for each version of the Licensed Work released by Licensor.
|
||||
|
||||
You must conspicuously display this License on each original or modified copy
|
||||
of the Licensed Work. If you receive the Licensed Work in original or
|
||||
modified form from a third party, the terms and conditions set forth in this
|
||||
License apply to your use of that work.
|
||||
|
||||
Any use of the Licensed Work in violation of this License will automatically
|
||||
terminate your rights under this License for the current and all other
|
||||
versions of the Licensed Work.
|
||||
|
||||
This License does not grant you any right in any trademark or logo of
|
||||
Licensor or its affiliates (provided that you may use a trademark or logo of
|
||||
Licensor as expressly required by this License).
|
||||
|
||||
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
|
||||
AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
|
||||
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
|
||||
TITLE.
|
||||
|
||||
MariaDB hereby grants you permission to use this License’s text to license
|
||||
your works, and to refer to it using the trademark “Business Source License”,
|
||||
as long as you comply with the Covenants of Licensor below.
|
||||
|
||||
Covenants of Licensor
|
||||
|
||||
In consideration of the right to use this License’s text and the “Business
|
||||
Source License” name and trademark, Licensor covenants to MariaDB, and to all
|
||||
other recipients of the licensed work to be provided by Licensor:
|
||||
|
||||
1. To specify as the Change License the GPL Version 2.0 or any later version,
|
||||
or a license that is compatible with GPL Version 2.0 or a later version,
|
||||
where “compatible” means that software provided under the Change License can
|
||||
be included in a program with software provided under GPL Version 2.0 or a
|
||||
later version. Licensor may specify additional Change Licenses without
|
||||
limitation.
|
||||
|
||||
2. To either: (a) specify an additional grant of rights to use that does not
|
||||
impose any additional restriction on the right granted in this License, as
|
||||
the Additional Use Grant; or (b) insert the text “None”.
|
||||
|
||||
3. To specify a Change Date.
|
||||
|
||||
4. Not to modify this License in any other way.
|
||||
@@ -1,50 +0,0 @@
|
||||
---
|
||||
title: README
|
||||
---
|
||||
|
||||
## General Info
|
||||
|
||||
For more information about this Chart, please check the docs on the TrueCharts [website](https://truecharts.org/charts/system/pod-nuke)
|
||||
|
||||
**This chart is not maintained by the upstream project and any issues with the chart should be raised [here](https://github.com/truecharts/charts/issues/new/choose)**
|
||||
|
||||
## Installation
|
||||
|
||||
### Helm-Chart installation
|
||||
|
||||
To install TrueCharts Helm charts using Helm, you can use our OCI Repository.
|
||||
|
||||
`helm install mychart oci://tccr.io/truecharts/pod-nuke`
|
||||
|
||||
For more information on how to install TrueCharts Helm charts, checkout the [instructions on the website](/guides)
|
||||
|
||||
## Chart Specific Guides and information
|
||||
|
||||
All our charts have dedicated documentation pages.
|
||||
The documentation for this chart can be found here:
|
||||
https://truecharts.org/charts/system/pod-nuke
|
||||
|
||||
## Configuration Options
|
||||
|
||||
To view the chart specific options, please view Values.yaml included in the chart.
|
||||
The most recent version of which, is available here: https://github.com/truecharts/public/blob/master/charts/system/pod-nuke/values.yaml
|
||||
|
||||
All our Charts use a shared "common" library chart that contains most of the templating and options.
|
||||
For the complete overview of all available options, please checkout the documentation for them on the [common docs on our website](/common)
|
||||
|
||||
For information about the common chart and all defaults included with it, please review its values.yaml file available here: https://github.com/truecharts/public/blob/master/charts/library/common/values.yaml
|
||||
|
||||
## Support
|
||||
|
||||
- See the [Website](https://truecharts.org)
|
||||
- Check our [Discord](https://discord.gg/tVsPTHWTtr)
|
||||
- Open a [issue](https://github.com/truecharts/charts/issues/new/choose)
|
||||
|
||||
---
|
||||
|
||||
## Sponsor TrueCharts
|
||||
|
||||
TrueCharts can only exist due to the incredible effort of our staff.
|
||||
Please consider making a [donation](/general/sponsor) or contributing back to the project any way you can!
|
||||
|
||||
_All Rights Reserved - The TrueCharts Project_
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 556 B |
Binary file not shown.
|
Before Width: | Height: | Size: 3.6 KiB |
@@ -1 +0,0 @@
|
||||
{{- include "tc.v1.common.lib.chart.notes" $ -}}
|
||||
@@ -1,5 +0,0 @@
|
||||
{{/* Make sure all variables are set properly */}}
|
||||
{{- include "tc.v1.common.loader.init" . }}
|
||||
|
||||
{{/* Render the templates */}}
|
||||
{{ include "tc.v1.common.loader.apply" . }}
|
||||
@@ -1,50 +0,0 @@
|
||||
image:
|
||||
repository: tccr.io/tccr/pod-nuke
|
||||
pullPolicy: IfNotPresent
|
||||
tag: v0.0.2
|
||||
|
||||
service:
|
||||
main:
|
||||
enabled: false
|
||||
ports:
|
||||
main:
|
||||
enabled: false
|
||||
|
||||
workload:
|
||||
main:
|
||||
replicas: 2
|
||||
podSpec:
|
||||
containers:
|
||||
main:
|
||||
probes:
|
||||
liveness:
|
||||
enabled: false
|
||||
readiness:
|
||||
enabled: false
|
||||
startup:
|
||||
enabled: false
|
||||
|
||||
portal:
|
||||
open:
|
||||
enabled: false
|
||||
|
||||
podOptions:
|
||||
automountServiceAccountToken: true
|
||||
|
||||
serviceAccount:
|
||||
main:
|
||||
enabled: true
|
||||
primary: true
|
||||
|
||||
rbac:
|
||||
main:
|
||||
enabled: true
|
||||
primary: true
|
||||
clusterWide: true
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources: ["nodes"]
|
||||
verbs: ["get", "list"]
|
||||
- apiGroups: [""]
|
||||
resources: ["pods"]
|
||||
verbs: ["get", "list", "delete"]
|
||||
@@ -1,33 +0,0 @@
|
||||
FROM tccr.io/truecharts/kubectl@sha256:3ba63d6e0ebb66143e41271974acb84f629b6a9d68fd69702da829246bb77fca
|
||||
|
||||
ARG TARGETPLATFORM
|
||||
ARG VERSION
|
||||
|
||||
# hadolint ignore=DL3002
|
||||
USER root
|
||||
|
||||
COPY ./containers/apps/pod-nuke/includes/pod_nuke.sh /scripts/pod_nuke.sh
|
||||
|
||||
# hadolint ignore=DL3018,DL4006
|
||||
RUN apk update && apk add --no-cache bash \
|
||||
&& apk del curl \
|
||||
&& mkdir -p /scripts /config \
|
||||
&& chmod +x /scripts/pod_nuke.sh
|
||||
|
||||
USER root
|
||||
|
||||
WORKDIR /scripts
|
||||
|
||||
ENTRYPOINT ["/bin/bash", "/scripts/pod_nuke.sh"]
|
||||
|
||||
ARG CONTAINER_NAME
|
||||
ARG CONTAINER_VER
|
||||
LABEL "maintainer"="TrueCharts <info@truecharts.org>"
|
||||
LABEL "org.opencontainers.image.source"="https://github.com/truecharts/apps"
|
||||
LABEL org.opencontainers.image.licenses="BSD-3-Clause"
|
||||
LABEL org.opencontainers.image.title="${CONTAINER_NAME}"
|
||||
LABEL org.opencontainers.image.url="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
|
||||
LABEL org.opencontainers.image.version="${CONTAINER_VER}"
|
||||
LABEL org.opencontainers.image.description="Container for ${CONTAINER_NAME} by TrueCharts"
|
||||
LABEL org.opencontainers.image.authors="TrueCharts"
|
||||
LABEL org.opencontainers.image.documentation="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
|
||||
@@ -1,106 +0,0 @@
|
||||
Business Source License 1.1
|
||||
|
||||
Parameters
|
||||
|
||||
Licensor: The TrueCharts Project, it's owner and it's contributors
|
||||
Licensed Work: The TrueCharts "Blocky" Helm Chart
|
||||
Additional Use Grant: You may use the licensed work in production, as long
|
||||
as it is directly sourced from a TrueCharts provided
|
||||
official repository, catalog or source. You may also make private
|
||||
modification to the directly sourced licenced work,
|
||||
when used in production.
|
||||
|
||||
The following cases are, due to their nature, also
|
||||
defined as 'production use' and explicitly prohibited:
|
||||
- Bundling, including or displaying the licensed work
|
||||
with(in) another work intended for production use,
|
||||
with the apparent intend of facilitating and/or
|
||||
promoting production use by third parties in
|
||||
violation of this license.
|
||||
|
||||
Change Date: 2050-01-01
|
||||
|
||||
Change License: 3-clause BSD license
|
||||
|
||||
For information about alternative licensing arrangements for the Software,
|
||||
please contact: legal@truecharts.org
|
||||
|
||||
Notice
|
||||
|
||||
The Business Source License (this document, or the “License”) is not an Open
|
||||
Source license. However, the Licensed Work will eventually be made available
|
||||
under an Open Source License, as stated in this License.
|
||||
|
||||
License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
|
||||
“Business Source License” is a trademark of MariaDB Corporation Ab.
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Business Source License 1.1
|
||||
|
||||
Terms
|
||||
|
||||
The Licensor hereby grants you the right to copy, modify, create derivative
|
||||
works, redistribute, and make non-production use of the Licensed Work. The
|
||||
Licensor may make an Additional Use Grant, above, permitting limited
|
||||
production use.
|
||||
|
||||
Effective on the Change Date, or the fourth anniversary of the first publicly
|
||||
available distribution of a specific version of the Licensed Work under this
|
||||
License, whichever comes first, the Licensor hereby grants you rights under
|
||||
the terms of the Change License, and the rights granted in the paragraph
|
||||
above terminate.
|
||||
|
||||
If your use of the Licensed Work does not comply with the requirements
|
||||
currently in effect as described in this License, you must purchase a
|
||||
commercial license from the Licensor, its affiliated entities, or authorized
|
||||
resellers, or you must refrain from using the Licensed Work.
|
||||
|
||||
All copies of the original and modified Licensed Work, and derivative works
|
||||
of the Licensed Work, are subject to this License. This License applies
|
||||
separately for each version of the Licensed Work and the Change Date may vary
|
||||
for each version of the Licensed Work released by Licensor.
|
||||
|
||||
You must conspicuously display this License on each original or modified copy
|
||||
of the Licensed Work. If you receive the Licensed Work in original or
|
||||
modified form from a third party, the terms and conditions set forth in this
|
||||
License apply to your use of that work.
|
||||
|
||||
Any use of the Licensed Work in violation of this License will automatically
|
||||
terminate your rights under this License for the current and all other
|
||||
versions of the Licensed Work.
|
||||
|
||||
This License does not grant you any right in any trademark or logo of
|
||||
Licensor or its affiliates (provided that you may use a trademark or logo of
|
||||
Licensor as expressly required by this License).
|
||||
|
||||
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
|
||||
AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
|
||||
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
|
||||
TITLE.
|
||||
|
||||
MariaDB hereby grants you permission to use this License’s text to license
|
||||
your works, and to refer to it using the trademark “Business Source License”,
|
||||
as long as you comply with the Covenants of Licensor below.
|
||||
|
||||
Covenants of Licensor
|
||||
|
||||
In consideration of the right to use this License’s text and the “Business
|
||||
Source License” name and trademark, Licensor covenants to MariaDB, and to all
|
||||
other recipients of the licensed work to be provided by Licensor:
|
||||
|
||||
1. To specify as the Change License the GPL Version 2.0 or any later version,
|
||||
or a license that is compatible with GPL Version 2.0 or a later version,
|
||||
where “compatible” means that software provided under the Change License can
|
||||
be included in a program with software provided under GPL Version 2.0 or a
|
||||
later version. Licensor may specify additional Change Licenses without
|
||||
limitation.
|
||||
|
||||
2. To either: (a) specify an additional grant of rights to use that does not
|
||||
impose any additional restriction on the right granted in this License, as
|
||||
the Additional Use Grant; or (b) insert the text “None”.
|
||||
|
||||
3. To specify a Change Date.
|
||||
|
||||
4. Not to modify this License in any other way.
|
||||
@@ -1 +0,0 @@
|
||||
linux/amd64
|
||||
@@ -1 +0,0 @@
|
||||
0.0.2
|
||||
@@ -1,57 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Ensure we're using Bash
|
||||
if [ -z "$BASH_VERSION" ]; then
|
||||
echo "This script requires Bash. Please install it on Alpine: apk add bash"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Keep track of nodes that have failed
|
||||
declare -A failed_nodes
|
||||
# Keep track of nodes where pods have already been removed
|
||||
declare -A processed_nodes
|
||||
|
||||
while true; do
|
||||
# Get all nodes and their readiness status
|
||||
while read -r node status extra; do
|
||||
# Ensure NotReady is in the status field (handling additional conditions)
|
||||
if echo "$status" | grep -q "NotReady"; then
|
||||
# If node is newly failed, start a 15-minute timer
|
||||
if [[ -z "${failed_nodes[$node]}" && -z "${processed_nodes[$node]}" ]]; then
|
||||
echo "Node $node is NotReady, starting timer."
|
||||
failed_nodes[$node]=$(date +%s)
|
||||
else
|
||||
# Check if 15 minutes have passed
|
||||
start_time=${failed_nodes[$node]}
|
||||
current_time=$(date +%s)
|
||||
elapsed=$((current_time - start_time))
|
||||
|
||||
if [[ $elapsed -ge 900 ]]; then
|
||||
echo "15 minutes elapsed, checking for running or terminating pods on $node."
|
||||
pods=$(kubectl get pods --all-namespaces --field-selector spec.nodeName==$node --no-headers | awk '$4 == "Running" || $4 == "Terminating" {print $2 " " $1}')
|
||||
|
||||
if [[ -z "$pods" ]]; then
|
||||
echo "No running or terminating pods found on $node."
|
||||
else
|
||||
echo "$pods" | while read -r pod namespace; do
|
||||
echo "Force deleting pod $pod in namespace $namespace on node $node"
|
||||
kubectl delete pod "$pod" -n "$namespace" --force --grace-period=0
|
||||
done
|
||||
processed_nodes[$node]=1 # Mark node as processed after deleting pods
|
||||
fi
|
||||
unset failed_nodes[$node]
|
||||
fi
|
||||
fi
|
||||
else
|
||||
# If node recovers, remove it from failed and processed tracking
|
||||
if [[ -n "${failed_nodes[$node]}" || -n "${processed_nodes[$node]}" ]]; then
|
||||
echo "Node $node recovered, removing from tracking."
|
||||
unset failed_nodes[$node]
|
||||
unset processed_nodes[$node]
|
||||
fi
|
||||
fi
|
||||
done < <(kubectl get nodes --no-headers | awk '{print $1 " " $2 " " $3}')
|
||||
|
||||
# Sleep for a short period before checking again
|
||||
sleep 60
|
||||
done
|
||||
Reference in New Issue
Block a user