10type ExtNameSvcProps = { extHostname: string, externalName: string } 12export const genericExtNameSvc = ({extHostname, externalName}: ExtNameSvcProps) => { 19 'external-dns.alpha.kubernetes.io/hostname': extHostname, 29type SetKlusterWcProps = { action: string, ip?: string } 31export const doSetKlusterWcHnIp = async ({action, ip}: SetKlusterWcProps) => { 33 console.log('skipping doSetKlusterWcHnIp - ip not provided') 36 const {cluster_name, klusterVipHostname, clusterVip, klustCertsH, cfApiKeySecretName, domainNames} = getKlusterCtx() 38 const exposeDnsNames = Object.values(klustCertsH).flat() as string[] 39 throwIf(() => exposeDnsNames.length === 0, {cluster_name, klustCertsH}) 41 const headers = getCfHeaders({cfApiKeySecretName, required: false}) 42 const claimStore = headers && domainNames && domainNames.length ? mkCfTxtClaimStore({headers, domainNames}) : undefined 43 const isApply = action !== 'delete' 46 for (const dnsName of exposeDnsNames) { 47 if (claimStore && isApply && dnsName.startsWith('*.')) { 49 if (!claimed) { betLog({skippedWcClaim: dnsName, cluster_name}); continue } 51 resources.push(genericExtNameSvc({extHostname: dnsName, externalName: dnsName == klusterVipHostname ? clusterVip : ip})) 55 if (claimStore && isApply) await renewAllMyClaims({store: claimStore, owner: cluster_name})