A Kubernates Cloud-Shell (Web Terminal) Operator

Overview

A Kubernates Cloud-Shell (Web Terminal) Operator.

English | Simplified_Chinese

Why cloudtty ?

Existing project ttyd already provides great feature to share terminal over the web. But Kubernetes cloud native enviroment requires a way to run web-tty via kubernetes way ( running as pod, and generated by CRD). So you can try cloudtty.

SPECIAL THANKS

This project is based on https://github.com/tsl0922/ttyd. Many thanks to tsl0922 yudai and the community. The frontend UI code was originated from ttyd project, and the ttyd binary inside the container also comes from ttyd project.

screenshot_png

screenshot_gif

Usage Guide

Step 1: Install Operator and CRD

helm repo add daocloud  https://release.daocloud.io/chartrepo/cloudshell
helm install --version 0.0.2 daocloud/cloudshell --generate-name

Step 2: Create kube.conf configmap for target cluster (This step will be refined, when the target cluster is the same one this operators runs on)

kubectl create configmap my-kubeconfig --from-file=/root/.kube/config

# Be careful to ensure the /root/.kube/config:
#  1. contains the base64 encoded certs/secrets instead of local files.
#  2. the k8s api-server endpoint is reachable(host IP or cluster IP) instead of localhost

Step 3: Create a cloud-tty instance by applying CR, then monitor its status

kubectl apply -f ./config/samples/webtty_v1alpha1_cloudshell.yaml  && kubectl get cloudshell -w

More will be coming Soon.

Developer Guide

