CLI Documentation#
skyshift#
SkyShift CLI
skyshift [OPTIONS] COMMAND [ARGS]...
apply#
skyshift apply [OPTIONS]
Options
- -f, --file <file>#
Required Path to config file (YAML).
cluster#
Commands for cluster
skyshift cluster [OPTIONS] COMMAND [ARGS]...
create#
Create a new cluster and attach to SkyShift. Once attached, the cluster can be managd via SkyShift and made available for jobs submitted to SkyShift. This supports clusters managed via Kubernetes, Slurm and Ray.
Cluster creation supports customized provisioning requirements such as Nodes, Regions, CPU and Memory requirements. Post creation SkyShift monitors the status and makes it available to the user.
- Examples:
Create a basic cluster with Kuberntes:
skyctl create cluster my-cluster --manager=k8 --cpus=4 --memory=16GB --disk_size=100 --num_nodes=3
The above command creates a cluster named my-cluster with Kubernetes as the cluster manager. The cluster will be provisioned with 3 nodes, each node with 4 virtual CPUs (vCPUs), 16GB of memory, and a 100GB OS disk. Additionally configs, host, username and other properties can be passed for any custom requirements.
Create a GPU-Accelerated Cluster via Ray:
skyctl create cluster gpu-cluster --manager=ray --cpus=8 --memory=64GB --accelerators=V100:2 --num_nodes=5 --cloud=gcp --region=us-central1 --ports=22,8888 --provision
This command sets up a cluster named gpu-cluster managed by Ray. It provisions 5 nodes in the cluster. Each node provisioned with 8 vCPUs, 64GB of memory, and 2 NVIDIA V100 GPUs. The cloud flag indicates the cluster provisioning on GCP with us-central1 region. Further, it opens up ports 22 and 8888 for remote access via SSH or Jupyter notebook.
Cluster with Specific Cloud and Region:
skyctl create cluster cloud-cluster --cloud=aws --region=us-west-2 --manager=slurm --cpus=16 --memory=128GB
This command creates a cluster named cloud-cluster on AWS. Slurm will be used as the cluster manager. The cluster will be provisioned in the us-west-2 region. Each node in this cluster will have 16 vCPUs and 128GB of memory.
skyshift cluster create [OPTIONS] NAME
Options
- -l, --labels <labels>#
Key-value pairs for cluster labels
- --manager <manager>#
Required Cluster manager type (e.g. k8, slurm, ray).
- Default:
'k8'
- --cpus <cpus>#
Number of vCPUs per node (e.g. 1, 1+).
- --memory <memory>#
Amount of memory each instance must have in GB. (e.g. 32, 32+).
- --disk_size <disk_size>#
OS disk size in GBs
- --accelerators <accelerators>#
Type and number of GPU accelerators to use
- --ports <ports>#
Ports to open on the cluster
- --num_nodes <num_nodes>#
Number of SkyPilot nodes to allocate to the cluster
- Default:
1
- --cloud <cloud>#
- --region <region>#
- -k, --ssh_key_path <ssh_key_path>#
SSH key to use for Ray clusters. It can be a path to a file or the key itself
- Default:
''
- -c, -C, --config <config>#
Config file for the cluster.
- Default:
''
- -h, -H, --host, --hostname <host>#
Host to use for the cluster
- Default:
''
- -u, --username <username>#
Username to use for the cluster
- Default:
''
- --provision#
True if cluster needs to be provisioned on the cloud.
Arguments
- NAME#
Required argument
delete#
The delete cluster
command removes a cluster from SkyShift. For a cluster
being managed by SkyShift, this command simply detaches the cluster. If the
cluster was provided using SkyShift, this command also removes the cluster from
the cloud provider.
- Examples:
Delete a Cluster Managed by SkyShift:
skyctl delete cluster my-cluster
This command deletes the cluster named my-cluster from SkyShift. If the cluster was only managed (but not provisioned) by SkyShift, it will simply be detached from SkyShift’s management. If it was provisioned by SkyShift, the cluster will be deleted from the cloud provider as well.
skyshift cluster delete [OPTIONS] NAME
Arguments
- NAME#
Required argument
get#
The get cluster command fetches and displays details for one or all clusters being managed by SkyShift. This provides the names, managers, statuses, and resources (allocated/available) on the cluster. You can view all the clusters and their metadata by not providing a specific cluster.
- Examples:
Fetch Details for All Clusters:
> skyctl get cluster ⠙ Fetching clusters NAME MANAGER LABELS RESOURCES STATUS AGE minikube k8 cpus: 15.25/16.0 ERROR 12d memory: 15.18 GB/15.35 GB disk: 151.13 GB/151.13 GB ✔ Fetching clusters completed successfully.
Running this command without specifying a cluster name will fetch and display details for all clusters being managed by SkyShift. This includes each cluster’s name, manager type, current status, resource allocations and age.
Fetch Details for a Specific Cluster:
skyctl get cluster my-cluster
This command fetches and displays details for the cluster named my-cluster. The output will include the specific details of the cluster, such as the manager type, current status, and allocated resources.
Watch for Changes in a Specific Cluster:
skyctl get cluster my-cluster --watch ⠧ Fetching clusterskind='WatchEvent' event_type='UPDATE' object=Cluster(kind='Cluster', metadata=ClusterMeta(name='minikube', labels={}, annotations={}, creation_timestamp='2024-08-25T07:52:58', resource_version=15163), spec=ClusterSpec(manager='k8', cloud=None, region=None, cpus=None, memory=None, disk_size=None, accelerators=None, ports=[], num_nodes=1, provision=False, config_path='~/.kube/config', access_config={}), status=ClusterStatus(conditions= [{'status': 'INIT', 'transitionTime': '1724572270.4890375'}, {'status': 'READY', 'transitionTime': '1724572378.7774274'}, {'status': 'ERROR', 'transitionTime': '1725679618.1222773'}], status='ERROR', allocatable_capacity={'minikube': {'cpus': 15.250000000000002, 'memory': 15543.71484375, 'disk': 154755.10546875, 'gpus': 0.0}}, capacity={'minikube': {'cpus': 16.0, 'memory': 15713.71484375, 'disk': 154755.10546875, 'gpus': 0.0}}, network_enabled=False, accelerator_types={}))
By adding the –watch flag, this command continuously monitors my-cluster for any changes. It will provide real-time updates on the cluster’s status, resources, and other relevant details as they change.
skyshift cluster get [OPTIONS] [NAME]
Options
- -w, --watch#
Performs a watch.
Arguments
- NAME#
Optional argument
endpoints#
Commands for endpoints
skyshift endpoints [OPTIONS] COMMAND [ARGS]...
create#
Creates a new set of endpoints within a specified namespace, customizable via user provided arguments. This command sets up endpoints, which represent network-accessible points associated with a service. These endpoints can be configured to be exposed within a cluster and can target specific resources based on label selectors.
- Examples:
Create Endpoints with Default Settings:
skyctl create endpoints my-endpoints --num_endpoints=3
This command creates a set of endpoints named my-endpoints in the default namespace. The endpoints are not exposed to the cluster by default, and they do not have any specific label selectors targeting resources.
Create Exposed Endpoints in a Custom Cluster:
skyctl create endpoints exposed-endpoints --num_endpoints=5 --exposed --primary_cluster=clusterA
This command creates a set of endpoints named exposed-endpoints in the default namespace. The endpoints are exposed to clusterA and can be accessed from other services within that cluster. Five endpoints are created in this configuration.
Create Endpoints with Specific Label Selectors:
skyctl create endpoints labeled-endpoints --num_endpoints=2 --selector app web
This command creates a set of endpoints named labeled-endpoints in the default namespace. The endpoints are configured to target resources labeled with app=web. Two endpoints are created in this setup.
skyshift endpoints create [OPTIONS] NAME
Options
- --namespace <namespace>#
Namespace for the endpoints.
- Default:
'default'
- --num_endpoints <num_endpoints>#
Number of endpoints.
- --exposed#
Whether the endpoints are exposed to the cluster.
- --primary_cluster <primary_cluster>#
Primary cluster where the endpoints are exposed.
- Default:
'auto'
- --selector <selector>#
Selector key-value pairs.
Arguments
- NAME#
Required argument
delete#
Use the delete endpoints command to permanently remove any endpoint being managed by SkyShift.
- Examples:
Delete Endpoints from the Default Namespace:
skyctl delete endpoints my-endpoints --namespace=default
This command deletes the my-endpoints from the default namespace. Once deleted, the endpoints will no longer be available, and any resources or services associated with them will be disconnected.
Delete Endpoints from a Custom Namespace:
skyctl delete endpoints my-endpoints --namespace=production
This command deletes the my-endpoints from the production namespace. This is useful for cleaning up endpoints that are no longer needed in a specific environment or namespace.
skyshift endpoints delete [OPTIONS] NAME
Options
- --namespace <namespace>#
Namespace corresponding to service`s location.
- Default:
'default'
Arguments
- NAME#
Required argument
get#
Use the get endpoints command to fetch the details about one specific or all endpoints within a given namespace, with an optional watch functionality.
- Examples:
Fetch Details for All Endpoints:
skyctl get endpoints --namespace=default
This command fetches and displays details for all endpoints within the default namespace. It provides an overview of each set of endpoints, including their configuration, exposure status, and any associated selectors.
Fetch Details for a Specific Set of Endpoints:
skyctl get endpoints my-endpoints --namespace=default
This command fetches and displays detailed information about the my-endpoints within the default namespace. The output includes specific details such as the number of endpoints, exposure status, primary cluster, and any label selectors applied.
Watch a Specific Set of Endpoints for Changes:
skyctl get endpoints my-endpoints --namespace=default --watch
By adding the –watch flag, this command continuously monitors the my-endpoints for any changes in their details. This is useful for real-time monitoring of endpoint updates, allowing you to track changes as they occur.
skyshift endpoints get [OPTIONS] [NAME]
Options
- --namespace <namespace>#
Namespace corresponding to service`s location.
- Default:
'default'
- --watch#
Performs a watch.
Arguments
- NAME#
Optional argument
exec#
Executes a specified command within a container of a resource.
This function supports executing commands in various modes, including direct execution and TTY (interactive) mode. It is capable of targeting specific clusters, tasks (pods), and containers, providing flexibility in how commands are executed across the infrastructure. It handles both single and multiple targets with appropriate checks and balances to ensure the command execution context is correctly established.
- Examples:
Execute a Simple Command in a Resource:
skyctl exec my-pod ls /app
This command runs the ls /app command in the my-pod resource within the default namespace. The command lists the contents of the /app directory in the specified pod.
Execute a Command in a Specific Container of a Pod:
skyctl exec my-pod --containers=my-container ls /app
This command runs the ls /app command in the my-container within the my-pod resource. It targets a specific container within the pod, allowing for granular command execution.
Execute a Command with TTY (Interactive) Mode:
skyctl exec my-pod --tty bash
This command opens an interactive bash shell in the my-pod resource, enabling user interaction with the shell through a TTY (interactive) session.
skyshift exec [OPTIONS] RESOURCE COMMAND...
Options
- --namespace <namespace>#
Namespace corresponding to job’s location.
- Default:
'default'
- -t, --tasks <tasks>#
Task name where the command will be executed. This option can be repeated to specify multiple pods.
- -cts, --containers <containers>#
Container name where the command will be executed. This option can be repeated to specify multiple containers.
- -q, --quiet#
Only print output from the remote session.
- -it, -ti, --tty#
Stdin is a TTY.
Arguments
- RESOURCE#
Required argument
- COMMAND#
Required argument(s)
filterPolicy#
Commands for filterPolicy
skyshift filterPolicy [OPTIONS] COMMAND [ARGS]...
create#
The create filterPolicy
command introduces a new filter policy into SkyShift, dictating
the scheduling eligibility of clusters based on the specified inclusion and exclusion criteria.
- Examples:
Create a Filter Policy with Specific Label Selectors:
skyctl create filterPolicy my-policy -l env production -i clusterA -e clusterB
This command creates a filter policy named my-policy in the default namespace. The policy applies to resources labeled with env=production, includes clusterA and excludes clusterB during scheduling.
Create a Filter Policy in a Custom Namespace:
skyctl create filterPolicy custom-policy --namespace custom-namespace -i clusterA -i clusterB
This command creates a filter policy named custom-policy in the custom-namespace namespace. The policy includes both clusterA and clusterB in the scheduling process.
skyshift filterPolicy create [OPTIONS] NAME
Options
- --namespace <namespace>#
Namespace corresponding to policy’s location.
- Default:
'default'
- -l, --labelSelector <labelselector>#
Key-value pairs for selecting over labels.
- -i, --includeCluster <includecluster>#
Clusters to include in scheduling..
- -e, --excludeCluster <excludecluster>#
Clusters to exclude in scheduling..
Arguments
- NAME#
Required argument
delete#
Deletes the specified filter policy from the given namespace. Use this command to permanently remove the filter policy identified by the given name from the namespace.
- Examples:
Delete a Filter Policy:
skyctl delete filterPolicy my-policy --namespace=default
This command deletes the my-policy filter policy from the default namespace. Once deleted, the filter policy is permanently removed, and any scheduling rules or constraints associated with it are no longer applied.
skyshift filterPolicy delete [OPTIONS] NAME
Options
- --namespace <namespace>#
Namespace corresponding to policy’s location.
- Default:
'default'
Arguments
- NAME#
Required argument
get#
Fetches details about all or one specific filter policy within a namespace. This command provides detailed information about the specified filter policy or all policies if no name is provided. If the watch option is enabled, it continuously monitors and output updates for the policy(s).
- Examples:
Fetch Details for All Filter Policies:
skyctl get filterPolicy --namespace=default
This command fetches and displays details for all filter policies within the default namespace. It provides an overview of each policy, including its name, associated labels, and inclusion/exclusion criteria.
Fetch Details for a Specific Filter Policy:
skyctl get filterPolicy my-policy --namespace=default
This command fetches and displays detailed information about the my-policy filter policy within the default namespace. The output includes specific details such as the policy’s inclusion/exclusion clusters and label selectors.
Watch a Specific Filter Policy for Changes:
skyctl get filterPolicy my-policy --namespace=default --watch
By adding the –watch flag, this command continuously monitors the my-policy filter policy for any changes in its details. This is useful for real-time monitoring of policy updates, allowing you to track changes as they occur.
skyshift filterPolicy get [OPTIONS] [NAME]
Options
- --namespace <namespace>#
Namespace corresponding to policy’s location.
- Default:
'default'
- --watch#
Performs a watch.
Arguments
- NAME#
Optional argument
invite#
Creates a new invitation key for user registration, allowing outputting in JSON format. This command generates an invitation key that can be used for registering new users into SkyShift. It can be configured to associate specific roles with the invite, which will then be assigned to the user upon registration.
- Examples:
Create a Simple Invite:
skyctl invite
This command generates a new invitation key without any associated roles. The invite key will be printed to the console.
Create an Invite with Roles:
skyctl invite --role=admin --role=developer
This command generates an invitation key associated with the admin and developer roles. When a user registers using this invite, they will be granted the specified roles.
Create an Invite and Output in JSON Format: .. code-block:: bash
skyctl invite –json
This command generates an invitation key and outputs it in JSON format. The JSON object will include the invite key under the key ‘invite’.
skyshift invite [OPTIONS]
Options
- --json#
Output the invite in json format if succeeds. Key is ‘invite’.
- -r, --role <role>#
Enter ROLE names intended as part of the invite.
job#
Commands for job
skyshift job [OPTIONS] COMMAND [ARGS]...
create#
The create job command allows submission of a new job to SkyShift. You can also customize the specific job requirements such as Replicas, Memory, CPU and more. SkyShift matches the requirements with the available resources to best run the job. See more in`scheduling`.
- Examples:
Create a Basic Job:
skyctl create job basic-job --cpus=2 --memory=1024 --run="python script.py"
This command creates a job named basic-job with 2 CPUs and 1024 MB of memory per task. The job runs the command python script.py inside the container.
Create a GPU-Accelerated Job:
skyctl create job gpu-job --gpus=1 --accelerators=V100:1 --run="python train.py" --replicas=4
This command creates a job named gpu-job that uses 1 GPU per task, specifically an NVIDIA V100. The job will run 4 replicas of python train.py, which is useful for parallel training jobs.
Create a Job with Custom Docker Image and Environment Variables:
skyctl create job custom-job --image=tensorflow/tensorflow:latest-gpu --envs=MY_VAR=value --run="bash start.sh"
This command creates a job named custom-job using a specific Docker image (tensorflow/tensorflow:latest-gpu). It also sets the environment variable MY_VAR to value inside the container and runs bash start.sh as the job command.
Create a Long-Running Job with Specific Restart Policy:
skyctl create job long-running-job --cpus=4 --memory=2048 --run="python server.py" --restart_policy=Always
This creates a job named long-running-job with 4 CPUs and 2048 MB of memory per task. The job runs the command python server.py inside the container. The restart policy is set to Always, meaning that the job will be automatically restarted if it fails, which is ideal for long-running jobs like web servers.
Create a Batch Job with No Restart:
skyctl create job batch-job --cpus=2 --memory=1024 --run="python process_data.py" --restart_policy=Never
This creates a job named batch-job with 2 CPUs and 1024 MB of memory per task. The job runs the command python process_data.py` inside the container. The restart policy is set to Never, which means the job will not be restarted if it fails, making it suitable for batch jobs that should run once and exit.
skyshift job create [OPTIONS] NAME
Options
- --namespace <namespace>#
Namespace corresponding to job’s location.
- Default:
'default'
- -l, --labels <labels>#
Key-value pairs for job labels
- --image <image>#
Image to run the job in (any docker registry image).
- Default:
'ubuntu:latest'
- -e, --envs <envs>#
Pass in environment variables to the job.
- --cpus <cpus>#
Number of CPUs per task.
- --gpus <gpus>#
Number of GPUs per task. Note that these GPUs can be any type of GPU.
- Default:
0
- -a, --accelerators <accelerators>#
Type of accelerator resource to use (e.g. T4:1, V100:2)
- --memory <memory>#
Total memory (RAM) per task in MB.
- Default:
0
- --run <run>#
Run command for the job.
- Default:
''
- --replicas <replicas>#
Number of replicas to run job.
- Default:
1
- --restart_policy <restart_policy>#
Restart policy for job tasks.
- Default:
'Always'
- -v, --volumes <volumes>#
Volume mounts for the job.
Arguments
- NAME#
Required argument
delete#
Deletes a specified job from the given namespace. This command permanently removes the job from the specified namespace. This terminates and de-allocates any resources provisioned to the job.
- Examples:
Delete a Job from the Default Namespace:
skyctl delete job my-job --namespace=default
This command deletes the job named my-job from the default namespace. The job is terminated, and any associated resources are released.
skyshift job delete [OPTIONS] NAME
Options
- --namespace <namespace>#
Namespace corresponding to job’s location.
- Default:
'default'
Arguments
- NAME#
Required argument
get#
The get job command fetches and displays any job which was submitted to SkyShift. This provides the metadata associated for the running job. Similar to get clusters, this allows continuously watching for any changes.
- Examples:
Fetch Details for All Jobs in a Namespace:
skyctl get job --namespace=default
This command fetches and displays details for all jobs within the default namespace. It will include metadata such as the job name, status, and associated resources.
Fetch Details for a Specific Job:
skyctl get job my-job --namespace=default
This command fetches and displays details for the job named my-job in the default namespace. The output will include specific details of the job, such as its current status, start time, and resource usage.
Watch a Specific Job for Changes:
skyctl get job my-job --namespace=default --watch
By adding the –watch flag, this command continuously monitors my-job for any changes in its status or other metadata. This is useful for tracking the progress of a job in real-time.
skyshift job get [OPTIONS] [NAME]
Options
- --namespace <namespace>#
Namespace corresponding to job’s location.
- Default:
'default'
- -w, --watch#
Performs a watch.
Arguments
- NAME#
Optional argument
link#
Commands for link
skyshift link [OPTIONS] COMMAND [ARGS]...
create#
The create link
command creates a new link between two specified clusters,
enabling them to communicate directly with each other.
- Examples:
Create a Link Between Two Clusters:
skyctl create link data-link --source=clusterA --target=clusterB
This command creates a link named data-link between clusterA (the source cluster) and clusterB (the target cluster). This allows the two clusters to communicate directly, facilitating data exchange or other interactions.
skyshift link create [OPTIONS] NAME
Options
- -s, --source <source>#
Required Source cluster name
- -t, --target <target>#
Required Target cluster name
Arguments
- NAME#
Required argument
delete#
The delete link command permanently removes the link (identified by the given name) from SkyShift.
- Examples:
Delete a Specific Link:
skyctl delete link data-link
This command deletes the data-link from SkyShift. Once deleted, the communication link between the source and target clusters is permanently removed, and any operations or data flows using this link are stopped.
skyshift link delete [OPTIONS] NAME
Arguments
- NAME#
Required argument
get#
The get links
command fetches the details about one specific link or all links
between clusters which were created by SkyShift, with an optional watch functionality.
- Examples:
Fetch Details for All Links:
skyctl get link
This command fetches and displays details for all links created by SkyShift between clusters. It provides an overview of each link, including the source and target clusters and any relevant metadata.
Fetch Details for a Specific Link:
skyctl get link data-link
This command fetches and displays detailed information about the data-link link. The output includes specific details such as the source and target clusters, creation date, and current status of the link.
Watch a Specific Link for Changes:
skyctl get link data-link --watch
By adding the –watch flag, this command continuously monitors the data-link for any changes in its details. This is useful for real-time monitoring of link updates, allowing you to track changes as they occur.
skyshift link get [OPTIONS] [NAME]
Options
- -w, --watch#
Performs a watch.
Arguments
- NAME#
Optional argument
login#
Logs a user into SkyShift using a username and password. This command authenticates a user based on the provided credentials. It is important to note that this login command does not change the current active user session but merely performs login authentication.
- Examples:
Login as a User:
skyctl login myusername mypassword
This command logs in the user with the username myusername and the password mypassword. The user is authenticated based on the provided credentials, but the active user session remains unchanged.
skyshift login [OPTIONS] USERNAME PASSWORD
Arguments
- USERNAME#
Required argument
- PASSWORD#
Required argument
logs#
This command fetches and displays the logs for a specific job within a namespace. This can be useful for debugging or monitoring an on-going job.
- param str name:
The name of the job to fetch logs for.
- param str namespace:
The namespace of the job whose logs are to be fetched. Default is ‘default’.
- Examples:
Fetch Logs for a Specific Job:
skyctl logs my-job --namespace=default
This command retrieves and displays the logs for the job named my-job in the default namespace. The logs will be output directly to the console, allowing you to monitor the job’s execution or diagnose issues.
skyshift logs [OPTIONS] [NAME]
Options
- --namespace <namespace>#
Namespace corresponding to job’s namespace.
- Default:
'default'
Arguments
- NAME#
Optional argument
namespace#
Commands for namespace
skyshift namespace [OPTIONS] COMMAND [ARGS]...
create#
The create namespace command creates a new namespace within SkyShift. This command initializes a new namespace specified by the ‘name’ argument. You can use this for resource management, security and resource isolation within SkyShift.
- Examples:
Create a New Namespace:
skyctl create namespace dev-environment
This command creates a new namespace named dev-environment. SkyShift Namespaces can be used to group resources logically and enforce security and resource isolation. For example, you might create different namespaces for development, staging, and production environments.
skyshift namespace create [OPTIONS] NAME
Arguments
- NAME#
Required argument
delete#
Deletes a specified namespace from SkyShift. This command permanently removes the namespace being managed by SkyShift. Returns an error if the namespace does not exist.
Example: Delete a Namespace:
skyctl delete namespace dev-environment
This command deletes the dev-environment namespace from SkyShift. Once deleted, all resources within this namespace are also removed, and the namespace cannot be recovered. This is typically used for cleaning up environments that are no longer needed.
skyshift namespace delete [OPTIONS] NAME
Arguments
- NAME#
Required argument
get#
The get namespace
command allows fetching of details about one or all
namespaces being managed by SkyShift. This command provides detailed information
about the specified namespace or all namespaces if no name is provided. If the
watch option is enabled, it will continuously monitor and output updates for
the namespace(s).
- Examples:
Fetch Details for All Namespaces:
skyctl get namespace
This command fetches and displays details for all namespaces managed by SkyShift. It provides an overview of all available namespaces, including their status, name, and age.
Fetch Details for a Specific Namespace:
skyctl get namespace dev-environment
This command fetches and displays detailed information about the dev-environment namespace. The output includes metadata such as the namespace’s name, status and age.
Watch a Specific Namespace for Changes:
skyctl get namespace dev-environment --watch
skyshift namespace get [OPTIONS] [NAME]
Options
- -w, --watch#
Performs a watch.
Arguments
- NAME#
Optional argument
port-forward#
Forward one or more local ports to a resource. This command allows you to forward local ports to a resource managed by SkyShift, similar to the kubectl port-forward command, but for SkyShift managed resources. You can specify the resource, ports to forward, and optionally the Kubernetes context and namespace.
Examples:
Forward a Local Port to a Resource in a Specific Context and Namespace:
skyctl port-forward pod/my-pod 8080:80 --namespace my-namespace --manager=k8 --context my-k8s-context Forwarding from 127.0.0.1:8080 -> 8080 Forwarding from [::1]:8080 -> 8080 ⠹ Started port-forwardingThis command forwards local port 8080 to port 80 on the pod my-pod in the my-namespace namespace, using the Kubernetes context my-k8s-context.
Forward Multiple Ports to a Service Without Specifying Context:
skyctl port-forward service/my-service 8080:80 8443:443 --manager=k8This command forwards local ports 8080 and 8443 to ports 80 and 443 on the service my-service in the default namespace, using the default Kubernetes context.
Note:
The –manager option is required and must be set for Kubernetes resources.
The –context option is optional. If provided, it specifies the Kubernetes context to use for port forwarding.
The –namespace option specifies the namespace of the resource. Defaults to ‘default’ if not provided.
skyshift port-forward [OPTIONS] RESOURCE PORTS...
Options
- --namespace <namespace>#
Namespace corresponding to the resource’s location.
- Default:
'default'
- --manager <manager>#
Required Resource manager type (e.g., ‘k8’). Only ‘k8’ is supported.
- --context <context>#
Kubernetes context to use for port forwarding.
Arguments
- RESOURCE#
Required argument
- PORTS#
Required argument(s)
register#
The register command registers a new user in the system within SkyShift based on an invitation.
Username should be 4-50 characters long composed of upper or lower case alphabetics, digits and/or _. Password must be 5 or more characters.
This command allows for the registration of a new user account, which is necessary for accessing and interacting with the system. It requires a username, password, and an invite key, to ensure that only authorized users can register.
- Examples:
Register a New User:
skyctl register newuser mypassword --invite=abcd1234 --email=newuser@example.com
This command registers a new user with the username newuser and the password mypassword. The user is validated using the invite key abcd1234 and the email address newuser@example.com is associated with the account for notifications and recovery.
skyshift register [OPTIONS] USERNAME PASSWORD
Options
- -inv, --invite <invite>#
Required Invite key sent by admin.
- --email <email>#
Email address of the user.
Arguments
- USERNAME#
Required argument
- PASSWORD#
Required argument
revoke_invite#
The revoke invite command allows revoking an existing invitation key. This means the user will not be able to use it in the future for registering and account with SkySfhit.
Examples:
Revoke an Invitation Key:
skyctl revoke_invite abcd1234
This command revokes the invitation key abcd1234. After revocation, the key is invalid, and any attempt to use it for registration will fail.
skyshift revoke_invite [OPTIONS] INVITE
Arguments
- INVITE#
Required argument
role#
Commands for role
skyshift role [OPTIONS] COMMAND [ARGS]...
create#
Creates a new role with specified permissions and access controls within SkyShift. This is highly customizable and allows access management for organizations where multiple users, namespaces and resources are involved.
- Examples:
Create a Role with Specific Actions and Resources:
skyctl create role admin-role --action=create --action=delete --resource=pods --resource=services
This command creates a role named admin-role that grants permissions to create and delete pods and services. The role can be assigned to users or applied within specific namespaces as needed.
Create a Role with Namespace Restrictions:
skyctl create role dev-role --action=view --resource=pods --namespace=dev
This command creates a role named dev-role that grants permission to view pods only within the dev namespace. This is useful for limiting the scope of access for users who only need to manage resources in specific environments.
Create a Role and Assign it to Users:
skyctl create role team-lead --action=manage --resource=deployments --users=user1 --users=user2
This command creates a role named team-lead that grants the ability to manage deployments. The role is then assigned to user1 and user2, giving them the permissions defined by the role.
skyshift role create [OPTIONS] NAME
Options
- -a, --action <action>#
List of actions for the role.
- -r, --resource <resource>#
List of resources for the role.
- -n, --namespace <namespace>#
List of namespaces for the role.
- -u, --users <users>#
List of users for the role.
Arguments
- NAME#
Required argument
delete#
Deletes a specified role from SkyShift. Immediately revokes the role and associated permissions.
- Examples:
Delete a Specific Role:
skyctl delete role admin-role
This command deletes the admin-role from SkyShift. Once deleted, all permissions and access controls associated with this role are revoked, and the role can no longer be assigned to users.
skyshift role delete [OPTIONS] NAME
Arguments
- NAME#
Required argument
get#
The get roles command fetches the roles created in SkyShift and associated permissions/metadata. This also allows continuous monitoring to the role if watch is enabled.
- Examples:
Fetch Details for All Roles:
skyctl get role
This command fetches and displays details for all roles created in SkyShift. It provides an overview of each role, including its name, associated permissions, resources, namespaces, and users.
Fetch Details for a Specific Role:
skyctl get role admin-role
This command fetches and displays detailed information about the admin-role. The output includes specific details such as the actions permitted by the role, the resources it controls, the namespaces where it applies, and the users assigned to it.
Watch a Specific Role for Changes:
skyctl get role admin-role --watch
By adding the –watch flag, this command continuously monitors the admin-role for any changes in its details. This is useful for real-time monitoring of role updates, allowing you to track changes as they occur.
skyshift role get [OPTIONS] [NAME]
Options
- -w, --watch#
Performs a watch.
Arguments
- NAME#
Optional argument
service#
Commands for service
skyshift service [OPTIONS] COMMAND [ARGS]...
create#
“
The create service command creates a new service within SkyShift. You can customize this for specific namespaces, specific service types, selectors, ports and clusters.
- Examples:
Create a Basic ClusterIP Service:
skyctl create service my-service --namespace=default --service_type=ClusterIP --ports 80 8080
This command creates a service named my-service in the default namespace. The service is of type ClusterIP and maps port 80 to 8080 on the target pods. This service will be available only within the cluster.
Create a LoadBalancer Service with Selectors:
skyctl create service my-service -t LoadBalancer -s app web -p 80 8080
This command creates a LoadBalancer service named my-service. The service will select pods labeled with app=web and expose ports 80 and 443, forwarding them to 8080 and 8443 on the target pods, respectively. This service will be accessible from outside the cluster.
Create a Service in a Custom Cluster:
skyctl create service custom-service --namespace=default --cluster clusterA --ports 80 8080
This command creates a service named custom-service in the default namespace, but it will be exposed on clusterA. The service maps port 80 to 8080 on the target pods and will be available within clusterA.
skyshift service create [OPTIONS] NAME
Options
- --namespace <namespace>#
Namespace corresponding to service’s location.
- Default:
'default'
- -t, --service_type <service_type>#
Type of service.
- Default:
'NodePort'
- -s, --selector <selector>#
Label selectors.
- -p, --ports <ports>#
Port pairs for service (<port>:<containerPort/targetPort>). Defaults to TCP connection.
- -c, --cluster <cluster>#
Cluster to expose service on.
- Default:
'auto'
Arguments
- NAME#
Required argument
delete#
Deletes a specified service from the given namespace. This command permanently removes the service identified by the given name from the specified namespace.
- Examples:
Delete a Service from the Default Namespace:
skyctl delete service my-service --namespace=default
This command deletes the my-service from the default namespace. Once deleted, the service will no longer be available, and any connections or resources associated with it will be terminated.
Delete a Service from a Custom Namespace:
skyctl delete service my-service --namespace=production
This command deletes the my-service from the production namespace. This is useful for cleaning up services that are no longer needed in a specific environment or namespace.
skyshift service delete [OPTIONS] NAME
Options
- --namespace <namespace>#
Namespace corresponding to service`s location.
- Default:
'default'
Arguments
- NAME#
Required argument
get#
The get service command fetches the details about one specific or all services within a given namespace, with an optional watch functionality.
- Examples:
Fetch Details for All Services:
skyctl get service --namespace=default
This command fetches and displays details for all services within the default namespace. It provides an overview of each service, including its type, connected pods, port configurations, and other relevant metadata.
Fetch Details for a Specific Service:
skyctl get service my-service --namespace=default
This command fetches and displays detailed information about the my-service within the default namespace. The output includes specific details such as the service type, connected pods, port configurations, and current status.
Watch a Specific Service for Changes:
skyctl get service my-service --namespace=default --watch
By adding the –watch flag, this command continuously monitors the my-service for any changes in its details. This is useful for real-time monitoring of service updates, allowing you to track changes as they occur.
skyshift service get [OPTIONS] [NAME]
Options
- --namespace <namespace>#
Namespace corresponding to service`s location.
- Default:
'default'
- --watch#
Performs a watch.
Arguments
- NAME#
Optional argument
status#
The status command displays the current status of clusters, available resources, and recent jobs in SkyShift.
This command provides the following: - The total available resources of clusters in the ‘READY’ state. - A list of the newest 10 running jobs. Useful for monitoring and administration.
Example: .. code-block:: bash
skyctl status
This command displays the status of all clusters in SkyShift, including the total available resources in clusters that are in the ‘READY’ state. It also lists the newest 10 running jobs, giving a snapshot of the system’s current activity.
skyshift status [OPTIONS]
use-context#
Commands for use-context
skyshift use-context [OPTIONS] COMMAND [ARGS]...
config#
Switches the current active context in SkyShift to the specified one. This command allows the user to change the active configuration context to another one as specified in the ‘.skyconf/config.yaml’ file. This is useful for managing different configurations under the same CLI session.
- Examples:
Switch to a Different Context:
skyctl config use-context dev-environment
This command switches the active context to dev-environment. The new context configuration is loaded, and all subsequent commands will use this context until it is changed again.
skyshift use-context config [OPTIONS] NAME
Arguments
- NAME#
Required argument
user#
Commands for user
skyshift user [OPTIONS] COMMAND [ARGS]...
delete#
skyshift user delete [OPTIONS] USERNAME
Arguments
- USERNAME#
Required argument
users#
Commands for users
skyshift users [OPTIONS] COMMAND [ARGS]...
get#
skyshift users get [OPTIONS]