Skip to content

Commit

Permalink
Add Google CloudDNS as dns provider (#229)
Browse files Browse the repository at this point in the history
Signed-off-by: Masudur Rahman <[email protected]>
  • Loading branch information
masudur-rahman authored Oct 12, 2023
1 parent e238ddd commit 0f4a411
Show file tree
Hide file tree
Showing 8 changed files with 218 additions and 156 deletions.
9 changes: 8 additions & 1 deletion apis/installer/v1alpha1/ace_ace_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,14 @@ type TLSIssuerAcme struct {
Email string `json:"email"`
}

// +kubebuilder:validation:Enum=external;cloudflare;route53
// +kubebuilder:validation:Enum=external;cloudflare;route53;cloudDNS
type DNSProvider string

const (
DNSProviderExternal DNSProvider = "external"
DNSProviderCloudflare DNSProvider = "cloudflare"
DNSProviderRoute53 DNSProvider = "route53"
DNSProviderCloudDNS DNSProvider = "cloudDNS"
)

type InfraDns struct {
Expand All @@ -276,6 +277,7 @@ type InfraDns struct {
type DNSProviderAuth struct {
Cloudflare *CloudflareAuth `json:"cloudflare,omitempty"`
Route53 *Route53Auth `json:"route53,omitempty"`
CloudDNS *CloudDNSAuth `json:"cloudDNS,omitempty"`
}

type CloudflareAuth struct {
Expand All @@ -290,6 +292,11 @@ type Route53Auth struct {
AwsRegion string `json:"AWS_REGION"`
}

type CloudDNSAuth struct {
GoogleProjectID string `json:"GOOGLE_PROJECT_ID"`
GoogleServiceAccountJSONKey string `json:"GOOGLE_SERVICE_ACCOUNT_JSON_KEY"`
}

// +kubebuilder:validation:Enum=gcs;s3;azure;swift
type ObjstoreProvider string

Expand Down
20 changes: 20 additions & 0 deletions apis/installer/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

300 changes: 150 additions & 150 deletions charts/ace/README.md

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion charts/ace/templates/dns/dns-cred.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ stringData:
AWS_SECRET_ACCESS_KEY: '{{ .Values.global.infra.dns.auth.route53.AWS_SECRET_ACCESS_KEY }}'
AWS_REGION: '{{ .Values.global.infra.dns.auth.route53.AWS_REGION }}'
{{- end }}
{{- end }}
{{- if eq .Values.global.infra.dns.provider "cloudDNS" }}
GOOGLE_SERVICE_ACCOUNT_JSON_KEY: '{{ .Values.global.infra.dns.auth.cloudDNS.GOOGLE_SERVICE_ACCOUNT_JSON_KEY }}'
{{- end }}
{{- end }}
7 changes: 7 additions & 0 deletions charts/ace/templates/ingress/issuer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,12 @@ spec:
key: CF_API_TOKEN
{{- end }}
{{- end }}
{{- if eq .Values.global.infra.dns.provider "cloudDNS" }}
cloudDNS:
project: {{ .Values.global.infra.dns.auth.cloudDNS.GOOGLE_PROJECT_ID }}
serviceAccountSecretRef:
name: {{ include "ace.fullname" . }}-dns-cred
key: GOOGLE_SERVICE_ACCOUNT_JSON_KEY
{{- end }}
{{- end }}
{{- end }}
11 changes: 11 additions & 0 deletions charts/ace/values.openapiv3_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3702,6 +3702,16 @@ properties:
properties:
auth:
properties:
cloudDNS:
properties:
GOOGLE_PROJECT_ID:
type: string
GOOGLE_SERVICE_ACCOUNT_JSON_KEY:
type: string
required:
- GOOGLE_PROJECT_ID
- GOOGLE_SERVICE_ACCOUNT_JSON_KEY
type: object
cloudflare:
properties:
baseURL:
Expand Down Expand Up @@ -3730,6 +3740,7 @@ properties:
- external
- cloudflare
- route53
- cloudDNS
type: string
required:
- auth
Expand Down
11 changes: 7 additions & 4 deletions charts/ace/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,13 @@ global:
cert: ""
key: ""
dns:
provider: "cloudflare" # external,cloudflare,route53
auth:
cloudflare:
token: xyz
provider: "external" # external,cloudflare,route53,cloudDNS
auth: {}
# cloudflare:
# token: xyz
# cloudDNS:
# GOOGLE_PROJECT_ID: "project-id"
# GOOGLE_SERVICE_ACCOUNT_JSON_KEY: xyz
# KMS and Object Store services are required
# set provider to empty to disable this feature
objstore:
Expand Down
11 changes: 11 additions & 0 deletions schema/ace-options/values.openapiv3_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,16 @@ properties:
properties:
auth:
properties:
cloudDNS:
properties:
GOOGLE_PROJECT_ID:
type: string
GOOGLE_SERVICE_ACCOUNT_JSON_KEY:
type: string
required:
- GOOGLE_PROJECT_ID
- GOOGLE_SERVICE_ACCOUNT_JSON_KEY
type: object
cloudflare:
properties:
baseURL:
Expand Down Expand Up @@ -417,6 +427,7 @@ properties:
- external
- cloudflare
- route53
- cloudDNS
type: string
required:
- auth
Expand Down

0 comments on commit 0f4a411

Please sign in to comment.