How do you remove the deploymentConfig, image streams, etc using Openshift OC?

13,108

When using oc new-app, it would normally add a label on each resource created call app with value being the name given to the application. That name would be based on the name of the git repository, or could have been supplied using the --name option. Knowing that to delete everything you can then run:

oc delete all --selector app=appname

Before you delete anything you should be able to check what would matche by running:

oc get all --selector app=appname

Note that if creating from a template, rather than a repository, how things are labelled can depend on what the template itself sets up, so the instructions above may not apply.

Share:
13,108
coddiwomplefrog
Author by

coddiwomplefrog

Hello, my name is Heath Dinkins. I'm a coder, writer, gamer, husband, and father. My official title is Distributed Systems Architect. I often don't have bad years or days, I have good or great days. I love to talk to people, and I rarely meet a stranger. I'm a first-generation college student. I received my Bachelor's degree from Kennesaw State University. I'm halfway through my Master's degree in Computer Science with a specialization in Interactive Intelligence at Georgia Tech (RIP 2020). I struggled to find what I wanted to do with my life. I wanted to be a doctor, then a businessman, but when I wrote my first line of code back in 2009, I never looked back. I really didn't love coding at first, but over time I realized that there was so much more to coding than coding - design, collaboration, experimentation, and more. I love how software is made and I always strive to be better at what I do. In more recent years, I've switched into more of a leadership and teaching role, and I've found that I enjoy that SO much. I love to build highly distributed systems and lead tech teams to victory and beyond. While I never became a doctor, I was still interested in helping people. I've focused most of my efforts on the Healthcare industry working through Leidos. My largest project at Leidos involved building a software product that monitored patients that were having surgery to improve outcomes. The next was building an ETL pipeline that helped share Covid-19 data with the CDC and states/regions. The next was building a system for HHS that monitored people and products supporting disaster sites that FEMA might visit (e.g. hurricanes, tornadoes). My current projects include building a system to route immunization records to states and cloudifying a system that processes Covid-19 and Hospital Acquired Infection data and sends it to the CDC. My overall goal is to build highly distributed systems and products that help improve the health of America and eventually the world. My goals for the future include publishing multiple books, becoming a CEO of a few of my own software companies, and traveling the world (once Covid-19 dies down a bit). I also love being a new dad, devoted husband, reliable work colleague, helpful brother, and trustworthy friend.

Updated on July 29, 2022

Comments

  • coddiwomplefrog
    coddiwomplefrog over 1 year

    After creating a new app using oc new-app location/nameofapp, many things are created: a deploymentConfig, an imagestream, a service, etc. I know you can run oc delete <label>. I would like to know how to delete all of these given the label.