{"id":28955886,"url":"https://github.com/robert076/namespaces-practice","last_synced_at":"2025-06-23T20:12:00.002Z","repository":{"id":298462836,"uuid":"1000024040","full_name":"Robert076/namespaces-practice","owner":"Robert076","description":"Practicing with kubernetes namespaces. Readme contains multiple instructions on how to use the provided files.","archived":false,"fork":false,"pushed_at":"2025-06-22T10:23:38.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-22T10:29:53.027Z","etag":null,"topics":["k8s","kubernetes","namespaces"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Robert076.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-11T06:42:16.000Z","updated_at":"2025-06-22T10:23:41.000Z","dependencies_parsed_at":"2025-06-23T18:45:16.770Z","dependency_job_id":null,"html_url":"https://github.com/Robert076/namespaces-practice","commit_stats":null,"previous_names":["robert076/namespaces-practice"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Robert076/namespaces-practice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robert076%2Fnamespaces-practice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robert076%2Fnamespaces-practice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robert076%2Fnamespaces-practice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robert076%2Fnamespaces-practice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Robert076","download_url":"https://codeload.github.com/Robert076/namespaces-practice/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robert076%2Fnamespaces-practice/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261548756,"owners_count":23175502,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["k8s","kubernetes","namespaces"],"created_at":"2025-06-23T20:11:59.338Z","updated_at":"2025-06-23T20:11:59.989Z","avatar_url":"https://github.com/Robert076.png","language":null,"readme":"# 🌎 namespaces-practice\n\nNamespaces are useful for organizing your cluster. The apps you deploy in your cluster should not have any knowledge about what namespace they are on. Namespaces are only for the cluster administrator. You should be able to redeploy an app from namespace A to namespace B without issues.\n\nA good rule of thumb is to have one namespace per microservice. So every resource used in a certain microservice should go in that namespace.\n\n---\n\n### 🚀 Useful commands:\n\n1. Seeing what namespaces you have in your cluster:\n```bash\nkubectl get ns\n```\n\n2. Creating your first namespacet:\n```bash\nkubectl create ns custom-ns\n```\n\n3. Creating a namespace from a file:\n```bash\nkubectl apply -f custom-ns-2.yml\n```\n\n4. Deleting a namespace:\n```bash\nkubectl delete ns/custom-ns\n```\n\n5. Create a resource(eg: configmap) in a certain namespace:\n```bash\nkubectl create cm configmap-test --from-literal=Lorem=Ipsum -n custom-ns\n```\n\nAlso, note that you can override the key to the namespaces of the resources that you create declaratively. By adding the -n option to the kubectl create command, you force a namespace as the context for your command: kubectl will take the namespace that was passed in the command into account, not the one present in the YAML file. By doing this, it becomes very easy to duplicate your resources between different namespaces; for example, a production environment in a production namespace and a test environment in a test namespace. The possibilities are endless!\n\n6. Update your default namespace (any cluster):\n```bash\nkubectl config set-context $(kubectl config current-context) --namespace=robycu\n```\n\n7. Get the namespace used by default in your config (only works after you set it manually, by default it is not displayed):\n```bash\nkubectl config view | grep -i \"namespace\"\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobert076%2Fnamespaces-practice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobert076%2Fnamespaces-practice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobert076%2Fnamespaces-practice/lists"}