diff --git a/examples/aws-credential.md b/examples/aws-credential.md index 6af2152a..17d74c40 100644 --- a/examples/aws-credential.md +++ b/examples/aws-credential.md @@ -1,6 +1,6 @@ ### Create credential file -The file must be named as `credentials`, you can create credential file from command line as, -``` +First, you have to add a credential file using AWS secrets, +```bash cat <<-EOF > /local/path/to/credentials [default] @@ -10,9 +10,11 @@ EOF ``` ### Create secret from file -Use the `credentials` file to create secret: +Use the above file to create a secret: ```bash kubectl create secret generic aws-credential --namespace demo --from-file /local/path/to/credentials ``` -The secret must be in the same namespace as the External-DNS \ No newline at end of file +The secret must be in the same **namespace** as the External-DNS + +You can use this secret to create records in the AWS provider. The secret name should be used against `spec.aws.secretRef.name` field and secret key against `spec.aws.secretRef.credentialKey` diff --git a/examples/azure-credential.md b/examples/azure-credential.md index 80de47f9..56472a9c 100644 --- a/examples/azure-credential.md +++ b/examples/azure-credential.md @@ -1,21 +1,24 @@ ### Create credential file -The file must be named as `azure.json`, you can create the file by: -``` +You have to create a JSON credential file for Azure Provider: +```bash cat <<-EOF > /local/path/to/azure.json { "tenantId": "your-azure-tenant-id", "subscriptionId": "your-azure-subscription-id", "resourceGroup": "your-azure-resource-group-name", - "useManagedIdentityExtension": true + "aadClientId": "your-azure-client-id", + "aadClientSecret": "your-azure-client-password" } EOF ``` ### Create secret from file -Use the `azure.json` file to create Kubernetes secret: +Use the JSON file to create a secret. ```shell kubectl create secret generic azure-credential --namespace demo --from-file /local/path/to/azure.json ``` -The secret must be in the same namespace as the External-DNS \ No newline at end of file +The secret must be in the same namespace as the External-DNS + +This secret name and secret key will be used in `spec.azure.secretRef.name` and `spec.azure.secretRef.credentialKey` diff --git a/examples/cloudflare-secret.yaml b/examples/cloudflare-secret.yaml index 31ba5b2b..b7f18779 100644 --- a/examples/cloudflare-secret.yaml +++ b/examples/cloudflare-secret.yaml @@ -4,4 +4,9 @@ stringData: kind: Secret metadata: name: cloudflare-credential - namespace: demo #must be in the same namespace as External-DNS \ No newline at end of file + namespace: demo #must be in the same namespace as External-DNS + +#this secret name will be used in spec.cloudflare.secretRef.name + +#and secret key in spec.cloudflare.secretRef.apiToken +#you can use api token otherwise api key and api email diff --git a/examples/google-credential.md b/examples/google-credential.md index 5834da70..8240fbbe 100644 --- a/examples/google-credential.md +++ b/examples/google-credential.md @@ -1,6 +1,6 @@ -### Create Secret from `credentials.json` +### Create Secret from Create a Kubernetes secret with the credentials in the same namespace of External-DNS operator. ```shell -kubectl create secret generic "google-credential" --namespace demo --from-file /local/path/to/credentials.json +kubectl create secret generic google-credential --namespace demo --from-file /local/path/to/credentials.json ``` -The file containing the GKE credentials must be named as `credentials.json` \ No newline at end of file +The name and key of this secret will be used in `spec.google.secretRef.name` and `spec.google.secretRef.credentialKey` diff --git a/examples/node-aws.yaml b/examples/node-aws.yaml index 50acba49..9dce6be1 100644 --- a/examples/node-aws.yaml +++ b/examples/node-aws.yaml @@ -4,8 +4,6 @@ metadata: name: aws-edns-node namespace: demo spec: - providerSecretRef: - name: aws-credential source: type: group: "" @@ -18,9 +16,12 @@ spec: registry: txt txtOwnerID: external-dns txtPrefix: xyz - provider: aws domainFilter: - example.com policy: upsert-only + provider: aws aws: zoneType: public + secretRef: + name: aws-credential + credentialKey: credentials diff --git a/examples/node-azure.yaml b/examples/node-azure.yaml index 0ca5681e..1df736ec 100644 --- a/examples/node-azure.yaml +++ b/examples/node-azure.yaml @@ -1,23 +1,25 @@ apiVersion: external-dns.appscode.com/v1alpha1 kind: ExternalDNS metadata: - name: azure-nodes + name: node.example.com namespace: demo spec: - providerSecretRef: - name: azure-credential source: type: group: "" version: v1 kind: Node node: - labelFilter: app=demo-node - annotationFilter: lke.linode.com/wgip=0.0.0.0 + labelFilter: app=demo-node #sample label filter format + annotationFilter: lke.linode.com/wgip=0.0.0.0 #sample annotation filter format fqdnTemplate: node.example.com registry: txt txtOwnerID: external-dns txtPrefix: xyz - provider: azure domainFilter: - example.com + provider: azure + azure: + secretRef: + name: azure-credential + credentialKey: azure.json diff --git a/examples/node-cloudflare.yaml b/examples/node-cloudflare.yaml index 71315a69..36f1e113 100644 --- a/examples/node-cloudflare.yaml +++ b/examples/node-cloudflare.yaml @@ -4,8 +4,6 @@ metadata: name: cloudflare-nodes namespace: demo spec: - providerSecretRef: - name: cloudflare-credential source: type: group: "" @@ -18,6 +16,10 @@ spec: registry: txt txtOwnerID: external-dns txtPrefix: xyz - provider: cloudflare domainFilter: - example.com + provider: cloudflare + cloudflare: + secretRef: + name: cloudflare-credentials + apiToken: CF_API_TOKEN diff --git a/examples/nodes-google.yaml b/examples/nodes-google.yaml index 45c61b9f..ef6d6ee4 100644 --- a/examples/nodes-google.yaml +++ b/examples/nodes-google.yaml @@ -19,9 +19,12 @@ spec: registry: txt txtOwnerID: external-dns txtPrefix: xyz - provider: google - google: - project: project-name domainFilter: - example.com policy: upsert-only + provider: google + google: + project: project-name + secretRef: + name: google-credential + credentialKey: credentials.json diff --git a/examples/webinar-20230111/aws-credential.yaml b/examples/webinar-20230111/aws-credential.yaml new file mode 100644 index 00000000..5fd6d6d2 --- /dev/null +++ b/examples/webinar-20230111/aws-credential.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +data: + credentials: awsbase64encodedcredentialdata +kind: Secret +metadata: + name: aws-credential + namespace: demo +type: Opaque diff --git a/examples/webinar-20230111/aws-node.yaml b/examples/webinar-20230111/aws-node.yaml new file mode 100644 index 00000000..19d83219 --- /dev/null +++ b/examples/webinar-20230111/aws-node.yaml @@ -0,0 +1,26 @@ +apiVersion: external-dns.appscode.com/v1alpha1 +kind: ExternalDNS +metadata: + name: aws-edns-node + namespace: demo +spec: + source: + type: + group: "" + version: v1 + kind: Node + node: + #annotationFilter: lke.linode.com/wgip=172.31.2.1 + fqdnTemplate: node.appscode.info + registry: txt + txtOwnerID: external-dns + txtPrefix: xyz + policy: sync + provider: aws + domainFilter: + - appscode.info + aws: + zoneType: public + secretRef: + name: aws-credential + credentialKey: credentials diff --git a/examples/webinar-20230111/dep-svc.yaml b/examples/webinar-20230111/dep-svc.yaml new file mode 100644 index 00000000..53cf6b64 --- /dev/null +++ b/examples/webinar-20230111/dep-svc.yaml @@ -0,0 +1,42 @@ +--- +# Deployment +apiVersion: apps/v1 +kind: Deployment +metadata: + name: demo-dep + namespace: demo + labels: + app: nginx +spec: + replicas: 1 + selector: + matchLabels: + app: nginx + template: + metadata: + labels: + app: nginx + spec: + containers: + - name: nginx + image: nginx:1.14.2 + ports: + - containerPort: 80 +--- +# Service +apiVersion: v1 +kind: Service +metadata: + name: demo-svc-lb + namespace: demo + annotations: + external-dns.alpha.kubernetes.io/hostname: service.appscode.info #for Service, you have to add this annotation to specify fully qualified domain name + labels: + app: demo-svc +spec: + type: LoadBalancer + selector: + app: nginx + ports: + - port: 80 + targetPort: 80 diff --git a/examples/webinar-20230111/google-cred.yaml b/examples/webinar-20230111/google-cred.yaml new file mode 100644 index 00000000..1ed3c13f --- /dev/null +++ b/examples/webinar-20230111/google-cred.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +data: + credentials.json: base64encodedgooglecredentials +kind: Secret +metadata: + name: google-cred + namespace: demo +type: Opaque diff --git a/examples/webinar-20230111/google-service.yaml b/examples/webinar-20230111/google-service.yaml new file mode 100644 index 00000000..c8d40b3a --- /dev/null +++ b/examples/webinar-20230111/google-service.yaml @@ -0,0 +1,22 @@ +apiVersion: external-dns.appscode.com/v1alpha1 +kind: ExternalDNS +metadata: + name: google-edns-node + namespace: demo +spec: + source: + type: + group: "" + version: v1 + kind: Service + registry: txt + txtOwnerID: external-dns + txtPrefix: service + provider: google + domainFilter: + - appscode.info + google: + project: appscode-testing + secretRef: + name: google-cred + credentialKey: credentials.json