Skip to content

Commit

Permalink
Added support for DDNS / RFC2136 (#1889)
Browse files Browse the repository at this point in the history
* Added DDNS Provider

* Added missing zone validation

* Added DDNS docu

* PR Feedback

* removed host:port validation

* Updated DDNS Icon
  • Loading branch information
grolu authored Jun 11, 2024
1 parent 3f534f1 commit 82be0bf
Show file tree
Hide file tree
Showing 19 changed files with 329 additions and 212 deletions.
17 changes: 16 additions & 1 deletion backend/lib/services/cloudProviderSecrets.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,22 @@ const { Resources } = require('@gardener-dashboard/kube-client')
const createError = require('http-errors')
const { format: fmt } = require('util')
const { decodeBase64, encodeBase64 } = require('../utils')
const cleartextPropertyKeys = ['accessKeyID', 'subscriptionID', 'project', 'domainName', 'tenantName', 'authUrl', 'vsphereUsername', 'nsxtUsername', 'username', 'metalAPIURL', 'AWS_REGION']
const cleartextPropertyKeys = [
'accessKeyID',
'subscriptionID',
'project',
'domainName',
'tenantName',
'authUrl',
'vsphereUsername',
'nsxtUsername',
'username',
'metalAPIURL',
'AWS_REGION',
'Server',
'TSIGKeyName',
'Zone'
]
const normalizedCleartextPropertyKeys = cleartextPropertyKeys.map(key => key.toLowerCase())
const cloudprofiles = require('./cloudprofiles')
const shoots = require('./shoots')
Expand Down
19 changes: 19 additions & 0 deletions frontend/src/assets/ddns.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions frontend/src/components/GVendorIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ const iconSrc = computed(() => {
return new URL('/src/assets/infoblox-dns.svg', import.meta.url)
case 'netlify-dns':
return new URL('/src/assets/netlify-dns.svg', import.meta.url)
case 'ddns':
return new URL('/src/assets/ddns.svg', import.meta.url)

// os
case 'coreos':
Expand Down
15 changes: 15 additions & 0 deletions frontend/src/components/Secrets/GSecretDetailsItemContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,21 @@ export default {
value: 'hidden',
},
]
case 'ddns':
return [
{
label: 'Server',
value: secretData.Server,
},
{
label: 'TSIG Key Name',
value: secretData.TSIGKeyName,
},
{
label: 'Zone',
value: secretData.Zone,
},
]
default:
return [
{
Expand Down
37 changes: 29 additions & 8 deletions frontend/src/components/Secrets/GSecretDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,12 @@ SPDX-License-Identifier: Apache-2.0
<v-slide-x-reverse-transition>
<div
v-if="helpVisible"
class="pa-3 ml-3 help"
:style="helpStyle"
class="ml-6 help-container"
:style="helpContainerStyles"
>
<slot name="help-slot" />
<div class="help-content">
<slot name="help-slot" />
</div>
</div>
</v-slide-x-reverse-transition>
</div>
Expand Down Expand Up @@ -285,14 +287,15 @@ export default {
const name = get(this.secret, 'metadata.name')
return filter(this.shootList, ['spec.secretBindingName', name])
},
helpStyle () {
helpContainerStyles () {
const detailsRef = this.$refs.secretDetails
let detailsHeight = 0
if (detailsRef) {
detailsHeight = detailsRef.getBoundingClientRect().height
}
return {
maxHeight: `${detailsHeight}px`,
maxWidth: '50%',
}
},
isInfrastructureSecret () {
Expand Down Expand Up @@ -405,9 +408,27 @@ export default {

<style lang="scss" scoped>

.help {
max-width: 80%;
overflow-y: auto;
}
.help-container {
position: relative;
overflow: hidden;
}

.help-content {
height: 100%;
overflow-y: auto;
padding-right: 15px;
box-sizing: content-box;
}

.help-container::after {
content: "";
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 50px;
background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(var(--v-theme-surface)));
pointer-events: none;
}

</style>
28 changes: 5 additions & 23 deletions frontend/src/components/Secrets/GSecretDialogAlicloud.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,11 @@ SPDX-License-Identifier: Apache-2.0
You need to provide an access key (access key ID and secret access key) for Alibaba Cloud to allow the dns-controller-manager to authenticate to Alibaba Cloud DNS.
</p>
<p>
For details see <g-external-link url="https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md#accesskey-client">
For details see
<g-external-link url="https://github.com/aliyun/alibaba-cloud-sdk-go/blob/master/docs/2-Client-EN.md#accesskey-client">
AccessKey Client
</g-external-link>. Currently the regionId is fixed to cn-shanghai.
</g-external-link>.
Currently the regionId is fixed to cn-shanghai.
</p>
</div>
</template>
Expand All @@ -103,10 +105,7 @@ import GSecretDialog from '@/components/Secrets/GSecretDialog'
import GCodeBlock from '@/components/GCodeBlock'
import GExternalLink from '@/components/GExternalLink'

import {
getErrorMessages,
setDelayedInputFocus,
} from '@/utils'
import { getErrorMessages } from '@/utils'
import { withFieldName } from '@/utils/validators'

export default {
Expand Down Expand Up @@ -220,24 +219,7 @@ export default {
return !this.secret
},
},
watch: {
value: function (value) {
if (value) {
this.reset()
}
},
},
methods: {
reset () {
this.v$.$reset()

this.accessKeyId = ''
this.accessKeySecret = ''

if (!this.isCreateMode) {
setDelayedInputFocus(this, 'accessKeyId')
}
},
getErrorMessages,
},
}
Expand Down
23 changes: 1 addition & 22 deletions frontend/src/components/Secrets/GSecretDialogAws.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,7 @@ import {
alphaNumUnderscore,
base64,
} from '@/utils/validators'
import {
getErrorMessages,
setDelayedInputFocus,
} from '@/utils'
import { getErrorMessages } from '@/utils'

export default {
components: {
Expand Down Expand Up @@ -279,25 +276,7 @@ export default {
return undefined
},
},
watch: {
value: function (value) {
if (value) {
this.reset()
}
},
},
methods: {
reset () {
this.v$.$reset()

this.accessKeyId = ''
this.secretAccessKey = ''
this.awsRegion = ''

if (!this.isCreateMode) {
setDelayedInputFocus(this, 'accessKeyId')
}
},
getErrorMessages,
},
}
Expand Down
30 changes: 5 additions & 25 deletions frontend/src/components/Secrets/GSecretDialogAzure.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,11 @@ SPDX-License-Identifier: Apache-2.0
</div>
<div v-if="vendor==='azure-dns' || vendor==='azure-private-dns'">
<p>
Follow the steps as described in the Azure documentation to <g-external-link url="https://docs.microsoft.com/en-us/azure/dns/dns-sdk#create-a-service-principal-account">
Follow the steps as described in the Azure documentation to
<g-external-link url="https://docs.microsoft.com/en-us/azure/dns/dns-sdk#create-a-service-principal-account">
create a service principal account
</g-external-link> and grant the service principal account 'DNS Zone Contributor' permissions to the resource group.
</g-external-link>
and grant the service principal account 'DNS Zone Contributor' permissions to the resource group.
</p>
</div>
</template>
Expand All @@ -104,10 +106,7 @@ import GSecretDialog from '@/components/Secrets/GSecretDialog'
import GExternalLink from '@/components/GExternalLink'

import { withFieldName } from '@/utils/validators'
import {
getErrorMessages,
setDelayedInputFocus,
} from '@/utils'
import { getErrorMessages } from '@/utils'

export default {
components: {
Expand Down Expand Up @@ -195,26 +194,7 @@ export default {
return undefined
},
},
watch: {
value: function (value) {
if (value) {
this.reset()
}
},
},
methods: {
reset () {
this.v$.$reset()

this.clientId = ''
this.clientSecret = ''
this.subscriptionId = ''
this.tenantId = ''

if (!this.isCreateMode) {
setDelayedInputFocus(this, 'clientId')
}
},
getErrorMessages,
},
}
Expand Down
15 changes: 2 additions & 13 deletions frontend/src/components/Secrets/GSecretDialogCloudflare.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ SPDX-License-Identifier: Apache-2.0
:data="secretData"
:secret-validations="v$"
:secret="secret"
vendor="cloudflare-dns"
create-title="Add new Cloudflare Secret"
replace-title="Replace Cloudflare Secret"
>
Expand All @@ -34,7 +33,8 @@ SPDX-License-Identifier: Apache-2.0
<template #help-slot>
<div>
<p>
To use this provider you need to generate an API token from the Cloudflare dashboard. A detailed documentation to generate an API token is available at <g-external-link url="https://support.cloudflare.com/hc/en-us/articles/200167836-Managing-API-Tokens-and-Keys" />.
To use this provider you need to generate an API token from the Cloudflare dashboard. A detailed documentation to generate an API token is available at
<g-external-link url="https://support.cloudflare.com/hc/en-us/articles/200167836-Managing-API-Tokens-and-Keys" />.
</p>
<p class="font-weight-bold">
Note: You need to generate an API token and not an API key.
Expand Down Expand Up @@ -125,18 +125,7 @@ export default {
return !this.secret
},
},
watch: {
value: function (value) {
if (value) {
this.reset()
}
},
},
methods: {
reset () {
this.v$.$reset()
this.apiToken = ''
},
getErrorMessages,
},
}
Expand Down
Loading

0 comments on commit 82be0bf

Please sign in to comment.