Prerequisiti
- aver configurato correttamente kubectl usando il plugin kubectl-openstack
aver verificato che esista nel progetto CloudVeneto il security group K8S cosi' definito:
Egress IPv4 Any Any 0.0.0.0/0 Egress IPv6 Any Any ::/0 Ingress IPv4 ICMP Any 0.0.0.0/0 Ingress IPv4 TCP 22 (SSH) 0.0.0.0/0 Ingress IPv4 TCP Any 192.168.60.0/24 Ingress IPv4 UDP Any 192.168.60.0/24 Ingress IPv4 TCP Any 10.64.0.0/16 Ingress IPv4 UDP Any 10.64.0.0/16
Come creare un nuovo nodo
Per creare un nuovo nodo si usa kubectl, l'interfaccia standard di Kubernetes. Nello specifico il comando da utilizzare e' kubectl apply che richiede in input un file yaml.
...
Code Block | ||||
---|---|---|---|---|
| ||||
$ kubectl apply -f osnode.yml openstacknode.osnode.infn.it/osn-01 created openstacknode.osnode.infn.it/osn-02 created |
Come verificare lo stato di uno nodo o piu' nodi
Per verificare lo stato di un nodo si usa il comando kubectl get osn -o wide (l'opzione -o wide aggiunge informazioni relative alla VM):
...
Code Block | ||||
---|---|---|---|---|
| ||||
$ kubectl describe osn osn-01 Name: osn-01 Namespace: glv Labels: SECRET=bootstrap-token-t9d7lt osn.infn.it/project-id=6dae634709c4478d92f70c388897fc96 osn.infn.it/project-name=GLV osn.infn.it/user-id=2ddd446e119b417791492e950553a055 osn.infn.it/user-name=zangrand-at-infn.it Annotations: <none> API Version: osnode.infn.it/v1 Kind: OpenStackNode Metadata: Creation Timestamp: 2023-08-31T07:44:04Z Finalizers: openstacknode/finalizer Generation: 2 Resource Version: 22448826 UID: da56df91-d78f-4547-b1ca-b4736cf8120b Spec: Availability Zone: nova Flavor: cloudveneto.medium Image: Id: Name: Key Pair: Lisa Policy: private Provider: CloudVeneto Region: regionOne Security Groups: K8S User Data: Status: Created: 2023-08-31T07:47:05Z Description: The node is running Nodeid: osn-01-1693467852782 Phase: Running Server: Created: 2023-08-31T07:44:15Z Id: f749c90f-844a-435c-848d-886f02cde706 ipv4: 10.64.53.40 Name: osn-01 Status: ACTIVE Updated: 2023-08-31T10:37:05Z Updated: 2023-08-31T10:37:05Z Events: <none> |
Come rimuovere uno nodo o piu' nodi
Usa il comando kubectl delete osn per rimuovere uno o piu' nodi e le relative VM in CloudVeneto:
...