@vfarcic/dot-ai 0.103.0 → 0.105.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -1
- package/dist/core/ai-provider-factory.d.ts +90 -0
- package/dist/core/ai-provider-factory.d.ts.map +1 -0
- package/dist/core/ai-provider-factory.js +187 -0
- package/dist/core/ai-provider.interface.d.ts +116 -0
- package/dist/core/ai-provider.interface.d.ts.map +1 -0
- package/dist/core/ai-provider.interface.js +14 -0
- package/dist/core/capabilities.d.ts +3 -3
- package/dist/core/capabilities.d.ts.map +1 -1
- package/dist/core/capabilities.js +4 -4
- package/dist/core/capability-scan-workflow.d.ts.map +1 -1
- package/dist/core/capability-scan-workflow.js +29 -14
- package/dist/core/doc-testing-session.d.ts +1 -1
- package/dist/core/doc-testing-session.js +1 -1
- package/dist/core/error-handling.js +2 -2
- package/dist/core/index.d.ts +4 -6
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +11 -22
- package/dist/core/nushell-runtime.d.ts +39 -0
- package/dist/core/nushell-runtime.d.ts.map +1 -0
- package/dist/core/nushell-runtime.js +103 -0
- package/dist/core/platform-operations.d.ts +76 -0
- package/dist/core/platform-operations.d.ts.map +1 -0
- package/dist/core/platform-operations.js +317 -0
- package/dist/core/providers/anthropic-provider.d.ts +32 -0
- package/dist/core/providers/anthropic-provider.d.ts.map +1 -0
- package/dist/core/providers/anthropic-provider.js +177 -0
- package/dist/core/providers/vercel-provider.d.ts +34 -0
- package/dist/core/providers/vercel-provider.d.ts.map +1 -0
- package/dist/core/providers/vercel-provider.js +202 -0
- package/dist/core/schema.d.ts +4 -7
- package/dist/core/schema.d.ts.map +1 -1
- package/dist/core/schema.js +13 -11
- package/dist/core/unified-creation-session.d.ts.map +1 -1
- package/dist/core/unified-creation-session.js +13 -14
- package/dist/interfaces/mcp.d.ts +1 -1
- package/dist/interfaces/mcp.d.ts.map +1 -1
- package/dist/interfaces/mcp.js +10 -2
- package/dist/interfaces/rest-api.js +1 -1
- package/dist/mcp/server.d.ts +1 -1
- package/dist/mcp/server.js +2 -2
- package/dist/tools/answer-question.d.ts.map +1 -1
- package/dist/tools/answer-question.js +8 -10
- package/dist/tools/build-platform.d.ts +25 -0
- package/dist/tools/build-platform.d.ts.map +1 -0
- package/dist/tools/build-platform.js +277 -0
- package/dist/tools/generate-manifests.d.ts.map +1 -1
- package/dist/tools/generate-manifests.js +7 -8
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +6 -1
- package/dist/tools/organizational-data.d.ts.map +1 -1
- package/dist/tools/organizational-data.js +3 -2
- package/dist/tools/recommend.d.ts.map +1 -1
- package/dist/tools/recommend.js +50 -30
- package/dist/tools/remediate.d.ts.map +1 -1
- package/dist/tools/remediate.js +23 -39
- package/dist/tools/version.d.ts +10 -2
- package/dist/tools/version.d.ts.map +1 -1
- package/dist/tools/version.js +65 -24
- package/package.json +7 -3
- package/prompts/map-intent-to-operation.md +104 -0
- package/prompts/parse-script-operations.md +72 -0
- package/prompts/question-generation.md +31 -3
- package/scripts/ack.nu +195 -0
- package/scripts/anthropic.nu +24 -0
- package/scripts/argo-workflows.nu +47 -0
- package/scripts/argocd.nu +85 -0
- package/scripts/aso.nu +74 -0
- package/scripts/atlas.nu +15 -0
- package/scripts/backstage.nu +349 -0
- package/scripts/cert-manager.nu +13 -0
- package/scripts/cnpg.nu +14 -0
- package/scripts/common.nu +116 -0
- package/scripts/crossplane.nu +718 -0
- package/scripts/dot.nu +32 -0
- package/scripts/external-secrets.nu +110 -0
- package/scripts/gatekeeper.nu +19 -0
- package/scripts/github.nu +42 -0
- package/scripts/image.nu +67 -0
- package/scripts/ingress.nu +149 -0
- package/scripts/kro.nu +11 -0
- package/scripts/kubernetes.nu +609 -0
- package/scripts/kubevela.nu +22 -0
- package/scripts/kyverno.nu +16 -0
- package/scripts/mcp.nu +139 -0
- package/scripts/port.nu +71 -0
- package/scripts/prometheus.nu +21 -0
- package/scripts/registry.nu +55 -0
- package/scripts/storage.nu +210 -0
- package/scripts/tests.nu +12 -0
- package/scripts/toolhive.nu +21 -0
- package/scripts/velero.nu +45 -0
- package/dist/core/claude.d.ts +0 -88
- package/dist/core/claude.d.ts.map +0 -1
- package/dist/core/claude.js +0 -414
package/scripts/dot.nu
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env nu
|
|
2
|
+
|
|
3
|
+
source ack.nu
|
|
4
|
+
source anthropic.nu
|
|
5
|
+
source argo-workflows.nu
|
|
6
|
+
source argocd.nu
|
|
7
|
+
source aso.nu
|
|
8
|
+
source atlas.nu
|
|
9
|
+
source backstage.nu
|
|
10
|
+
source cert-manager.nu
|
|
11
|
+
source cnpg.nu
|
|
12
|
+
source common.nu
|
|
13
|
+
source crossplane.nu
|
|
14
|
+
source external-secrets.nu
|
|
15
|
+
source gatekeeper.nu
|
|
16
|
+
source github.nu
|
|
17
|
+
source image.nu
|
|
18
|
+
source ingress.nu
|
|
19
|
+
source kro.nu
|
|
20
|
+
source kubernetes.nu
|
|
21
|
+
source kubevela.nu
|
|
22
|
+
source kyverno.nu
|
|
23
|
+
source mcp.nu
|
|
24
|
+
source port.nu
|
|
25
|
+
source prometheus.nu
|
|
26
|
+
source registry.nu
|
|
27
|
+
source storage.nu
|
|
28
|
+
source tests.nu
|
|
29
|
+
source toolhive.nu
|
|
30
|
+
source velero.nu
|
|
31
|
+
|
|
32
|
+
def main [] {}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
#!/usr/bin/env nu
|
|
2
|
+
|
|
3
|
+
# Installs External Secrets Operator (ESO) with optional cloud provider configuration
|
|
4
|
+
#
|
|
5
|
+
# Examples:
|
|
6
|
+
# > main apply external_secrets --provider google --google_project_id my-project
|
|
7
|
+
# > main apply external_secrets --provider azure --azure_key_vault_name my-vault
|
|
8
|
+
def "main apply external_secrets" [
|
|
9
|
+
--provider: string # Supported values: `google`, `azure`
|
|
10
|
+
--google_project_id: string # Used only if `provider` is `google`
|
|
11
|
+
--azure_key_vault_name: string # Used only if `provider` is `azure`
|
|
12
|
+
] {
|
|
13
|
+
|
|
14
|
+
print $"\nInstalling (ansi yellow_bold)External Secrets Operator \(ESO\)(ansi reset)...\n"
|
|
15
|
+
|
|
16
|
+
(
|
|
17
|
+
helm repo add external-secrets
|
|
18
|
+
https://charts.external-secrets.io
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
helm repo update
|
|
22
|
+
|
|
23
|
+
(
|
|
24
|
+
helm upgrade --install
|
|
25
|
+
external-secrets external-secrets/external-secrets
|
|
26
|
+
--namespace external-secrets --create-namespace
|
|
27
|
+
--wait
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
if $provider == "google" {
|
|
31
|
+
|
|
32
|
+
{
|
|
33
|
+
apiVersion: "external-secrets.io/v1beta1"
|
|
34
|
+
kind: "ClusterSecretStore"
|
|
35
|
+
metadata: { name: "google" }
|
|
36
|
+
spec: { provider: { gcpsm: {
|
|
37
|
+
auth: { secretRef: { secretAccessKeySecretRef: {
|
|
38
|
+
name: "gcp-creds"
|
|
39
|
+
key: "creds"
|
|
40
|
+
namespace: "crossplane-system"
|
|
41
|
+
} } }
|
|
42
|
+
projectID: $google_project_id
|
|
43
|
+
} } }
|
|
44
|
+
} | to yaml | kubectl apply --filename -
|
|
45
|
+
|
|
46
|
+
start $"https://console.developers.google.com/apis/api/secretmanager.googleapis.com/overview?project=($google_project_id)"
|
|
47
|
+
|
|
48
|
+
print $"
|
|
49
|
+
(ansi yellow_bold)ENABLE(ansi reset) the API.
|
|
50
|
+
Press the (ansi yellow_bold)enter key(ansi reset) to continue.
|
|
51
|
+
"
|
|
52
|
+
input
|
|
53
|
+
|
|
54
|
+
} else if $provider == "azure" {
|
|
55
|
+
|
|
56
|
+
# FIXME: Uncomment and rewrite
|
|
57
|
+
|
|
58
|
+
# az keyvault create --name $RESOURCE_GROUP \
|
|
59
|
+
# --resource-group $RESOURCE_GROUP
|
|
60
|
+
|
|
61
|
+
# az keyvault key create --vault-name $RESOURCE_GROUP --name "ContosoFirstKey" --protection software
|
|
62
|
+
|
|
63
|
+
# export AZURE_UPN=$(az ad user list | jq ".[0].userPrincipalName" -r)
|
|
64
|
+
|
|
65
|
+
# export AZURE_SUBSCRIPTION_ID=$(az account show --query id -o tsv)
|
|
66
|
+
|
|
67
|
+
# az role assignment create \
|
|
68
|
+
# --role "Key Vault Secrets Officer" \
|
|
69
|
+
# --assignee $AZURE_UPN \
|
|
70
|
+
# --scope "/subscriptions/$AZURE_SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP/providers/Microsoft.KeyVault/vaults/$RESOURCE_GROUP"
|
|
71
|
+
|
|
72
|
+
{
|
|
73
|
+
apiVersion: "external-secrets.io/v1beta1"
|
|
74
|
+
kind: "ClusterSecretStore"
|
|
75
|
+
metadata: { name: "azure" }
|
|
76
|
+
spec: { provider: { azurekv: {
|
|
77
|
+
authType: "ManagedIdentity"
|
|
78
|
+
vaultUrl: $"https://($azure_key_vault_name).vault.azure.net"
|
|
79
|
+
} } }
|
|
80
|
+
} | to yaml | kubectl apply --filename -
|
|
81
|
+
|
|
82
|
+
} else if $provider == "aws" {
|
|
83
|
+
|
|
84
|
+
{
|
|
85
|
+
apiVersion: "external-secrets.io/v1beta1"
|
|
86
|
+
kind: "ClusterSecretStore"
|
|
87
|
+
metadata: { name: "aws" }
|
|
88
|
+
spec: {
|
|
89
|
+
provider: { aws: {
|
|
90
|
+
service: "SecretsManager"
|
|
91
|
+
region: "us-east-1"
|
|
92
|
+
auth: { secretRef: {
|
|
93
|
+
accessKeyIDSecretRef: {
|
|
94
|
+
name: "aws-creds"
|
|
95
|
+
key: "accessKeyID"
|
|
96
|
+
namespace: "crossplane-system"
|
|
97
|
+
}
|
|
98
|
+
secretAccessKeySecretRef: {
|
|
99
|
+
name: "aws-creds"
|
|
100
|
+
key: "secretAccessKey"
|
|
101
|
+
namespace: "crossplane-system"
|
|
102
|
+
}
|
|
103
|
+
} }
|
|
104
|
+
} }
|
|
105
|
+
}
|
|
106
|
+
} | to yaml | kubectl apply --filename -
|
|
107
|
+
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env nu
|
|
2
|
+
|
|
3
|
+
# Installs Gatekeeper (Open Policy Agent) for Kubernetes policy enforcement
|
|
4
|
+
def "main apply opa" [] {
|
|
5
|
+
|
|
6
|
+
(
|
|
7
|
+
helm repo add gatekeeper
|
|
8
|
+
https://open-policy-agent.github.io/gatekeeper/charts
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
helm repo update
|
|
12
|
+
|
|
13
|
+
(
|
|
14
|
+
helm upgrade --install gatekeeper gatekeeper/gatekeeper
|
|
15
|
+
--namespace gatekeeper-system --create-namespace
|
|
16
|
+
--wait
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/usr/bin/env nu
|
|
2
|
+
|
|
3
|
+
# Retrieves GitHub credentials (token and organization/username)
|
|
4
|
+
#
|
|
5
|
+
# Parameters:
|
|
6
|
+
# --enable-org: Whether to retrieve GitHub organization/user (default: true)
|
|
7
|
+
# --github-token: GitHub token (optional, falls back to GITHUB_TOKEN or REGISTRY_PASSWORD env var)
|
|
8
|
+
# --github-org: GitHub organization/username (optional, falls back to GITHUB_ORG or REGISTRY_USER env var)
|
|
9
|
+
#
|
|
10
|
+
# Returns:
|
|
11
|
+
# A record with org and token fields, and saves values to .env file
|
|
12
|
+
def --env "main get github" [
|
|
13
|
+
--enable-org = true,
|
|
14
|
+
--github-token: string,
|
|
15
|
+
--github-org: string
|
|
16
|
+
] {
|
|
17
|
+
|
|
18
|
+
mut token = $github_token
|
|
19
|
+
if ($token | is-empty) and ("GITHUB_TOKEN" in $env) {
|
|
20
|
+
$token = $env.GITHUB_TOKEN
|
|
21
|
+
} else if ($token | is-empty) and ("REGISTRY_PASSWORD" in $env) {
|
|
22
|
+
$token = $env.REGISTRY_PASSWORD
|
|
23
|
+
} else if ($token | is-empty) {
|
|
24
|
+
error make { msg: "GitHub token required via --github-token parameter or GITHUB_TOKEN/REGISTRY_PASSWORD environment variable" }
|
|
25
|
+
}
|
|
26
|
+
$"export GITHUB_TOKEN=($token)\n" | save --append .env
|
|
27
|
+
|
|
28
|
+
mut org = $github_org
|
|
29
|
+
if $enable_org {
|
|
30
|
+
if ($org | is-empty) and ("GITHUB_ORG" in $env) {
|
|
31
|
+
$org = $env.GITHUB_ORG
|
|
32
|
+
} else if ($org | is-empty) and ("REGISTRY_USER" in $env) {
|
|
33
|
+
$org = $env.REGISTRY_USER
|
|
34
|
+
} else if ($org | is-empty) {
|
|
35
|
+
error make { msg: "GitHub organization/username required via --github-org parameter or GITHUB_ORG/REGISTRY_USER environment variable" }
|
|
36
|
+
}
|
|
37
|
+
$"export GITHUB_ORG=($org)\n" | save --append .env
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
{org: $org, token: $token}
|
|
41
|
+
|
|
42
|
+
}
|
package/scripts/image.nu
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
#!/usr/bin/env nu
|
|
2
|
+
|
|
3
|
+
# Builds a container image
|
|
4
|
+
def "main build image" [
|
|
5
|
+
tag: string # The tag of the image (e.g., 0.0.1)
|
|
6
|
+
--registry = "ghcr.io" # Image registry (e.g., ghcr.io)
|
|
7
|
+
--registry_user = "vfarcic" # Image registry user (e.g., vfarcic)
|
|
8
|
+
--image = "silly-demo" # Image name (e.g., silly-demo)
|
|
9
|
+
--builder = "docker" # Image builder; currently supported are: `docker` and `kaniko`
|
|
10
|
+
--push = true # Whether to push the image to the registry
|
|
11
|
+
--dockerfile = "Dockerfile" # Path to Dockerfile
|
|
12
|
+
--context = "." # Path to the context
|
|
13
|
+
] {
|
|
14
|
+
|
|
15
|
+
if $builder == "docker" {
|
|
16
|
+
|
|
17
|
+
(
|
|
18
|
+
docker image build
|
|
19
|
+
--tag $"($registry)/($registry_user)/($image):latest"
|
|
20
|
+
--tag $"($registry)/($registry_user)/($image):($tag)"
|
|
21
|
+
--file $dockerfile
|
|
22
|
+
$context
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
if $push {
|
|
26
|
+
|
|
27
|
+
docker image push $"($registry)/($registry_user)/($image):latest"
|
|
28
|
+
|
|
29
|
+
docker image push $"($registry)/($registry_user)/($image):($tag)"
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
} else if $builder == "kaniko" {
|
|
34
|
+
|
|
35
|
+
(
|
|
36
|
+
executor --dockerfile=Dockerfile --context=.
|
|
37
|
+
$"--destination=($registry)/($registry_user)/($image):($tag)"
|
|
38
|
+
$"--destination=($registry)/($registry_user)/($image):latest"
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
} else {
|
|
42
|
+
|
|
43
|
+
echo $"Unsupported builder: ($builder)"
|
|
44
|
+
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
# Retrieves a container registry address
|
|
50
|
+
#
|
|
51
|
+
# Parameters:
|
|
52
|
+
# --container-registry: Container registry address (optional, falls back to CONTAINER_REGISTRY env var)
|
|
53
|
+
def "main get container_registry" [
|
|
54
|
+
--container-registry: string
|
|
55
|
+
] {
|
|
56
|
+
|
|
57
|
+
mut registry = $container_registry
|
|
58
|
+
if ($registry | is-empty) and ("CONTAINER_REGISTRY" in $env) {
|
|
59
|
+
$registry = $env.CONTAINER_REGISTRY
|
|
60
|
+
} else if ($registry | is-empty) {
|
|
61
|
+
error make { msg: "Container registry address required via --container-registry parameter or CONTAINER_REGISTRY environment variable" }
|
|
62
|
+
}
|
|
63
|
+
$"export CONTAINER_REGISTRY=($registry)\n" | save --append .env
|
|
64
|
+
|
|
65
|
+
$registry
|
|
66
|
+
|
|
67
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
#!/usr/bin/env nu
|
|
2
|
+
|
|
3
|
+
# Applies Ingress
|
|
4
|
+
#
|
|
5
|
+
# Examples:
|
|
6
|
+
# > main apply ingress contour --provider aws
|
|
7
|
+
def --env "main apply ingress" [
|
|
8
|
+
class = "contour" # The class of Ingress controller to apply. Available options: traefik, contour, nginx
|
|
9
|
+
--provider = "none" # The cloud provider. Available options: aws, azure, google, upcloud, kind
|
|
10
|
+
--env_prefix = "" # Prefix to add to environment variables
|
|
11
|
+
] {
|
|
12
|
+
|
|
13
|
+
if $class == "traefik" {
|
|
14
|
+
|
|
15
|
+
(
|
|
16
|
+
helm upgrade --install traefik traefik
|
|
17
|
+
--repo https://helm.traefik.io/traefik
|
|
18
|
+
--namespace traefik --create-namespace --wait
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
} else if $class == "contour" {
|
|
22
|
+
|
|
23
|
+
(
|
|
24
|
+
helm upgrade --install contour
|
|
25
|
+
oci://registry-1.docker.io/bitnamicharts/contour
|
|
26
|
+
--namespace contour --create-namespace --wait
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
} else if $class == "nginx" {
|
|
30
|
+
|
|
31
|
+
if $provider == "kind" {
|
|
32
|
+
|
|
33
|
+
(
|
|
34
|
+
kubectl apply
|
|
35
|
+
--filename https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
sleep 10sec
|
|
39
|
+
|
|
40
|
+
(
|
|
41
|
+
kubectl --namespace ingress-nginx wait
|
|
42
|
+
--for=condition=Available
|
|
43
|
+
deployment ingress-nginx-controller
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
sleep 5sec
|
|
47
|
+
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
} else {
|
|
51
|
+
|
|
52
|
+
print $"(ansi red_bold)($class)(ansi reset) is not a supported."
|
|
53
|
+
exit 1
|
|
54
|
+
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
main get ingress $class --provider $provider --env_prefix $env_prefix
|
|
58
|
+
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
# Gets the IP and hostname for an Ingress controller
|
|
62
|
+
#
|
|
63
|
+
# Examples:
|
|
64
|
+
# > main get ingress contour --provider aws
|
|
65
|
+
# > main get ingress nginx --provider kind --env_prefix TEST_
|
|
66
|
+
def "main get ingress" [
|
|
67
|
+
class = "traefik" # The class of Ingress controller to apply. Available options: traefik, contour, nginx
|
|
68
|
+
--provider: string # The cloud provider. Available options: aws, azure, google, upcloud, kind
|
|
69
|
+
--env_prefix = "" # Prefix to add to environment variables
|
|
70
|
+
] {
|
|
71
|
+
|
|
72
|
+
mut service_name = $class
|
|
73
|
+
|
|
74
|
+
if $class == "contour" {
|
|
75
|
+
$service_name = "contour-envoy"
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
mut ingress_ip = ""
|
|
79
|
+
|
|
80
|
+
if $provider == "aws" or $provider == "upcloud" {
|
|
81
|
+
|
|
82
|
+
sleep 30sec
|
|
83
|
+
|
|
84
|
+
let ingress_hostname = (
|
|
85
|
+
kubectl --namespace $class
|
|
86
|
+
get service $service_name --output yaml
|
|
87
|
+
| from yaml
|
|
88
|
+
| get status.loadBalancer.ingress.0.hostname
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
while $ingress_ip == "" {
|
|
92
|
+
print "Waiting for Ingress Service IP..."
|
|
93
|
+
sleep 10sec
|
|
94
|
+
$ingress_ip = (dig +short $ingress_hostname)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
$ingress_ip = $ingress_ip | lines | first
|
|
98
|
+
|
|
99
|
+
} else if $provider == "kind" {
|
|
100
|
+
|
|
101
|
+
$ingress_ip = "127.0.0.1"
|
|
102
|
+
|
|
103
|
+
} else {
|
|
104
|
+
|
|
105
|
+
while $ingress_ip == "" {
|
|
106
|
+
|
|
107
|
+
print $"Waiting for ($class) Ingress IP from ($service_name) Service..."
|
|
108
|
+
|
|
109
|
+
sleep 10sec
|
|
110
|
+
|
|
111
|
+
$ingress_ip = (
|
|
112
|
+
kubectl --namespace $class
|
|
113
|
+
get service $service_name --output yaml
|
|
114
|
+
| from yaml
|
|
115
|
+
| get status.loadBalancer.ingress.0.ip
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
$"export ($env_prefix)INGRESS_IP=($ingress_ip)\n" | save --append .env
|
|
122
|
+
$"export ($env_prefix)INGRESS_HOST=($ingress_ip).nip.io\n" | save --append .env
|
|
123
|
+
|
|
124
|
+
{ip: $ingress_ip, host: $"($ingress_ip).nip.io", class: $class}
|
|
125
|
+
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
# Deletes an Ingress controller
|
|
129
|
+
#
|
|
130
|
+
# Examples:
|
|
131
|
+
# > main delete ingress contour
|
|
132
|
+
# > main delete ingress traefik
|
|
133
|
+
def --env "main delete ingress" [
|
|
134
|
+
class = "contour" # The class of Ingress controller to apply. Available options: traefik, contour, nginx
|
|
135
|
+
] {
|
|
136
|
+
|
|
137
|
+
print $"Uninstalling (ansi yellow_bold)Ingress(ansi reset)..."
|
|
138
|
+
|
|
139
|
+
if $class == "traefik" {
|
|
140
|
+
|
|
141
|
+
helm uninstall traefik --namespace traefik
|
|
142
|
+
|
|
143
|
+
} else if $class == "contour" {
|
|
144
|
+
|
|
145
|
+
helm uninstall contour --namespace contour
|
|
146
|
+
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
}
|
package/scripts/kro.nu
ADDED