Registry

Logging in with

docker login registry.digitalocean.com  # then enter the token as both username and pasword
# then
docker tag heartexlabs/label-studio:latest registry.digitalocean.com/jak/label-studio
# and then
docker push registry.digitalocean.com/jak/label-studio

doctl

doctl is the official DigitalOcean command-line client. It uses the DigitalOcean API to provide access to most account and Droplet features.

Install

sudo snap install doctl

To run doctl

snap run doctl

create an alias ~/.bash_aliases

alias doctl="snap run doctl"

Token

Token can be created from the url, personal token generated from here is used to with “auth init” command.

Auth and –context

doctl auth init # or
doctl auth init  --context jak # to login with another account
# enter the token

argument “–context” is used to allow access to multiple digitalocean accounts.

Remove and switch

use “doctl auth remove –context jak” and “doctl auth switch –context jak” to remove and switch the context respectively.

kubernetes or DigitalOcean on (DOKS)

doctl k # to see sub commands
# e.g.
doctl k cluster get k8s-1-21-5-do-0-blr1-1640627029506

using kubectl command to interact with digitalocean cluster

from the url download the config file

Pointing to external cluster

  • using –kubeconfig

    kubectl get nodes --kubeconfig=/home/jaavedkhan/.kube/k8s-1-21-5-do-0-blr1-1640627029506-kubeconfig.yaml
    
  • using env variable

    export KUBECONFIG=/home/jaavedkhan/.kube/k8s-1-21-5-do-0-blr1-1640627029506-kubeconfig.yaml
    kubectl get nodes
    
  • logout

    
    

Making apps available on internet from digital ocean cluster

ref: youtube

  • exposing to internet using

    create a service of type LoadBalancer

    After creating this service or applying the manifest file

  • Using to expose service

    1. make the services as “LoadBalancer” type will automatically creates a in DigitalOcean with a public IP.

doctl command details

more details here

doctl is a command line interface (CLI) for the DigitalOcean API.

Usage:
  doctl [command]

Available Commands:
  1-click         Display commands that pertain to 1-click applications
  account         Display commands that retrieve account details
  apps            Display commands for working with apps
  auth            Display commands for authenticating doctl with an account
  balance         Display commands for retrieving your account balance
  billing-history Display commands for retrieving your billing history
  completion      generate the autocompletion script for the specified shell
  compute         Display commands that manage infrastructure
  databases       Display commands that manage databases
  help            Help about any command
  invoice         Display commands for retrieving invoices for your account
  kubernetes      Displays commands to manage Kubernetes clusters and configurations
  monitoring      [Beta] Display commands to manage monitoring
  projects        Manage projects and assign resources to them
  registry        Display commands for working with container registries
  version         Show the current version
  vpcs            Display commands that manage VPCs

Flags:
  -t, --access-token string   API V2 access token
  -u, --api-url string        Override default API endpoint
  -c, --config string         Specify a custom config file (default "/home/jaavedkhan/.config/doctl/config.yaml")
      --context string        Specify a custom authentication context name
  -h, --help                  help for doctl
  -o, --output string         Desired output format [text|json] (default "text")
      --trace                 Show a log of network activity while performing a command
  -v, --verbose               Enable verbose output

Use "doctl [command] --help" for more information about a command.

OneClick installation from market place

kube-prometheus-stack

https://marketplace.digitalocean.com/apps/kubernetes-monitoring-stack

kubectl get secrets -n kube-prometheus-stack kube-prometheus-stack-grafana -o jsonpath=".data.admin-password" | base64 --decode