| # Copyright (c) 2023 VEXXHOST, Inc. |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| # not use this file except in compliance with the License. You may obtain |
| # a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| # License for the specific language governing permissions and limitations |
| # under the License. |
| |
| - ansible.builtin.import_playbook: vexxhost.atmosphere.kubernetes |
| |
| # NOTE(mnaser): When using Docker with custom networks, it will use 127.0.0.11 |
| # as the DNS server which trips up the CoreDNS "loop" plugin. |
| - name: Switch CoreDNS to use CloudFlare DNS |
| hosts: controllers[0] |
| become: true |
| tasks: |
| - name: Update CoreDNS ConfigMap |
| kubernetes.core.k8s: |
| state: present |
| definition: |
| apiVersion: v1 |
| kind: ConfigMap |
| metadata: |
| name: coredns |
| namespace: kube-system |
| data: |
| Corefile: | |
| .:53 { |
| errors |
| health { |
| lameduck 5s |
| } |
| ready |
| kubernetes cluster.local in-addr.arpa ip6.arpa { |
| pods insecure |
| fallthrough in-addr.arpa ip6.arpa |
| ttl 30 |
| } |
| prometheus :9153 |
| forward . 1.1.1.1 { |
| max_concurrent 1000 |
| } |
| cache 30 |
| loop |
| reload |
| loadbalance |
| } |
| notify: |
| - Rollout CoreDNS |
| - Wait for CoreDNS to be ready |
| handlers: |
| - name: Rollout CoreDNS |
| command: kubectl -n kube-system rollout restart deploy/coredns |
| - name: Wait for CoreDNS to be ready |
| command: kubectl -n kube-system rollout status deploy/coredns |
| |
| - ansible.builtin.import_playbook: vexxhost.atmosphere.csi |
| |
| - hosts: controllers |
| become: true |
| roles: |
| - vexxhost.atmosphere.ingress_nginx |