Comments
  • The input window is too small

    The input window is too small

    image

    Hi, we build an addon for KubeVela based on this project and provides the CloudShell feature.

    A very experience-impairing problem here is that the input window is too small, as the picture shows.

    opened by barnettZQG 8
  • Disable mount hosted cluster's service account

    Disable mount hosted cluster's service account

    This will bring several benefits.

    1. the authentication information of the host cluster will not be sensed inside CloudShell Pod (in some cases, some permissions may be configured for the default SA).
    2. The Namespace where the current instance is located is not sensed in CloudShell.
    opened by kebe7jun 7
  • Request the token with the window.location.search

    Request the token with the window.location.search

    https://github.com/cloudtty/cloudtty/blob/40f8e3c357f7321f547ca813454af361c4d07e7a/html/src/components/app.tsx#L14

    Issue Reference: https://github.com/kubevela/kubevela/issues/5005

    In our use case, the request token of the proxy server is in the window.location.search, without it the request is denied.

    BTW, The Cloudtty instance works without the token.

    issue/stale 
    opened by barnettZQG 5
  • The

    The "dev guide is not working" any more

    After make run, then apply the sample CR, it failed with KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined

    {"controller": "cloudshell", "controllerGroup": "cloudshell.cloudtty.io", "controllerKind": "CloudShell", "cloudShell": {"name":"local-cluster-sample","namespace":"default"}, "namespace": "default", "name": "local-cluster-sample", "reconcileID": "848b38e1-3e8e-40e0-a3ed-47843ceb2581"}
    1.6611414647583098e+09  ERROR   Reconciler error        {"controller": "cloudshell", "controllerGroup": "cloudshell.cloudtty.io", "controllerKind": "CloudShell", "cloudShell": {"name":"local-cluster-sample","namespace":"default"}, "namespace": "default", "name": "local-cluster-sample", "reconcileID": "848b38e1-3e8e-40e0-a3ed-47843ceb2581", "error": "unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined", "errorVerbose": "unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined
    github.com/cloudtty/cloudtty/controllers.GenerateKubeconfigInCluster
    \t/root/cloudtty/controllers/cloudshell_controller.go:730
    github.com/cloudtty/cloudtty/controllers.(*CloudShellReconciler).CreateCloudShellJob
    \t/root/cloudtty/controllers/cloudshell_controller.go:213
    github.com/cloudtty/cloudtty/controllers.(*CloudShellReconciler).Reconcile
    \t/root/cloudtty/controllers/cloudshell_controller.go:119
    sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile
    \t/root/work/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:121
    sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
    \t/root/work/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:320
    sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
    \t/root/work/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:273
    sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
    \t/root/work/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:234
    runtime.goexit
    
    issue/stale 
    opened by panpan0000 5
  • Shoud we use the github container registry

    Shoud we use the github container registry

    Shoud we use the github container registry as a OSS project: ghcr.io

    https://github.com/cloudtty/cloudtty/blob/74e167f457dac6a751d2cdbdaeef0a9f665ccc4d/Makefile#L2

    opened by yankay 5
  • upgrade cmd to cobra

    upgrade cmd to cobra

    Signed-off-by: calvin [email protected]

    /kind feature

    upgrade our cmd to cobra.

    • add --verion --kubeconfig and more ElectionLease options.
    • replace log to klog
    opened by calvin0327 4
  • add featuregate to support storing kubeconfig in secret

    add featuregate to support storing kubeconfig in secret

    Signed-off-by: calvin0327 [email protected]

    fixed: https://github.com/cloudtty/cloudtty/issues/90

    We add a featuregate AllowSecretStoreKubeconfig to support using secret to store kubeconfig. As there are some user have using our project, so the featuregate is alpha pahse currently. we plan to upgrade it to beta phase at v0.5.0 version and disable configmap at the same time and remove configmap at v0.6.0 version.

    feature 
    opened by calvin0327 3
  • Can cloudtty enter the debug pod through kubectl debug command

    Can cloudtty enter the debug pod through kubectl debug command

    Through the kubectl debug command, start a container dedicated to debugging and attach it to the destination container, so that the debugging container can have more built-in command-line tools for troubleshooting

    https://kubernetes.io/docs/tasks/debug/debug-application/debug-running-pod/

    issue/stale 
    opened by wawa0210 3
  • add image field to cloudshell crd

    add image field to cloudshell crd

    Signed-off-by: calvin0327 [email protected]

    /kind feature

    fixed: https://github.com/cloudtty/cloudtty/issues/124

    • add image field to cloudshell crd
    • Optimized cloudshell ready time
    opened by calvin0327 2
  • No support Multiple custom images??   Consider increasing a field of CRD:   `image`

    No support Multiple custom images?? Consider increasing a field of CRD: `image`

    only found one method to define custom image config, and then no supported multiple custom images

    helm install cloudtty-operator --version 0.3.0 daocloud/cloudtty --set jobTemplate.image.registry=</REGISTRY> --set jobTemplate.image.repository=</REPOSITORY> --set jobTemplate.image.tag=</TAG>
    

    Suggestion: in CloudShell CRD add a field :image

    spec:
      image: 
          registry: test.io
          repository:  custom-image
          tag: v1.0.0
    
    feature 
    opened by nicole-lihui 2
  • Build multiple platform images by Github Action buildin Steps

    Build multiple platform images by Github Action buildin Steps

    to address https://github.com/cloudtty/cloudtty/issues/41

    Thanks to @barnettZQG

    I'm not familiar with github action, and there's no confident about this code , so I keep the old make command by purpose until the new code has run well.

    opened by panpan0000 2
  • Bump helm/chart-releaser-action from 1.4.0 to 1.5.0

    Bump helm/chart-releaser-action from 1.4.0 to 1.5.0

    Bumps helm/chart-releaser-action from 1.4.0 to 1.5.0.

    Release notes

    Sourced from helm/chart-releaser-action's releases.

    v1.5.0

    What's Changed

    New Contributors

    Full Changelog: https://github.com/helm/chart-releaser-action/compare/v1...v1.5.0

    v1.4.1

    What's Changed

    Full Changelog: https://github.com/helm/chart-releaser-action/compare/v1.4.0...v1.4.1

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 0
  • Bump k8s.io/apimachinery from 0.25.1 to 0.26.0

    Bump k8s.io/apimachinery from 0.25.1 to 0.26.0

    Bumps k8s.io/apimachinery from 0.25.1 to 0.26.0.

    Commits
    • 5d4cdd2 Merge remote-tracking branch 'origin/master' into release-1.26
    • 6cbc4a3 Update golang.org/x/net 1e63c2f
    • 6561235 Merge pull request #113699 from liggitt/manjusaka/fix-107415
    • dad8cd8 Update workload selector validation
    • fe82462 Add extra value validation for matchExpression field in LabelSelector
    • 067949d update k8s.io/utils to fix util tracing panic
    • 0ceff90 Merge pull request #112223 from astraw99/fix-ownerRef-validate
    • 9e85d3a Merge pull request #112649 from howardjohn/set/optimize-everything-nothing
    • 88a1448 Rename and comment on why sharing is safe
    • b03a432 Merge pull request #113367 from pohly/dep-ginkgo-gomega
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies go 
    opened by dependabot[bot] 0
  • remove `node-shell` tool from cloudshell image

    remove `node-shell` tool from cloudshell image

    Remove node-shell tool from cloudshell image due to:

    • the tools is dengerous for cluster
    • the image is to large, we should reduce the size of the cloudshell image

    We can give a sample to build node-shell tool to cloudshell image.

    good first issue 
    opened by calvin0327 1
  • Bump actions/stale from 6.0.1 to 7.0.0

    Bump actions/stale from 6.0.1 to 7.0.0

    Bumps actions/stale from 6.0.1 to 7.0.0.

    Release notes

    Sourced from actions/stale's releases.

    v7.0.0

    ⚠️ This version contains breaking changes ⚠️

    What's Changed

    Breaking Changes

    • In this release we prevent this action from managing the stale label on items included in exempt-issue-labels and exempt-pr-labels
    • We decided that this is outside of the scope of this action, and to be left up to the maintainer

    New Contributors

    Full Changelog: https://github.com/actions/stale/compare/v6...v7.0.0

    Changelog

    Sourced from actions/stale's changelog.

    [7.0.0]

    :warning: Breaking change :warning:

    Commits
    • 6f05e42 draft release for v7.0.0 (#888)
    • eed91cb Update how stale handles exempt items (#874)
    • 10dc265 Merge pull request #880 from akv-platform/update-stale-repo
    • 9c1eb3f Update .md files and allign build-test.yml with the current test.yml
    • bc357bd Update .github/workflows/release-new-action-version.yml
    • 690ede5 Update .github/ISSUE_TEMPLATE/bug_report.md
    • afbcabf Merge branch 'main' into update-stale-repo
    • e364411 Update name of codeql.yml file
    • 627cef3 fix print outputs step (#859)
    • 975308f Merge pull request #876 from jongwooo/chore/use-cache-in-check-dist
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 0
Releases(cloudtty-0.5.1)
Owner
cloudtty-io
cloudtty-io
Bitcoin terminal tracker is a terminal app which allow you to track bitcoin price from your terminal

BTC Terminal Tracker Bitcoin terminal tracker is a terminal app which allow you to track bitcoin price from your terminal. In this version (V1.2) I ch

Sina yeganeh 9 Jul 27, 2022
Chat with GPT from the terminal, with the ability to execute shell scripts.

ChatSH Chat with GPT from the terminal, and let it execute shell scripts and perform tasks for you. What could go wrong? Example Why? The reason I'm p

Victor Taelin 47 Jun 11, 2023
A very simple tool that generates multiple spellings of a phone number (to effectively search for it using the OR operator and quotes)

phonenumberqueryconstructor A very simple tool that generates multiple writings of a phone number (to effectively search for it using the OR operator

Cyb_detective 10 Dec 7, 2022
Dark theme for VSCode with italics support (good for Dank Mono, Operator Mono)

Omni Owl for Visual Studio Code Dark theme for Visual Studio Code (with Italics) Install • Team • Imitate Preview • License Install All instructions c

Guilherme Rodz 59 Dec 23, 2022
The operator CLI for CDK apps.

cdk-app The operator CLI for CDK apps. Experimental. cdk-app lets you associate commands with CDK constructs so that you can quickly invoke functions,

CDK Labs at AWS 42 Dec 8, 2022
Trivy-Operator Lens Extension

Trivy-Operator Lens Extension This is a Lens extension for trivy-operator which provides visibility into vulnerability,misconfiguration and secrets as

Aqua Security 18 Dec 5, 2022
🦕 An opposite function of nullish coalescing operator

unnullish unnullish returns undefined if value is nullish, otherwise it executes callback and returns the result. It is an opposite function of the nu

Alisue 15 Dec 15, 2022
ESLint plugin to disallow the optional-call operator

ESLint Plugin: no-optional-call Overview The no-optional-call ESLint plugin provides a single rule (non-configurable) that disallows any usage of the

Kyle Simpson 15 Sep 24, 2022
This is a project that is used to execute python codes in the web page. You can install and use it in django projects, You can do any operations that can be performed in python shell with this package.

Django execute code This is a project that is used to execute python codes in the web page. You can install and use it in django projects, You can do

Shinu 5 Nov 12, 2022
X-Platform bind shell in TypeScript!

F11 - Fully Featured Bind Shell The SnipeSocket EST. Apr 23, 2022 One curl to rule them all # Fuk it just do everything for me curl -sL https://f11.sh

F11snipe 25 Dec 10, 2022
A WASM shell parser and formatter with bash support, based on mvdan/sh

sh-syntax A WASM shell parser and formatter with bash support, based on mvdan/sh TOC Usage Install API Changelog License Usage Install # yarn yarn add

RxTS 7 Jan 1, 2023
Soothing pastel theme for Blink Shell

Catppuccin for Blink Shell Usage Navigate to the .js file with the theme of your choosing. Copy the URL. Open the settings panel in Blink Shell using

Catppuccin 9 Dec 23, 2022
A simple menubar app for GNOME Shell that tracks how long you've been using your computer uninterruptedly

Welcome to Since Indicator ?? ?? Homepage Since Indicator is a simple menubar app for GNOME Shell that tracks how long you've been using your computer

Lorenzo Carbonell 3 Oct 20, 2022
Cross platform shell tools for Deno inspired by zx.

dax Note: This is very early stages. Just started working on it. Cross platform shell tools for Deno inspired by zx. Differences: No globals or global

David Sherret 150 Dec 31, 2022
Cross platform shell tools for Deno inspired by zx.

dax Note: This is very early stages. Just started working on it. Cross platform shell tools for Deno inspired by zx. Differences: No globals or global

David Sherret 45 Jul 24, 2022
zx inspired shell for Bun/Node.

?? bnx zx inspired shell for Bun/Node. Install bun add bnx # npm install bnx Usage import { $ } from 'bnx' const list = $`ls -l` const files = list.

Robert Soriano 50 Oct 16, 2022
Demo running web assembly apps a terminal with blocking stdin/stdout/stderr

Python wasm-terminal Live version here: https://wasm-terminal.firebaseapp.com/ This is a small demo of running Python in the browser with a focus on i

Katie Bell 16 Nov 16, 2022
jQuery Terminal Emulator - JavaScript library for creating web-based terminals with custom commands

JavaScript Library for Web Based Terminal Emulators Summary jQuery Terminal Emulator is a plugin for creating command line interpreters in your applic

Jakub T. Jankiewicz 2.8k Jan 1, 2023
Cloud security platform web with steampipe

cloud-security-platform-web-with-steampipe Home Tech Stacks Node.js + MongoDB + Steampipe Usage If you use ec2, no need credentils, config files. $ cd

rex 5 May 13, 2022