github.com/nginxinc/kubernetes-ingress@v1.12.5/examples/tcp-udp/dns.yaml (about)

     1  apiVersion: v1
     2  kind: ConfigMap
     3  metadata:
     4    name: coredns
     5  data:
     6    Corefile: |
     7      .:53 {
     8        forward . 8.8.8.8:53
     9        log
    10      }
    11  ---
    12  apiVersion: apps/v1
    13  kind: Deployment
    14  metadata:
    15    name: coredns
    16  spec:
    17    replicas: 2
    18    selector:
    19      matchLabels:
    20        app: coredns
    21    template:
    22      metadata:
    23        labels:
    24          app: coredns
    25      spec:
    26        containers:
    27        - name: coredns
    28          image: coredns/coredns:1.2.0
    29          args: [ "-conf", "/etc/coredns/Corefile" ]
    30          volumeMounts:
    31          - name: config-volume
    32            mountPath: /etc/coredns
    33            readOnly: true
    34          ports:
    35          - containerPort: 53
    36            name: dns
    37            protocol: UDP
    38          - containerPort: 53
    39            name: dns-tcp
    40            protocol: TCP
    41          securityContext:
    42            allowPrivilegeEscalation: false
    43            capabilities:
    44              add:
    45              - NET_BIND_SERVICE
    46              drop:
    47              - all
    48            readOnlyRootFilesystem: true
    49        volumes:
    50          - name: config-volume
    51            configMap:
    52              name: coredns
    53              items:
    54              - key: Corefile
    55                path: Corefile
    56  ---
    57  apiVersion: v1
    58  kind: Service
    59  metadata:
    60    name: coredns 
    61  spec:
    62    selector:
    63     app: coredns 
    64    ports:
    65    - name: dns
    66      port: 53
    67      protocol: UDP
    68    - name: dns-tcp
    69      port: 53
    70      protocol: TCP
    71  ---
    72  apiVersion: v1
    73  kind: Service
    74  metadata:
    75    name: coredns-headless
    76  spec:
    77    clusterIP: None
    78    selector:
    79     app: coredns 
    80    ports:
    81    - name: dns
    82      port: 53
    83      protocol: UDP
    84    - name: dns-tcp
    85      port: 53
    86      protocol: TCP