Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Route53 issuer options #230

Merged
merged 3 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion apis/installer/v1alpha1/ace_ace_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,15 @@ type TLSIssuerAcme struct {
Email string `json:"email"`
}

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

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

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

type CloudflareAuth struct {
Expand All @@ -297,6 +299,17 @@ type CloudDNSAuth struct {
GoogleServiceAccountJSONKey string `json:"GOOGLE_SERVICE_ACCOUNT_JSON_KEY"`
}

type AzureDNSAuth struct {
SubscriptionID string `json:"subscriptionID"`
TenantID string `json:"tenantID"`
ResourceGroupName string `json:"resourceGroupName"`
HostedZoneName string `json:"hostedZoneName"`
ServicePrincipalAppID string `json:"servicePrincipalAppID"`
ServicePrincipalAppPassword string `json:"servicePrincipalAppPassword"`
// +optional
Environment string `json:"environment,omitempty"`
}

// +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.

12 changes: 12 additions & 0 deletions charts/ace/templates/dns/dns-cred.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,16 @@ stringData:
{{- 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 }}
{{- if eq .Values.global.infra.dns.provider "azureDNS" }}
SERVICE_PRINCIPAL_PASSWORD: {{ .Values.global.infra.dns.auth.azureDNS.servicePrincipalAppPassword }}
# https://github.com/kubeops/external-dns-operator/blob/master/examples/azure-credential.md
AZURE_CREDENTIAL_FILE: |
{
"tenantId": {{ .Values.global.infra.dns.auth.azureDNS.tenantID | quote }},
"subscriptionId": {{ .Values.global.infra.dns.auth.azureDNS.subscriptionID | quote }},
"resourceGroup": {{ .Values.global.infra.dns.auth.azureDNS.resourceGroupName | quote }},
"aadClientId": {{ .Values.global.infra.dns.auth.azureDNS.servicePrincipalAppID | quote }},
"aadClientSecret": {{ .Values.global.infra.dns.auth.azureDNS.servicePrincipalAppPassword | quote }}
}
{{- end }}
{{- end }}
20 changes: 20 additions & 0 deletions charts/ace/templates/ingress/issuer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,25 @@ spec:
name: {{ include "ace.fullname" . }}-dns-cred
key: GOOGLE_SERVICE_ACCOUNT_JSON_KEY
{{- end }}
{{- if eq .Values.global.infra.dns.provider "route53" }}
route53:
accessKeyID: {{ .Values.global.infra.dns.auth.route53.AWS_ACCESS_KEY_ID }}
region: {{ .Values.global.infra.dns.auth.route53.AWS_REGION }}
secretAccessKeySecretRef:
name: {{ include "ace.fullname" . }}-dns-cred
key: AWS_SECRET_ACCESS_KEY
{{- end }}
{{- if eq .Values.global.infra.dns.provider "azureDNS" }}
azureDNS:
clientID: {{ .Values.global.infra.dns.auth.azureDNS.servicePrincipalAppID }}
clientSecretSecretRef:
name: {{ include "ace.fullname" . }}-dns-cred
key: SERVICE_PRINCIPAL_PASSWORD
subscriptionID: {{ .Values.global.infra.dns.auth.azureDNS.subscriptionID }}
tenantID: {{ .Values.global.infra.dns.auth.azureDNS.tenantID }}
resourceGroupName: {{ .Values.global.infra.dns.auth.azureDNS.resourceGroupName }}
hostedZoneName: {{ .Values.global.infra.dns.auth.azureDNS.hostedZoneName }}
environment: {{ default "AzurePublicCloud" .Values.global.infra.dns.auth.azureDNS.environment }}
{{- end }}
{{- end }}
{{- end }}
25 changes: 25 additions & 0 deletions charts/ace/values.openapiv3_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3702,6 +3702,30 @@ properties:
properties:
auth:
properties:
azureDNS:
properties:
environment:
type: string
hostedZoneName:
type: string
resourceGroupName:
type: string
servicePrincipalAppID:
type: string
servicePrincipalAppPassword:
type: string
subscriptionID:
type: string
tenantID:
type: string
required:
- hostedZoneName
- resourceGroupName
- servicePrincipalAppID
- servicePrincipalAppPassword
- subscriptionID
- tenantID
type: object
cloudDNS:
properties:
GOOGLE_PROJECT_ID:
Expand Down Expand Up @@ -3741,6 +3765,7 @@ properties:
- cloudflare
- route53
- cloudDNS
- azureDNS
type: string
required:
- auth
Expand Down
12 changes: 12 additions & 0 deletions charts/ace/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,18 @@ global:
# cloudDNS:
# GOOGLE_PROJECT_ID: "project-id"
# GOOGLE_SERVICE_ACCOUNT_JSON_KEY: xyz
# azureDNS:
# subscriptionID: "azure-subscription-id"
# tenantID: "azure-tenant-id"
# resourceGroupName: "resource-group-name"
# hostedZoneName: "zone-name-for-hosted-domain"
# servicePrincipalAppID: "service-principal-id"
# servicePrincipalAppPassword: "service-principal-app"
# environment: AzurePublicCloud
# route53:
# AWS_ACCESS_KEY_ID: "access-id"
# AWS_SECRET_ACCESS_KEY: "secret-key"
# AWS_REGION: "us-east-1"
# KMS and Object Store services are required
# set provider to empty to disable this feature
objstore:
Expand Down
Loading