sigs.k8s.io/external-dns@v0.14.1/docs/tutorials/bluecat.md (about)

     1  # Setting up external-dns for BlueCat
     2  
     3  The first external-dns release with with BlueCat provider support is v0.8.0.
     4  
     5  ## Prerequisites
     6  Install the BlueCat Gateway product and deploy the [community gateway workflows](https://github.com/bluecatlabs/gateway-workflows).
     7  
     8  ## Configuration Options
     9  
    10  There are two ways to pass configuration options to the Bluecat Provider JSON configuration file and command line flags. Currently if a valid configuration file is used all
    11  BlueCat provider configurations will be taken from the configuration file. If a configuraiton file is not provided or cannot be read then all BlueCat provider configurations will
    12  be taken from the command line flags. In the future an enhancement will be made to merge configuration options from the configuration file and command line flags if both are provided.
    13  
    14  BlueCat provider supports getting the proxy URL from the environment variables. The format is the one specified by golang's [http.ProxyFromEnvironment](https://pkg.go.dev/net/http#ProxyFromEnvironment).
    15  
    16  ### Using CLI Flags
    17  When using CLI flags to configure the Bluecat Provider the BlueCat Gateway credentials are passed in using environment variables `BLUECAT_USERNAME` and `BLUECAT_PASSWORD`.
    18  
    19  #### Deploy
    20  Setup up namespace, deployment, and service account:
    21  ```
    22  kubectl create namespace bluecat-example
    23  kubectl create secret generic bluecat-credentials --from-literal=username=bluecatuser --from-literal=password=bluecatpassword -n bluecat-example
    24  cat << EOF > ~/bluecat.yml
    25  ---
    26  apiVersion: v1
    27  kind: ServiceAccount
    28  metadata:
    29    name: external-dns
    30  ---
    31  apiVersion: apps/v1
    32  kind: Deployment
    33  metadata:
    34    name: external-dns
    35  spec:
    36    selector:
    37      matchLabels:
    38        app: external-dns
    39    strategy:
    40      type: Recreate
    41    template:
    42      metadata:
    43        labels:
    44          app: external-dns
    45      spec:
    46        serviceAccountName: external-dns
    47        containers:
    48        - name: external-dns
    49          image: registry.k8s.io/external-dns/external-dns:v0.14.0
    50          args:
    51          - --log-level=debug
    52          - --source=service
    53          - --provider=bluecat
    54          - --txt-owner-id=bluecat-example
    55          - --bluecat-dns-configuration=Example
    56          - --bluecat-dns-view=Internal
    57          - --bluecat-gateway-host=https://bluecatgw.example.com
    58          - --bluecat-root-zone=example.com
    59          env:
    60          - name: BLUECAT_USERNAME
    61            valueFrom:
    62              secretKeyRef:
    63                name: bluecat-credentials
    64                key: username
    65          - name: BLUECAT_PASSWORD
    66            valueFrom:
    67              secretKeyRef:
    68                name: bluecat-credentials
    69                key: password
    70  EOF
    71  kubectl apply -f ~/bluecat.yml -n bluecat-example
    72  ```
    73  
    74  
    75  ### Using JSON Configuration File
    76  The options for configuring the Bluecat Provider are available through the JSON file provided to External-DNS via the flag `--bluecat-config-file`.
    77  
    78  | Key               | Required           |
    79  | ----------------- | ------------------ |
    80  | gatewayHost       | Yes                |
    81  | gatewayUsername   | No                 |
    82  | gatewayPassword   | No                 |
    83  | dnsConfiguration  | Yes                |
    84  | dnsView           | Yes                |
    85  | rootZone          | Yes                |
    86  | dnsServerName     | No                 |
    87  | dnsDeployType     | No                 |
    88  | skipTLSVerify     | No (default false) |
    89  
    90  #### Deploy
    91  Setup configuration file as k8s `Secret`.
    92  ```
    93  cat << EOF > ~/bluecat.json
    94  {
    95    "gatewayHost": "https://bluecatgw.example.com",
    96    "gatewayUsername": "user",
    97    "gatewayPassword": "pass",
    98    "dnsConfiguration": "Example",
    99    "dnsView": "Internal",
   100    "rootZone": "example.com",
   101    "skipTLSVerify": false
   102  }
   103  EOF
   104  kubectl create secret generic bluecatconfig --from-file ~/bluecat.json -n bluecat-example
   105  ```
   106  
   107  Setup up namespace, deployment, and service account:
   108  ```
   109  kubectl create namespace bluecat-example
   110  cat << EOF > ~/bluecat.yml
   111  ---
   112  apiVersion: v1
   113  kind: ServiceAccount
   114  metadata:
   115    name: external-dns
   116  ---
   117  apiVersion: apps/v1
   118  kind: Deployment
   119  metadata:
   120    name: external-dns
   121  spec:
   122    selector:
   123      matchLabels:
   124        app: external-dns
   125    strategy:
   126      type: Recreate
   127    template:
   128      metadata:
   129        labels:
   130          app: external-dns
   131      spec:
   132        serviceAccountName: external-dns
   133        volumes:
   134          - name: bluecatconfig
   135            secret:
   136              secretName: bluecatconfig
   137        containers:
   138        - name: external-dns
   139          image: registry.k8s.io/external-dns/external-dns:v0.14.0
   140          volumeMounts:
   141            - name: bluecatconfig
   142              mountPath: "/etc/external-dns/"
   143              readOnly: true
   144          args:
   145          - --log-level=debug
   146          - --source=service
   147          - --provider=bluecat
   148          - --txt-owner-id=bluecat-example
   149          - --bluecat-config-file=/etc/external-dns/bluecat.json
   150  EOF
   151  kubectl apply -f ~/bluecat.yml -n bluecat-example
   152  ```