blob: fc75f2053e270cff19d0366d934c26d6e969dc0c [file] [log] [blame]
Mohammed Naser3f961782023-04-20 10:48:21 -04001# Copyright (c) 2023 VEXXHOST, Inc.
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may
4# not use this file except in compliance with the License. You may obtain
5# a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations
13# under the License.
14
15- ansible.builtin.import_playbook: vexxhost.ceph.site
16- ansible.builtin.import_playbook: vexxhost.atmosphere.kubernetes
17
18# NOTE(mnaser): When using Docker with custom networks, it will use 127.0.0.11
19# as the DNS server which trips up the CoreDNS "loop" plugin.
20- name: Switch CoreDNS to use CloudFlare DNS
21 hosts: controllers[0]
22 become: true
23 tasks:
24 - name: Update CoreDNS ConfigMap
25 kubernetes.core.k8s:
26 state: present
27 definition:
28 apiVersion: v1
29 kind: ConfigMap
30 metadata:
31 name: coredns
32 namespace: kube-system
33 data:
34 Corefile: |
35 .:53 {
36 errors
37 health {
38 lameduck 5s
39 }
40 ready
41 kubernetes cluster.local in-addr.arpa ip6.arpa {
42 pods insecure
43 fallthrough in-addr.arpa ip6.arpa
44 ttl 30
45 }
46 prometheus :9153
47 forward . 1.1.1.1 {
48 max_concurrent 1000
49 }
50 cache 30
51 loop
52 reload
53 loadbalance
54 }
55 notify:
56 - Rollout CoreDNS
57 - Wait for CoreDNS to be ready
58 handlers:
59 - name: Rollout CoreDNS
60 command: kubectl -n kube-system rollout restart deploy/coredns
61 - name: Wait for CoreDNS to be ready
62 command: kubectl -n kube-system rollout status deploy/coredns
63
64- ansible.builtin.import_playbook: vexxhost.atmosphere.csi
65- ansible.builtin.import_playbook: vexxhost.atmosphere.openstack