Skip to content

Instantly share code, notes, and snippets.

@moondev
Last active July 16, 2023 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moondev/8cdea612470d88cb92cb579547eb9d99 to your computer and use it in GitHub Desktop.
Save moondev/8cdea612470d88cb92cb579547eb9d99 to your computer and use it in GitHub Desktop.
k8s diagram markup examples

k8s diagram markup examples

go run gists.github.com/moondev/8cdea612470d88cb92cb579547eb9d99.git@latest
go run gists.github.com/moondev/8cdea612470d88cb92cb579547eb9d99@latest
go run gists.github.com/moondev/8cdea612470d88cb92cb579547eb9d99@main
git config --global url.git@github.com:.insteadOf https://github.com/
git config --global url.git@gist.github.com:.insteadOf https://gist.github.com/

git clone https://gist.github.com/moondev/8cdea612470d88cb92cb579547eb9d99
git clone git@gist.github.com:8cdea612470d88cb92cb579547eb9d99.git
git config url."https://gist.github.com/".insteadOf ssh://git@gist.github.com/
https://gist.github.com/StevenACoffman/866b06ed943394fbacb60a45db5982f2
docker run --rm -i dcr.lb.run/hub/golang:1.21rc2-bookworm go run gists.github.com/moondev/8cdea612470d88cb92cb579547eb9d99.git@main
go run gists.github.com/moondev/8cdea612470d88cb92cb579547eb9d99.git@main
module gists.github.com/moondev/8cdea612470d88cb92cb579547eb9d99.git
go 1.20
require github.com/urfave/cli/v2 v2.25.7
require (
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
)
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/urfave/cli/v2 v2.25.7 h1:VAzn5oq403l5pHjc4OhD54+XGO9cdKVL/7lDjF+iKUs=
github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
package main
import (
"fmt"
"log"
"os"
"github.com/urfave/cli/v2"
)
func main() {
app := &cli.App{
UseShortOptionHandling: true,
Commands: []*cli.Command{
{
Name: "short",
Usage: "complete a task on the list",
Flags: []cli.Flag{
&cli.BoolFlag{Name: "serve", Aliases: []string{"s"}},
&cli.BoolFlag{Name: "option", Aliases: []string{"o"}},
&cli.StringFlag{Name: "message", Aliases: []string{"m"}},
},
Action: func(cCtx *cli.Context) error {
fmt.Println("serve:", cCtx.Bool("serve"))
fmt.Println("option:", cCtx.Bool("option"))
fmt.Println("message:", cCtx.String("message"))
return nil
},
},
},
}
if err := app.Run(os.Args); err != nil {
log.Fatal(err)
}
}
interpreter: go run mvdan.cc/sh/v3/cmd/gosh@v3.7.0 -c
tasks:
init:
run:
- neofetch
options:
input:
short: i
---
apiVersion: 8cdea612470d88cb92cb579547.moondev.gists.github.com/main
kind: DiagramIcon
metadata:
name: cluster
tags:
8cdea612470d88cb92cb579547
my-cluster-a: "" {
img: "" {
icon: https://github.com/ExamProCo/Kubernetes-Architecture-Icons/raw/main/icons/svg/cluster.svg
label: my-cluster-a
shape: image
style.font-color: "#397bff"
}
}
my-cluster-b: "" {
img: "" {
icon: https://github.com/ExamProCo/Kubernetes-Architecture-Icons/raw/main/icons/svg/cluster.svg
label: my-cluster-b
shape: image
style.font-color: "white"
}
}
my-cluster-c: "" {
style.fill: "#326ce5"
img: "" {
icon: https://github.com/ExamProCo/Kubernetes-Architecture-Icons/raw/main/icons/svg/cluster.svg
label: my-cluster-b
shape: image
style.font-color: "white"
}
}
my-cluster-d: "" {
txt: "" {
label: my-cluster-d
style.fill: "#d9e8ff"
style.stroke-width: 0
style.font-size: 10
height: 100
width: 100
}
style.fill: "#326ce5"
img: "" {
icon: https://github.com/ExamProCo/Kubernetes-Architecture-Icons/raw/main/icons/svg/cluster.svg
label: my-cluster-b
shape: image
style.font-color: "white"
width: 50
height: 50
top: 0
left: 0
}
width: 500
style.3d: false
style.shadow: true
style.multiple: false
}
outside: "" {
inside: "" {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment