...

Text file src/edge-infra.dev/hack/kind/justfile

Documentation: edge-infra.dev/hack/kind

     1kind := "bazel run --config=quiet //hack/tools:kind --"
     2kubectl := "bazel run --config=quiet //hack/tools:kubectl --"
     3kustomize := "bazel run --config=quiet //hack/tools:kustomize --"
     4# kind cluster name
     5name := "edge"
     6
     7# registry information
     8registry_name := "kind-registry"
     9registry_port := "21700"
    10
    11up: registry
    12  {{kind}} create cluster --config $(pwd)/config.yaml --name {{name}} --wait 5m
    13  # make our local registry available to our kind cluster
    14  if [ "$(docker inspect -f='{{{{json .NetworkSettings.Networks.kind}}' "{{registry_name}}")" = 'null' ]; then \
    15    docker network connect "kind" "{{registry_name}}"; \
    16  fi
    17  {{kubectl}} apply -f local-registry-config.yaml
    18
    19down:
    20  {{kind}} delete cluster --name {{name}}
    21
    22reset: down up
    23
    24install-kcc infra-cluster-id infra-project-id: ensure-kind
    25  echo "dumping cluster info..."
    26  {{kubectl}} cluster-info
    27  echo "installing and configuring kcc..."
    28  bazel run --config=quiet //cmd/lift -- setup konfig-konnector --cluster-id={{infra-cluster-id}} --cluster-project-id={{infra-project-id}} --cluster-type=generic
    29
    30ensure-kind:
    31  ./check-kind-context.sh "{{kubectl}}"
    32
    33registry:
    34  #!/usr/bin/env bash
    35  if [ "$(docker inspect -f '{{{{.State.Running}}' "{{registry_name}}" 2>/dev/null || true)" != "true" ]; then 
    36    docker run \
    37      -d --restart=always \
    38      -p "127.0.0.1:{{registry_port}}:5000" \
    39      --name "{{registry_name}}" \
    40      registry:2
    41  fi

View as plain text