Como engenheiro de DevOps, você pode atualizar namespaces de autoatendimento usando o comando kubectl edit
.
Pré-requisitos
Procedimento
- Faça login no Cluster de Supervisor.
kubectl vsphere login --server IP-ADDRESS-SUPERVISOR-CLUSTER --vsphere-username VCENTER-SSO-USERNAME
- Descreva o namespace que você deseja atualizar.
kubectl describe ns testns-1 Name: testns Labels: vSphereClusterID=domain-c50 Annotations: my-ann: test-ann-2 vmware-system-namespace-owner-count: 2 vmware-system-resource-pool: resgroup-153 vmware-system-resource-pool-cpu-limit: 0.4770 vmware-system-resource-pool-memory-limit: 2000Mi vmware-system-self-service-namespace: true vmware-system-vm-folder: group-v154 Status: Active Resource Quotas Name: testns-1 Resource Used Hard -------- --- --- requests.storage 0 5000Mi Name: testns-1-storagequota Resource Used Hard -------- --- --- namespace-service-storage-profile.storageclass.storage.k8s.io/requests.storage 0 9223372036854775807
- Edite o namespace usando o comando kubectl edit.
Por exemplo, kubectl edit ns testns-1O comando kubectl edit abre o manifesto do namespace no editor de texto definido pela variável de ambiente KUBE_EDITOR ou EDITOR.
- Atualize os rótulos.
Por exemplo,
my-label=test-label
- Atualize as anotações.
Por exemplo,
my-ann: test-ann
- Descreva o namespace para ver as atualizações.
root@localhost [ /tmp ]# kubectl describe ns testns-1 Name: testns-1 Labels: my-label=test-label vSphereClusterID=domain-c50 Annotations: my-ann: test-ann vmware-system-namespace-owner-count: 1 vmware-system-resource-pool: resgroup-173 vmware-system-resource-pool-cpu-limit: 0.4770 vmware-system-resource-pool-memory-limit: 2000Mi vmware-system-self-service-namespace: true vmware-system-vm-folder: group-v174 Status: Active Resource Quotas Name: testns-1 Resource Used Hard -------- --- --- requests.storage 0 5000Mi Name: testns-1-storagequota Resource Used Hard -------- --- --- namespace-service-storage-profile.storageclass.storage.k8s.io/requests.storage 0 9223372036854775807 No LimitRange resource.