-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add Makefile.kind with kind-centric targets - update cli/int tests (and test bundles) to use local docker registry - update auto PR az pipeline to run cli/int tests - delete manual PR pipeline - add doc on using KinD w/ Porter Signed-off-by: Vaughn Dice <[email protected]>
- Loading branch information
Showing
13 changed files
with
223 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ workshop/**/Dockerfile | |
|
||
.vscode | ||
.idea | ||
kind.config.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
SHELL = /bin/bash | ||
CLIENT_PLATFORM = $(shell go env GOOS) | ||
CLIENT_ARCH = $(shell go env GOARCH) | ||
|
||
# Determine host ip to populate kind config api server details | ||
# https://kind.sigs.k8s.io/docs/user/configuration/#api-server | ||
ifeq ($(CLIENT_PLATFORM),linux) | ||
export CURRENT_HOST_IP=$(shell hostname -i | awk '{print $1; exit}' | cut -d ' ' -f 1) | ||
else | ||
export CURRENT_HOST_IP=$(shell ifconfig en0 | awk '/inet / {print $2; }' | cut -d ' ' -f 2) | ||
endif | ||
|
||
## Create file definition for the kind cluster | ||
export KIND_CONFIG_FILE_NAME = kind.config.yaml | ||
define get_kind_config_file | ||
# Remove config file | ||
rm -rf ${KIND_CONFIG_FILE_NAME} | ||
# Define config file | ||
cat << EOF >> ${KIND_CONFIG_FILE_NAME} | ||
kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
networking: | ||
apiServerAddress: "${CURRENT_HOST_IP}" | ||
apiServerPort: 6443 | ||
EOF | ||
endef | ||
export KIND_CLUSTER_FILE_CREATOR = $(value get_kind_config_file) | ||
|
||
KIND_VERSION ?= v0.8.1 | ||
CLUSTER_NAME = porter | ||
|
||
install-kind: | ||
@curl -Lo /tmp/kind https://github.com/kubernetes-sigs/kind/releases/download/$(KIND_VERSION)/kind-$(CLIENT_PLATFORM)-$(CLIENT_ARCH) | ||
@chmod +x /tmp/kind | ||
@sudo mv /tmp/kind /usr/local/bin/kind | ||
|
||
create-kind-config-file:; @eval "$$KIND_CLUSTER_FILE_CREATOR" | ||
|
||
# TODO: remove need to manually set server value if darwin | ||
# https://github.com/kubernetes-sigs/kind/issues/1732 | ||
create-kind-cluster: create-kind-config-file | ||
@kind create cluster \ | ||
--name ${CLUSTER_NAME} \ | ||
--config ${KIND_CONFIG_FILE_NAME} | ||
@if [[ "$(CLIENT_PLATFORM)" == "darwin" ]]; then \ | ||
kubectl config set clusters.kind-${CLUSTER_NAME}.server https://${CURRENT_HOST_IP}:6443 ; \ | ||
fi | ||
|
||
delete-kind-cluster: | ||
@kind delete cluster --name ${CLUSTER_NAME} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.