-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update local-setup so it can be used for both an e2e test suite and local development setup. Adds commands to generate AWS and GCP dns provider configuration and credentials used by local-setup ``` make local-setup-aws-mz-clean local-setup-aws-mz-generate AWS_ZONE_ROOT_DOMAIN=<my domain> AWS_DNS_PUBLIC_ZONE_ID=<my zone id> AWS_ACCESS_KEY_ID=<my access key> AWS_SECRET_ACCESS_KEY=<my access secret> make local-setup-gcp-mz-clean local-setup-gcp-mz-generate GCP_ZONE_NAME=<my zone name> GCP_ZONE_DNS_NAME=<my domain>GCP_GOOGLE='<my google credentials>' ``` `make local-setup` will generate a ManagedZone for AWS and/or GCP depending on the correct configuration existing (Generated by the above commands). Update README
- Loading branch information
Showing
9 changed files
with
141 additions
and
40 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
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
3 changes: 3 additions & 0 deletions
3
config/local-setup/managedzone/aws/aws-credentials.env.template
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,3 @@ | ||
AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} | ||
AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} | ||
AWS_REGION=${AWS_REGION} |
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
2 changes: 2 additions & 0 deletions
2
config/local-setup/managedzone/aws/managed-zone-config.env.template
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,2 @@ | ||
AWS_DNS_PUBLIC_ZONE_ID=${AWS_DNS_PUBLIC_ZONE_ID} | ||
AWS_ZONE_ROOT_DOMAIN=${AWS_ZONE_ROOT_DOMAIN} |
2 changes: 2 additions & 0 deletions
2
config/local-setup/managedzone/gcp/gcp-credentials.env.template
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,2 @@ | ||
GOOGLE=${GCP_GOOGLE} | ||
PROJECT_ID=${GCP_PROJECT_ID} |
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
2 changes: 2 additions & 0 deletions
2
config/local-setup/managedzone/gcp/managed-zone-config.env.template
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,2 @@ | ||
GCP_ZONE_NAME=${GCP_ZONE_NAME} | ||
GCP_ZONE_DNS_NAME=${GCP_ZONE_DNS_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
|
||
##@ ManagedZones | ||
|
||
## Targets to help configure ManagedZones for local-setup | ||
|
||
define patch-config | ||
envsubst \ | ||
< $1 \ | ||
> $2 | ||
endef | ||
|
||
ndef = $(if $(value $(1)),,$(error $(1) not set)) | ||
|
||
LOCAL_SETUP_AWS_MZ_CONFIG=config/local-setup/managedzone/aws/managed-zone-config.env | ||
LOCAL_SETUP_AWS_MZ_CREDS=config/local-setup/managedzone/aws/aws-credentials.env | ||
LOCAL_SETUP_GCP_MZ_CONFIG=config/local-setup/managedzone/gcp/managed-zone-config.env | ||
LOCAL_SETUP_GCP_MZ_CREDS=config/local-setup/managedzone/gcp/gcp-credentials.env | ||
|
||
.PHONY: local-setup-aws-mz-generate | ||
local-setup-aws-mz-generate: local-setup-aws-mz-config local-setup-aws-mz-credentials ## Generate AWS ManagedZone configuration and credentials for local-setup | ||
|
||
.PHONY: local-setup-aws-mz-clean | ||
local-setup-aws-mz-clean: ## Remove AWS ManagedZone configuration and credentials | ||
rm -f ${LOCAL_SETUP_AWS_MZ_CONFIG} | ||
rm -f ${LOCAL_SETUP_AWS_MZ_CREDS} | ||
|
||
.PHONY: local-setup-aws-mz-config | ||
local-setup-aws-mz-config: $(LOCAL_SETUP_AWS_MZ_CONFIG) | ||
$(LOCAL_SETUP_AWS_MZ_CONFIG): | ||
$(call ndef,AWS_DNS_PUBLIC_ZONE_ID) | ||
$(call ndef,AWS_ZONE_ROOT_DOMAIN) | ||
$(call patch-config,${LOCAL_SETUP_AWS_MZ_CONFIG}.template,${LOCAL_SETUP_AWS_MZ_CONFIG}) | ||
|
||
.PHONY: local-setup-aws-mz-credentials | ||
local-setup-aws-mz-credentials: $(LOCAL_SETUP_AWS_MZ_CREDS) | ||
$(LOCAL_SETUP_AWS_MZ_CREDS): | ||
$(call ndef,AWS_ACCESS_KEY_ID) | ||
$(call ndef,AWS_SECRET_ACCESS_KEY) | ||
$(call patch-config,${LOCAL_SETUP_AWS_MZ_CREDS}.template,${LOCAL_SETUP_AWS_MZ_CREDS}) | ||
|
||
.PHONY: local-setup-gcp-mz-generate | ||
local-setup-gcp-mz-generate: local-setup-gcp-mz-config local-setup-gcp-mz-credentials ## Generate GCP ManagedZone configuration and credentials for local-setup | ||
|
||
.PHONY: local-setup-gcp-mz-clean | ||
local-setup-gcp-mz-clean: ## Remove GCP ManagedZone configuration and credentials | ||
rm -f ${LOCAL_SETUP_GCP_MZ_CONFIG} | ||
rm -f ${LOCAL_SETUP_GCP_MZ_CREDS} | ||
|
||
.PHONY: local-setup-gcp-mz-config | ||
local-setup-gcp-mz-config: $(LOCAL_SETUP_GCP_MZ_CONFIG) | ||
$(LOCAL_SETUP_GCP_MZ_CONFIG): | ||
$(call ndef,GCP_ZONE_NAME) | ||
$(call ndef,GCP_ZONE_DNS_NAME) | ||
$(call patch-config,${LOCAL_SETUP_GCP_MZ_CONFIG}.template,${LOCAL_SETUP_GCP_MZ_CONFIG}) | ||
|
||
.PHONY: local-setup-gcp-mz-credentials | ||
local-setup-gcp-mz-credentials: $(LOCAL_SETUP_GCP_MZ_CREDS) | ||
$(LOCAL_SETUP_GCP_MZ_CREDS): | ||
$(call ndef,GCP_GOOGLE) | ||
$(call ndef,GCP_PROJECT_ID) | ||
$(call patch-config,${LOCAL_SETUP_GCP_MZ_CREDS}.template,${LOCAL_SETUP_GCP_MZ_CREDS}) | ||
|
||
.PHONY: local-setup-managedzones | ||
local-setup-managedzones: TARGET_NAMESPACE=dnstest | ||
local-setup-managedzones: kustomize ## Create AWS and GCP managedzones in the 'TARGET_NAMESPACE' namespace | ||
@if [[ -f "config/local-setup/managedzone/gcp/managed-zone-config.env" && -f "config/local-setup/managedzone/gcp/gcp-credentials.env" ]]; then\ | ||
echo "local-setup: creating managedzone for gcp config and credentials in ${TARGET_NAMESPACE}";\ | ||
${KUSTOMIZE} build config/local-setup/managedzone/gcp | $(KUBECTL) -n ${TARGET_NAMESPACE} apply -f -;\ | ||
fi | ||
@if [[ -f "config/local-setup/managedzone/aws/managed-zone-config.env" && -f "config/local-setup/managedzone/aws/aws-credentials.env" ]]; then\ | ||
echo "local-setup: creating managedzone for aws config and credentials in ${TARGET_NAMESPACE}";\ | ||
${KUSTOMIZE} build config/local-setup/managedzone/aws | $(KUBECTL) -n ${TARGET_NAMESPACE} apply -f -;\ | ||
fi |