I need to set up a kubernetes pod to create demo environments for clients of my web application, with a 20 day trial duration. After these 20 days, the pod should be automatically deleted, how can I make the pod self-destruct after 20 days? I use Rancher to deploy my pods.
How can I self-destruct a Kubernetes pod automatically after 20 days?
3k Views Asked by Luis Manuel Cortés Tirado At
1
There are 1 best solutions below
Related Questions in KUBERNETES
- Golang == Error: OCI runtime create failed: unable to start container process: exec: "./bin": stat ./bin: no such file or directory: unknown
- I can't create a pod in minikube on windows
- Oracle setting up on k8s cluster using helm charts enterprise edition
- Retrieve the Dockerfile configuration from the Kubernetes and also change container Java parameter?
- Summarize pods not running, by Namespace and Reason - I'm having trouble finding the reason
- How to get Java running parameters from Spring Boot running inside container in pod where no ps exist
- How do we configure prometheus server to scrape metrics from a pod with Istio sidecar proxy?
- In rke kube-proxy pod is not present
- problem with edge server registration in Eureka
- Unable to Access Kubernetes LoadBalancer Service from Local Device Outside Cluster
- Kubernetes cluster on GCE connection refused error
- Based on my experience, I've outlined the Kubernetes request flow. Could someone please add or highlight any points I might have overlooked?
- how to define StackGres helm chart "restapi" values to use internal LoadBalancer - AWS EKS
- Python3.11 can't open file [Errno 2] No such file or directory
- Cannot find remote pod service - SERVICE_UNAVAILABLE
Related Questions in KUBERNETES-POD
- K8s cluster deployment error: nc: bad address 'xx'
- Hazelcast deployment on Kubernetes without Cluster Roles
- Kubernetes - one of the containers to act as a proxy to the main app in a pod
- How to get EKS Pod role with aws command
- Is there a way to measure CPU usage inside the Kubernetes POD?
- Understanding Kubernetes eviction algorithm
- kubernetes pods getting evited with error "eviction manager: attempting to reclaim memory" even if memory consumption is far less
- Comunication multiple containers in multiple pods in kubernetes
- Use init container for running commands in the actual pod
- Helm, Kubernetes, how to configure Pod to access a service outside the cluster?
- How do I configure opensearch as a logstash output properly, I am getting a host unreachable error
- Why there is no concept of nodepool in Kubernetes?
- Observing weird kubernetes behavior while deleting using yaml
- MySql databases deleted on new deployment in kubernetes
- unable to access mongodb Replicaset pods from other pods | connect EHOSTUNREACH 10.1.231.87:27017
Related Questions in RANCHER
- docker inspect splunkImage Container ID: Warining: cannot create \"/opt/splunk/var/log/splunk
- Increase swap memory in Rancher or Podman with Mac Apple Sillicon
- Expose service on k8 Infrastructure
- failed to solve: python:3.13.0a5: error getting credentials - err: exit status 127 - Docker
- How can I modify vcluster cpu memory and disk on Rancher?
- Rancher 1.6 port forwarding on any host forwards to host with rancher/server installed
- Cannot pull image from insecure registry using Rancher's "docker-based development deployment"
- .net 8 WEB API calling AWS aws_signing_helper and aws sts assume-role in Linux / Rancher assistance
- Rancher ERR_CONNECTION_REFUSED
- Traefik Rancher new install can't access dashboard
- Rancher Single Docker Air-Gapped with Private Registry
- Unable to upload files > 1mb in Rancher; Nginx returns 413 error code for file sizes >1mb. How to modify configuration to allow for larger uploads?
- Opentelemetry otelcol-contrib Error in logs
- Is it possible to enable communication between Rancher and EKS nodes using internal IP addresses?
- How to grant access to all the CRD's in rancher kubernetes (RKE)?
Related Questions in DEMO
- how to perform a Ping flood attack / ICMP flood attack demonstration?
- How to show frontend demo from WordPress customizer options?
- gh-pages branch not making with npm install --save gh-pages
- How can I record a website demo as an animated SVG like this?
- With the Kraken Python REST API, how to interact with Sandbox/demo environment?
- Scilab 2023 Xcos electrical demo does not work in Windows 10
- Is there any way to deploy a demo application in flutter, specifically something made for mobile (regardless of being iOS or Android) on the web?
- How to reset a cloud Postgres DB as if it was just created before each demo deployment?
- How to start julia reinforcement experiments?
- How to create demo project in Xcode?
- How to execute a file from URL
- Adding a pretrained model outside of AllenNLP to the AllenNLP demo
- Slider demo for a contour plot in python
- dotcms osgi plugin from examples web interceptor
- Any example for Fully Featured Ag-grid?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You can achieve this using two ways, write your own code and run on K8s to check status which will delete the deployment (POD) after 20 days
Reference github : https://github.com/dignajar/clean-pods
There is no option for your pod to get auto-deleted.
Either you run cronjob at an interval of 20 days which will delete specific deployment but again in this case you have to pass deployment or pod name so cronjob has that variable.
Example : 1
use delete_namespaced_pod
Example : 2
cronjob
Extra
You can also write shell script which run daily run few command to check the AGE of POD and delete if equal to 20 days
Update
If you face any error for forbidden do create the service account and use that with cronjob