Skip to content

Commit

Permalink
local-setup: Add aws and gcp managed zone config
Browse files Browse the repository at this point in the history
  • Loading branch information
mikenairn committed Feb 27, 2024
1 parent a8c9daa commit f07b39a
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ Dockerfile.cross

# Temporary files and directories
tmp

config/local-setup/**/*.env
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ local-setup: $(KIND) ## Setup local development kind cluster and dependencies
$(MAKE) kind-create-cluster

.PHONY: local-deploy
local-deploy: docker-build kind-load-image deploy ## Deploy the dns operator into local kind cluster from the current code
local-deploy: docker-build kind-load-image ## Deploy the dns operator into local kind cluster from the current code
$(KUBECTL) config use-context kind-$(KIND_CLUSTER_NAME)
$(MAKE) deploy

##@ Build

Expand All @@ -165,7 +167,7 @@ run: manifests generate fmt vet ## Run a controller from your host.
# (i.e. docker build --platform linux/arm64 ). However, you must enable docker buildKit for it.
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
.PHONY: docker-build
docker-build: test ## Build docker image with the manager.
docker-build: ## Build docker image with the manager.
$(CONTAINER_TOOL) build -t ${IMG} .

.PHONY: docker-push
Expand Down
40 changes: 40 additions & 0 deletions config/local-setup/managedzone/aws/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
resources:
- managed_zone.yaml

generatorOptions:
disableNameSuffixHash: true

configMapGenerator:
- name: aws-managed-zone-config
envs:
- managed-zone-config.env

secretGenerator:
- name: aws-credentials
envs:
- aws-credentials.env
type: "kuadrant.io/aws"

replacements:
- source:
kind: ConfigMap
name: aws-managed-zone-config
version: v1
fieldPath: data.AWS_DNS_PUBLIC_ZONE_ID
targets:
- select:
kind: ManagedZone
name: dev-mz-aws
fieldPaths:
- spec.id
- source:
kind: ConfigMap
name: aws-managed-zone-config
version: v1
fieldPath: data.ZONE_ROOT_DOMAIN
targets:
- select:
kind: ManagedZone
name: dev-mz-aws
fieldPaths:
- spec.domainName
10 changes: 10 additions & 0 deletions config/local-setup/managedzone/aws/managed_zone.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: kuadrant.io/v1alpha1
kind: ManagedZone
metadata:
name: dev-mz-aws
spec:
id: DUMMY_ID
domainName: DUMMY_DOMAIN_NAME
description: "Dev Managed Zone"
dnsProviderSecretRef:
name: aws-credentials
40 changes: 40 additions & 0 deletions config/local-setup/managedzone/gcp/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
resources:
- managed_zone.yaml

generatorOptions:
disableNameSuffixHash: true

configMapGenerator:
- name: gcp-managed-zone-config
envs:
- managed-zone-config.env

secretGenerator:
- name: gcp-credentials
envs:
- gcp-credentials.env
type: "kuadrant.io/gcp"

replacements:
- source:
kind: ConfigMap
name: gcp-managed-zone-config
version: v1
fieldPath: data.ZONE_NAME
targets:
- select:
kind: ManagedZone
name: dev-mz-gcp
fieldPaths:
- spec.id
- source:
kind: ConfigMap
name: gcp-managed-zone-config
version: v1
fieldPath: data.ZONE_DNS_NAME
targets:
- select:
kind: ManagedZone
name: dev-mz-gcp
fieldPaths:
- spec.domainName
10 changes: 10 additions & 0 deletions config/local-setup/managedzone/gcp/managed_zone.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: kuadrant.io/v1alpha1
kind: ManagedZone
metadata:
name: dev-mz-gcp
spec:
id: DUMMY_ID
domainName: DUMMY_DOMAIN_NAME
description: "Dev Managed Zone"
dnsProviderSecretRef:
name: gcp-credentials

0 comments on commit f07b39a

Please sign in to comment.