Up and Running
Want to quickly get a feel of Namespace? We have assembled three super-simple guides to get you started in no time. To get started, pick one of the following journeys:
Installation
Download the nsc
CLI.
$ curl -fsSL https://get.namespace.so/cloud/install.sh | sh
Login to your Namespace account.
$ nsc login
Ephemeral Kubernetes Cluster
Need to quickly test your Kubernetes deployment? Create an ephemeral cluster with Namespace to get a fresh, isolated environment.
$ nsc create
Created cluster "7te0imdnud59s"
That’s it! Within seconds, your cluster is created and ready to use.
To interact with the cluster, we’ll ask nsc
to generate a kubeconfig.
$ nsc kubeconfig write <id>
Wrote Kubeconfig for cluster <id> to <tmp/kubeconfig.yaml>.
Start using it by setting:
export KUBECONFIG=<tmp/kubeconfig.yaml>
And then deploy your application with your regular kubectl
.
$ export KUBECONFIG=<tmp/kubeconfig.yaml>
$ kubectl apply -f https://k8s.io/examples/application/nginx-app.yaml
service/my-nginx-svc created
deployment.apps/my-nginx created
Alternatively, nsc
can download and configure kubectl
for you.
nsc
can help you test your application even beyond kubectl. For full-power debugging, you can jump into a root shell from your CLI.
$ nsc ssh <id>
# And inside the cluster:
$ apk add curl
$ curl 10.0.1.1
<!DOCTYPE html>
<html>...</html>
Namespace also extracts cluster logs automatically so you can fetch them even after the cluster has been destroyed.
$ nsc logs <id>
2023-04-25T09:40:42Z "GET / HTTP/1.1" 200 612 "-" "curl/7.88.1" "-"
Development Preview
Want to quickly show your app to a colleague? Use Namespace to run ephemeral application previews.
To get started, navigate to the root directory of your application, or clone our tiny example.
$ git clone git@github.com:namespacelabs/nsc-go-app.git && cd nsc-go-app
Since we want to run the app in the cloud, let’s also build and push the image remotely. The container image will be pushed to the Workspace container registry.
$ nsc build . --name nsc-go-app:v0.0.1 --push
Pushed for linux/amd64:
nscr.io/<workspace-id>/nsc-go-app:v0.0.1
Finally, we run the app in a shareable preview.
$ nsc run --image nscr.io/<workspace-id>/nsc-go-app:v0.0.1 -p 80
Created new ephemeral environment! (id: jqv4dr5skm83g).
More at: https://cloud.namespace.so/<workspace-id>/cluster/jqv4dr5skm83g
Running "nginx-u8uuq"
Exported 80/tcp as https://sdf6sig-jqv4dr5skm83g.fra1.nscluster.cloud
The first link (cloud.namespace.so) brings you to the Namespace Dashboard, allowing you to inspect application logs, or jump into SSH, all within your browser.
![Namespace Web UI](/_next/image?url=%2F_next%2Fstatic%2Fmedia%2Fweb-ui.c8ddf6c6.png&w=1920&q=75)
The second link (nscluster.cloud) provides a live preview of your application. The preview requires login and is only accessible to members of your workspace.
![Namespace Preview Authentication](/_next/image?url=%2F_next%2Fstatic%2Fmedia%2Fpreview-auth.10475950.png&w=1920&q=75)
Full-power Web UI
On the go and want to quickly poke at Kubernetes? Create a cluster and jump into action, all from within your browser.
- Open the dashboard at https://cloud.namespace.so/
- On the top right, hit “Create Instance.
- After a few seconds, the “New SSH session” button becomes active. Click it!
- Now, your sitting in the cluster with a preconfigured
kubectl
. Give it a spin with:
$ kubectl apply -f https://k8s.io/examples/application/nginx-app.yaml
![Namespace Cluster SSH terminal](/_next/image?url=%2F_next%2Fstatic%2Fmedia%2Fcluster-ssh.2e220df1.png&w=1920&q=75)