...
Code Block | ||||
---|---|---|---|---|
| ||||
$ kubectl-iam -iam-url https://iam.quantumtea.it -group QST please open the link in your web browser: https://iam.quantumtea.it/device?user_code=BB3FXJ or scan the QR code █████████████████████████████████████████ █████████████████████████████████████████ ████ ▄▄▄▄▄ ██ █▀██▀▄█ ▄ ▄▄▄██ ▄▄▄▄▄ ████ ████ █ █ █ █ ▀▄█▄▀▄█▀█▄▄██ █ █ █ ████ ████ █▄▄▄█ █ ▀▀██▄▄▄▄█▀▀▄ █▀█ █▄▄▄█ ████ ████▄▄▄▄▄▄▄█ ▀ █ █ █ █▄▀ ▀ ▀ █▄▄▄▄▄▄▄████ ████▄█ ▄▄▄▀▀▀▄ █ ▄█ ▀▀▄▀██ ▄ ▀▀████ ████▀▄ ▀█▄█▀███▀ ▄ ▀█▀▀▀▀▄▀▀█ ▀ ▀████ ████▄▄▄▀▀▀▄▀▀▄▀ ▀▄ ▄▀▀█▄ ▄▄▄▄▀▄▄ ▀ ████ ████▀▄ ▄█ ▄█▀ ███ ▄▄▀█▄ ▀██ █ ▄█████ █████▀▄█▄▄▄ ██▀▄█▀▀▄▀▄▀▀ ▀▄ ▄▀ ▄ ▀▀ ████ ████ ▀ ▄▄█▄ ▀ ▄▄ ▀ ▀█▄█ ▀▄██ ▀ ▀█████ ████▀ ▀█ ▄▄▀▀▀▀ █▀ ▀▀▄▄▀▄ ▀▄▀██▄▀▄▀████ ████ █ ▀▀▀▄▀ ▄▀▀▀ ▄█▀█▄ ▀▀▄██▀▄ ▄ ▀ █████ ████▄████▄▄▄▀ ▄▀█▀ █ ▀█ █ ▄▄▄ █▀█▀████ ████ ▄▄▄▄▄ █▀▄▀█▄██▄ ▀█ █ █▄█ ▀ ▀████ ████ █ █ █ ▄██ ▄▀▄█▀██ ▄▀ ▄▄ ▀▀▀████ ████ █▄▄▄█ █▄██▄▀▄▄ ▄█▀▀█ ▄█▄▀▄▄▀ ██████ ████▄▄▄▄▄▄▄█▄█▄▄█▄▄▄█▄▄▄▄█▄▄▄██▄█▄█▄█████ █████████████████████████████████████████ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ .................................................................................. kubectl configured correctly |
How to Create and Manage Kubernetes Cluster Nodes
Prerequisites
Before you can create and manage nodes in your Kubernetes cluster, make sure you have completed the following prerequisites:
Configure kubectl with the kubectl-openstack plugin: Ensure that your kubectl is correctly configured with the kubectl-* plugin.
- Verify the existence of the 'K8S' security group in the CloudVeneto project with the following rules, or create it:
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 |
Creating a New Node
To create a new node in your Kubernetes cluster, you'll use kubectl, the standard Kubernetes command-line interface. Specifically, you will utilize the kubectl apply
command, which takes a YAML file as input.
The YAML file required to create a new node should follow this structure:
Code Block | ||||
---|---|---|---|---|
| ||||
---
apiVersion: osnode.infn.it/v1
kind: OpenStackNode
metadata:
name: NODE_NAME
spec:
flavor: FLAVOR_NAME
keyPair: KEYPAIR_NAME
policy: [shared | private ] |
NODE_NAME: <Unique node name>
FLAVOR_NAME: <CloudVeneto flavor name>
KEYPAIR_NAME: <User-defined SSH keypair name>
shared | private: <Choose one: shared or private>
In the following example, we request the creation of two nodes (osn-01 and osn-02), the first being shared and the second private, with different flavors (cloudveneto.medium and cloudveneto.large).
Both nodes use the same SSH keypair (my-key):
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
---
apiVersion: osnode.infn.it/v1
kind: OpenStackNode
metadata:
name: osn-01
spec:
flavor: cloudveneto.medium
keyPair: my-key
policy: shared
---
apiVersion: osnode.infn.it/v1
kind: OpenStackNode
metadata:
name: osn-02
spec:
flavor: cloudveneto.large
keyPair: my-key
policy: private
|
Code Block | ||||
---|---|---|---|---|
| ||||
$ kubectl apply -f osnode.yml
openstacknode.osnode.infn.it/osn-01 created
openstacknode.osnode.infn.it/osn-02 created |
Verifying Node Status
To check the status of one or more nodes in your Kubernetes cluster, you can use the following commands:
To list all nodes and their basic information:
Code Block language bash theme Midnight $ kubectl get osn NAME PHASE OWNER POLICY PROVIDER VM IPV4 AGE osn-01 Running zangrand-at-infn.it private CloudVeneto 10.64.53.40 169m osn-02 Running zangrand-at-infn.it shared CloudVeneto 10.64.53.67 169m
To list all nodes with additional details, including flavor, status, and IP address:
Code Block language bash theme Midnight $ kubectl get osn -o wide NAME PHASE OWNER POLICY PROVIDER VM FLAVOR VM STATUS VM IPV4 AGE osn-01 Running zangrand-at-infn.it private CloudVeneto cloudveneto.medium ACTIVE 10.64.53.40 169m osn-02 Running zangrand-at-infn.it shared CloudVeneto cloudveneto.medium ACTIVE 10.64.53.67 169m
To view detailed information about a specific node (replace
osn-01
with the desired node name):Code Block language bash theme Midnight $ kubectl get osn -o wide osn-01 NAME PHASE OWNER POLICY PROVIDER VM FLAVOR VM STATUS VM IPV4 AGE osn-01 Running zangrand-at-infn.it private CloudVeneto cloudveneto.medium ACTIVE 10.64.53.40 169m
Removing Nodes
To remove one or more nodes and their associated VMs from CloudVeneto, use the following command:
Code Block | ||||
---|---|---|---|---|
| ||||
$ kubectl delete osn <node_name_1> <node_name_2> ... |
For example, to remove osn-01
and osn-02
, you would run:
Code Block | ||||
---|---|---|---|---|
| ||||
$ kubectl delete osn osn-01 osn-02
openstacknode.osnode.infn.it "osn-01" deleted
openstacknode.osnode.infn.it "osn-02" deleted |
...