diff --git a/assets/files/etc/NetworkManager/dispatcher.d/pre-up.d/dns-vip-prepender b/assets/files/etc/NetworkManager/dispatcher.d/pre-up.d/dns-vip-prepender deleted file mode 100644 index 7608c1fdf..000000000 --- a/assets/files/etc/NetworkManager/dispatcher.d/pre-up.d/dns-vip-prepender +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -IFACE=$1 -STATUS=$2 - -case "$STATUS" in - pre-up) - logger -s "NM dns-vip-prepender triggered by pre-upping ${1}." - CLUSTER_DOMAIN="$(/usr/local/bin/clusterinfo DOMAIN)" - if ! HOST_QUERY="$(host ns1.${CLUSTER_DOMAIN})" ; then - logger -s "NM dns-vip-prepender: nameserver could not be resolved, exiting" - exit 0 - fi - DNS_VIP=$(echo "${HOST_QUERY}" | awk '{print $NF}') - set +e - if [[ -n $DNS_VIP ]]; then - logger -s "NM dns-vip-prepender: Checking if DNS VIP is the first entry in resolv.conf" - if grep nameserver /etc/resolv.conf | head -n 1 | grep -q "$DNS_VIP" ; then - logger -s "NM dns-vip-prepender: DNS VIP already the first entry in resolv.conf" - exit 0 - else - export DNS_VIP - - logger -s "NM dns-vip-prepender: Setting dhclient to prepend DNS VIP in resolv.conf" - envsubst < /etc/dhcp/dhclient.conf.template | tee /etc/dhcp/dhclient.conf - - logger -s "NM dns-vip-prepender: Looking for 'search $CLUSTER_DOMAIN' in /etc/resolv.conf to place 'nameserver $DNS_VIP'" - sed -i "/^search .*$/a nameserver $DNS_VIP" /etc/resolv.conf - logger -s -f /etc/resolv.conf - if ! grep -q $DNS_VIP /etc/resolv.conf; then - logger -s "NM dns-vip-prepender: Failed to add DNS VIP to resolv.conf" - exit 1 - fi - fi - fi - ;; - down) - logger -s "NM dns-vip-prepender triggered by downing $IFACE" - ;; - up) - logger -s "NM dns-vip-prepender triggered by upping $IFACE" - ;; - post-down) - logger -s "NM dns-vip-prepender triggered by post-downing $IFACE" - ;; - *) - ;; -esac diff --git a/assets/files/etc/NetworkManager/dispatcher.d/pre-up.d/dns-vip-prepender-worker b/assets/files/etc/NetworkManager/dispatcher.d/pre-up.d/dns-vip-prepender-worker deleted file mode 100644 index 527e0e621..000000000 --- a/assets/files/etc/NetworkManager/dispatcher.d/pre-up.d/dns-vip-prepender-worker +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -IFACE=$1 -STATUS=$2 - -case "$STATUS" in - pre-up) - logger -s "NM dns-vip-prepender-worker triggered by pre-upping ${1}." - CLUSTER_DOMAIN="$(/usr/local/bin/clusterinfo DOMAIN)" - DNS_VIP="127.0.0.1" - set +e - if [[ -n $DNS_VIP ]]; then - logger -s "NM dns-vip-prepender-worker: Checking if DNS VIP is the first entry in resolv.conf" - if grep nameserver /etc/resolv.conf | head -n 1 | grep -q "$DNS_VIP" ; then - logger -s "NM dns-vip-prepender-worker: DNS VIP already the first entry in resolv.conf" - exit 0 - else - export DNS_VIP - - logger -s "NM dns-vip-prepender-worker: Setting dhclient to prepend DNS VIP in resolv.conf" - envsubst < /etc/dhcp/dhclient.conf.template | tee /etc/dhcp/dhclient.conf - - logger -s "NM dns-vip-prepender-worker: Looking for 'search $CLUSTER_DOMAIN' in /etc/resolv.conf to place 'nameserver $DNS_VIP'" - sed -i "/^search .*$/a nameserver $DNS_VIP" /etc/resolv.conf - logger -s -f /etc/resolv.conf - if ! grep -q $DNS_VIP /etc/resolv.conf; then - logger -s "NM dns-vip-prepender-worker: Failed to add DNS VIP to resolv.conf" - exit 1 - fi - fi - fi - ;; - down) - logger -s "NM dns-vip-prepender-worker triggered by downing $IFACE" - ;; - up) - logger -s "NM dns-vip-prepender-worker triggered by upping $IFACE" - ;; - post-down) - logger -s "NM dns-vip-prepender-worker triggered by post-downing $IFACE" - ;; - *) - ;; -esac diff --git a/assets/files/etc/dhcp/dhclient.conf.template b/assets/files/etc/dhcp/dhclient.conf.template deleted file mode 100644 index 6803fa5d5..000000000 --- a/assets/files/etc/dhcp/dhclient.conf.template +++ /dev/null @@ -1 +0,0 @@ -prepend domain-name-servers ${DNS_VIP}; diff --git a/assets/files/etc/kubernetes/manifests/coredns.yaml b/assets/files/etc/kubernetes/manifests/coredns.yaml deleted file mode 100644 index 499371db4..000000000 --- a/assets/files/etc/kubernetes/manifests/coredns.yaml +++ /dev/null @@ -1,87 +0,0 @@ ---- -kind: Pod -apiVersion: v1 -metadata: - name: coredns - namespace: openshift-kni-infra - creationTimestamp: - deletionGracePeriodSeconds: 65 - labels: - app: kni-infra-mdns -spec: - volumes: - - name: resource-dir - hostPath: - path: "/etc/kubernetes/static-pod-resources/coredns" - - name: kubeconfig - hostPath: - path: "/etc/kubernetes/kubeconfig" - - name: conf-dir - empty-dir: {} - initContainers: - - name: clusterrc-generation - image: quay.io/openshift-metal3/kubeconfig-extractor:latest - command: - - "/usr/bin/kubeconfig-extractor" - args: - - "/etc/kubernetes/kubeconfig" - - "/etc/kubernetes/static-pod-resources/clusterrc" - resources: {} - volumeMounts: - - name: resource-dir - mountPath: "/etc/kubernetes/static-pod-resources" - - name: kubeconfig - mountPath: "/etc/kubernetes/kubeconfig" - - name: render-corefile - image: quay.io/openshift/origin-node:latest - command: - - "/bin/bash" - - "-c" - - | - #/bin/bash - set -ex - - source /etc/kubernetes/static-pod-resources/clusterrc - export DOMAIN - export NAME - # This should eventually be looked up from the config - API_VIP="$(dig +noall +answer "api.${DOMAIN}" | awk '{print $NF}')" - export API_VIP - /usr/libexec/platform-python -c "from __future__ import print_function - import os - with open('/etc/kubernetes/static-pod-resources/Corefile.template', 'r') as f: - content = f.read() - with open('/etc/coredns/Corefile', 'w') as dest: - print(os.path.expandvars(content), file=dest)" - - DNS_VIP="$(dig +noall +answer "ns1.${DOMAIN}" | awk '{print $NF}')" - grep -v "${DNS_VIP}" /etc/resolv.conf | tee /etc/coredns/resolv.conf - resources: {} - volumeMounts: - - name: resource-dir - mountPath: "/etc/kubernetes/static-pod-resources" - - name: conf-dir - mountPath: "/etc/coredns" - imagePullPolicy: IfNotPresent - containers: - - name: coredns - securityContext: - privileged: true - image: quay.io/openshift-metal3/coredns-mdns:latest - args: - - "--conf" - - "/etc/coredns/Corefile" - resources: - requests: - cpu: 150m - memory: 1Gi - volumeMounts: - - name: conf-dir - mountPath: "/etc/coredns" - terminationMessagePolicy: FallbackToLogsOnError - imagePullPolicy: IfNotPresent - hostNetwork: true - tolerations: - - operator: Exists - priorityClassName: system-node-critical -status: {} diff --git a/assets/files/etc/kubernetes/manifests/haproxy.yaml b/assets/files/etc/kubernetes/manifests/haproxy.yaml deleted file mode 100644 index 65ff4dbb9..000000000 --- a/assets/files/etc/kubernetes/manifests/haproxy.yaml +++ /dev/null @@ -1,143 +0,0 @@ ---- -kind: Pod -apiVersion: v1 -metadata: - name: haproxy - namespace: openshift-kni-infra - creationTimestamp: - deletionGracePeriodSeconds: 65 - labels: - app: kni-infra-api-lb -spec: - volumes: - - name: resource-dir - hostPath: - path: "/etc/kubernetes/static-pod-resources/haproxy" - - name: kubeconfig - hostPath: - path: "/etc/kubernetes/kubeconfig" - - name: run-dir - empty-dir: {} - - name: conf-dir - empty-dir: {} - - name: chroot-host - hostPath: - path: "/" - initContainers: - - name: clusterrc-generation - image: quay.io/openshift-metal3/kubeconfig-extractor:latest - command: - - "/usr/bin/kubeconfig-extractor" - args: - - "/etc/kubernetes/kubeconfig" - - "/etc/kubernetes/static-pod-resources/clusterrc" - resources: {} - volumeMounts: - - name: resource-dir - mountPath: "/etc/kubernetes/static-pod-resources" - - name: kubeconfig - mountPath: "/etc/kubernetes/kubeconfig" - - name: render-haproxy-cfg - image: quay.io/openshift/origin-node:latest - env: - - name: api_port - value: "6443" - - name: stat_port - value: "50000" - command: - - "/bin/bash" - - "-c" - - | - #/bin/bash - set -ex - - source /etc/kubernetes/static-pod-resources/clusterrc - source /etc/kubernetes/static-pod-resources/utils.sh - generate_cfg \ - /etc/kubernetes/static-pod-resources/haproxy.cfg.template \ - /etc/haproxy/haproxy.cfg \ - "$DOMAIN" \ - "$api_port" \ - "$stat_port" - resources: {} - volumeMounts: - - name: resource-dir - mountPath: "/etc/kubernetes/static-pod-resources" - - name: conf-dir - mountPath: "/etc/haproxy" - imagePullPolicy: IfNotPresent - containers: - - name: haproxy - image: docker.io/library/haproxy:latest - args: - - "-W" - - "-db" - - "-S" - - "/var/run/haproxy/haproxy-master.sock,level,admin" - - "-f" - - "/etc/haproxy/haproxy.cfg" - volumeMounts: - - name: conf-dir - mountPath: "/etc/haproxy" - - name: run-dir - mountPath: "/var/run/haproxy" - terminationMessagePolicy: FallbackToLogsOnError - imagePullPolicy: IfNotPresent - - name: haproxy-monitor - securityContext: - privileged: true - image: quay.io/openshift/origin-node:latest - env: - - name: cfg_path - value: "/etc/haproxy/haproxy.cfg" - - name: api_port - value: "6443" - - name: lb_port - value: "7443" - - name: stat_port - value: "50000" - command: - - "/bin/bash" - - "-c" - - | - #/bin/bash - set -ex - - source /etc/kubernetes/static-pod-resources/clusterrc - source /etc/kubernetes/static-pod-resources/utils.sh - API_VIP="$(dig +noall +answer "api.${DOMAIN}" | awk '{print $NF}')" - - trap clean_prerouting_rules SIGINT SIGTERM - while true; do - sleep 15 - if has_master_api_lb_topology_changed "$DOMAIN" "$cfg_path"; then - (>&2 echo "Master topology changed. Reconfiguring and hot restarting HAProxy") - generate_cfg \ - /etc/kubernetes/static-pod-resources/haproxy.cfg.template \ - "$cfg_path" \ - "$DOMAIN" \ - "$api_port" \ - "$stat_port" - echo "reload" | socat /var/run/haproxy/haproxy-master.sock - - fi - if curl -o /dev/null -kLs "https://0:${lb_port}/healthz"; then - (>&2 echo "API is accessible via LB") - ensure_prerouting_rules "$API_VIP" "$api_port" "$lb_port" - fi - done - volumeMounts: - - name: conf-dir - mountPath: "/etc/haproxy" - - name: run-dir - mountPath: "/var/run/haproxy" - - name: resource-dir - mountPath: "/etc/kubernetes/static-pod-resources" - - name: chroot-host - mountPath: "/host" - terminationMessagePolicy: FallbackToLogsOnError - imagePullPolicy: IfNotPresent - hostNetwork: true - tolerations: - - operator: Exists - priorityClassName: system-node-critical -status: {} diff --git a/assets/files/etc/kubernetes/manifests/keepalived.yaml b/assets/files/etc/kubernetes/manifests/keepalived.yaml deleted file mode 100644 index bc03bf818..000000000 --- a/assets/files/etc/kubernetes/manifests/keepalived.yaml +++ /dev/null @@ -1,120 +0,0 @@ ---- -kind: Pod -apiVersion: v1 -metadata: - name: keepalived - namespace: openshift-kni-infra - creationTimestamp: - deletionGracePeriodSeconds: 65 - labels: - app: kni-infra-vrrp -spec: - volumes: - - name: resource-dir - hostPath: - path: "/etc/kubernetes/static-pod-resources/keepalived" - - name: kubeconfig - hostPath: - path: "/etc/kubernetes/kubeconfig" - - name: get-vip-subnet-cidr - hostPath: - path: "/usr/local/bin/get_vip_subnet_cidr" - - name: fletcher8 - hostPath: - path: "/usr/local/bin/fletcher8" - - name: conf-dir - empty-dir: {} - initContainers: - - name: clusterrc-generation - image: quay.io/openshift-metal3/kubeconfig-extractor:latest - command: - - "/usr/bin/kubeconfig-extractor" - args: - - "/etc/kubernetes/kubeconfig" - - "/etc/kubernetes/static-pod-resources/clusterrc" - resources: {} - volumeMounts: - - name: resource-dir - mountPath: "/etc/kubernetes/static-pod-resources" - - name: kubeconfig - mountPath: "/etc/kubernetes/kubeconfig" - - name: render-keepalived-conf - image: quay.io/openshift/origin-node:latest - command: - - "/bin/bash" - - "-c" - - | - #/bin/bash - set -ex - - source /etc/kubernetes/static-pod-resources/clusterrc - CLUSTER_NAME="$NAME" - API_VIP="$(dig +noall +answer "api.${DOMAIN}" | awk '{print $NF}')" - IFACE_CIDRS="$(ip addr show | grep -v "scope host" | grep -Po 'inet \K[\d.]+/[\d.]+' | xargs)" - SUBNET_CIDR="$(/usr/local/bin/get_vip_subnet_cidr "$API_VIP" "$IFACE_CIDRS")" - NET_MASK="$(echo $SUBNET_CIDR | cut -d "/" -f 2)" - INTERFACE="$(ip -o addr show to "$SUBNET_CIDR" | awk '{print $2;exit}')" - DNS_VIP="$(dig +noall +answer "ns1.${DOMAIN}" | awk '{print $NF}')" - INGRESS_VIP="$(dig +noall +answer "test.apps.${DOMAIN}" | awk '{print $NF}')" - - # Virtual Router IDs. They must be different and 8 bit in length - API_VRID=$(/usr/local/bin/fletcher8 "${CLUSTER_NAME}-api") - DNS_VRID=$(/usr/local/bin/fletcher8 "${CLUSTER_NAME}-dns") - INGRESS_VRID=$(/usr/local/bin/fletcher8 "${CLUSTER_NAME}-ingress") - - export DOMAIN - export CLUSTER_NAME - export INTERFACE - export API_VIP - export DNS_VIP - export INGRESS_VIP - export API_VRID - export DNS_VRID - export INGRESS_VRID - export NET_MASK - /usr/libexec/platform-python -c "from __future__ import print_function - import os - with open('/etc/kubernetes/static-pod-resources/keepalived.conf.template', 'r') as f: - content = f.read() - with open('/etc/keepalived/keepalived.conf', 'w') as dest: - print(os.path.expandvars(content), file=dest)" - - resources: {} - volumeMounts: - - name: resource-dir - mountPath: "/etc/kubernetes/static-pod-resources" - - name: conf-dir - mountPath: "/etc/keepalived" - - name: get-vip-subnet-cidr - mountPath: "/usr/local/bin/get_vip_subnet_cidr" - - name: fletcher8 - mountPath: "/usr/local/bin/fletcher8" - imagePullPolicy: IfNotPresent - containers: - - name: keepalived - securityContext: - privileged: true - image: quay.io/celebdor/keepalived:latest - command: - - /usr/sbin/keepalived - args: - - "-f" - - "/etc/keepalived/keepalived.conf" - - "--dont-fork" - - "--vrrp" - - "--log-detail" - - "--log-console" - resources: - requests: - cpu: 150m - memory: 1Gi - volumeMounts: - - name: conf-dir - mountPath: "/etc/keepalived" - terminationMessagePolicy: FallbackToLogsOnError - imagePullPolicy: IfNotPresent - hostNetwork: true - tolerations: - - operator: Exists - priorityClassName: system-node-critical -status: {} diff --git a/assets/files/etc/kubernetes/manifests/mdns-publisher-worker.yaml b/assets/files/etc/kubernetes/manifests/mdns-publisher-worker.yaml deleted file mode 100644 index c2ffa376f..000000000 --- a/assets/files/etc/kubernetes/manifests/mdns-publisher-worker.yaml +++ /dev/null @@ -1,98 +0,0 @@ ---- -kind: Pod -apiVersion: v1 -metadata: - name: mdns-publisher - namespace: openshift-kni-infra - creationTimestamp: - deletionGracePeriodSeconds: 65 - labels: - app: kni-infra-mdns -spec: - volumes: - - name: resource-dir - hostPath: - path: "/etc/kubernetes/static-pod-resources/mdns" - - name: kubeconfig - hostPath: - path: "/etc/kubernetes/kubeconfig" - - name: get-vip-subnet-cidr - hostPath: - path: "/usr/local/bin/get_vip_subnet_cidr" - - name: conf-dir - empty-dir: {} - initContainers: - - name: clusterrc-generation - image: quay.io/openshift-metal3/kubeconfig-extractor:latest - command: - - "/usr/bin/kubeconfig-extractor" - args: - - "/etc/kubernetes/kubeconfig" - - "/etc/kubernetes/static-pod-resources/clusterrc" - resources: {} - volumeMounts: - - name: resource-dir - mountPath: "/etc/kubernetes/static-pod-resources" - - name: kubeconfig - mountPath: "/etc/kubernetes/kubeconfig" - - name: render-config - image: quay.io/openshift/origin-node:latest - command: - - "/bin/bash" - - "-c" - - | - #/bin/bash - set -ex - - source /etc/kubernetes/static-pod-resources/clusterrc - CLUSTER_NAME="$NAME" - API_VIP="$(dig +noall +answer "api.${DOMAIN}" | awk '{print $NF}')" - IFACE_CIDRS="$(ip addr show | grep -v "scope host" | grep -Po 'inet \K[\d.]+/[\d.]+' | xargs)" - SUBNET_CIDR="$(/usr/local/bin/get_vip_subnet_cidr "$API_VIP" "$IFACE_CIDRS")" - PREFIX="${SUBNET_CIDR#*/}" - DNS_VIP="$(dig +noall +answer "ns1.${DOMAIN}" | awk '{print $NF}')" - ONE_CIDR="$(ip addr show to "$SUBNET_CIDR" | \ - grep -Po 'inet \K[\d.]+/[\d.]+' | \ - grep -v "${DNS_VIP}/$PREFIX" | \ - sort | xargs | cut -f1 -d' ')" - - NON_VIRTUAL_IP="${ONE_CIDR%/*}" - SHORT_HOSTNAME="$(hostname -s).local." - - export SHORT_HOSTNAME - export NON_VIRTUAL_IP - export CLUSTER_NAME - /usr/libexec/platform-python -c "from __future__ import print_function - import os - with open('/etc/kubernetes/static-pod-resources/worker-config.template', 'r') as f: - content = f.read() - with open('/etc/mdns/config.hcl', 'w') as dest: - print(os.path.expandvars(content), file=dest)" - resources: {} - volumeMounts: - - name: resource-dir - mountPath: "/etc/kubernetes/static-pod-resources" - - name: conf-dir - mountPath: "/etc/mdns" - - name: get-vip-subnet-cidr - mountPath: "/usr/local/bin/get_vip_subnet_cidr" - imagePullPolicy: IfNotPresent - containers: - - name: mdns-publisher - image: quay.io/openshift-metal3/mdns-publisher:latest - args: - - "--debug" - resources: - requests: - cpu: 150m - memory: 1Gi - volumeMounts: - - name: conf-dir - mountPath: "/etc/mdns" - terminationMessagePolicy: FallbackToLogsOnError - imagePullPolicy: IfNotPresent - hostNetwork: true - tolerations: - - operator: Exists - priorityClassName: system-node-critical -status: {} diff --git a/assets/files/etc/kubernetes/manifests/mdns-publisher.yaml b/assets/files/etc/kubernetes/manifests/mdns-publisher.yaml deleted file mode 100644 index 12b3d9e38..000000000 --- a/assets/files/etc/kubernetes/manifests/mdns-publisher.yaml +++ /dev/null @@ -1,101 +0,0 @@ ---- -kind: Pod -apiVersion: v1 -metadata: - name: mdns-publisher - namespace: openshift-kni-infra - creationTimestamp: - deletionGracePeriodSeconds: 65 - labels: - app: kni-infra-mdns -spec: - volumes: - - name: resource-dir - hostPath: - path: "/etc/kubernetes/static-pod-resources/mdns" - - name: kubeconfig - hostPath: - path: "/etc/kubernetes/kubeconfig" - - name: get-vip-subnet-cidr - hostPath: - path: "/usr/local/bin/get_vip_subnet_cidr" - - name: conf-dir - empty-dir: {} - initContainers: - - name: clusterrc-generation - image: quay.io/openshift-metal3/kubeconfig-extractor:latest - command: - - "/usr/bin/kubeconfig-extractor" - args: - - "/etc/kubernetes/kubeconfig" - - "/etc/kubernetes/static-pod-resources/clusterrc" - resources: {} - volumeMounts: - - name: resource-dir - mountPath: "/etc/kubernetes/static-pod-resources" - - name: kubeconfig - mountPath: "/etc/kubernetes/kubeconfig" - - name: render-config - image: quay.io/openshift/origin-node:latest - command: - - "/bin/bash" - - "-c" - - | - #/bin/bash - set -ex - - source /etc/kubernetes/static-pod-resources/clusterrc - CLUSTER_NAME="$NAME" - API_VIP="$(dig +noall +answer "api.${DOMAIN}" | awk '{print $NF}')" - IFACE_CIDRS="$(ip addr show | grep -v "scope host" | grep -Po 'inet \K[\d.]+/[\d.]+' | xargs)" - SUBNET_CIDR="$(/usr/local/bin/get_vip_subnet_cidr "$API_VIP" "$IFACE_CIDRS")" - PREFIX="${SUBNET_CIDR#*/}" - DNS_VIP="$(dig +noall +answer "ns1.${DOMAIN}" | awk '{print $NF}')" - ONE_CIDR="$(ip addr show to "$SUBNET_CIDR" | \ - grep -Po 'inet \K[\d.]+/[\d.]+' | \ - grep -v "${DNS_VIP}/$PREFIX" | \ - grep -v "${API_VIP}/$PREFIX" | \ - sort | xargs | cut -f1 -d' ')" - - NON_VIRTUAL_IP="${ONE_CIDR%/*}" - MASTER_HOSTNAME="$(hostname -s).local." - ETCD_HOSTNAME="$(echo "$MASTER_HOSTNAME" | sed 's;master;etcd;')" - export MASTER_HOSTNAME - export ETCD_HOSTNAME - export NON_VIRTUAL_IP - export DOMAIN - export CLUSTER_NAME - /usr/libexec/platform-python -c "from __future__ import print_function - import os - with open('/etc/kubernetes/static-pod-resources/config.template', 'r') as f: - content = f.read() - with open('/etc/mdns/config.hcl', 'w') as dest: - print(os.path.expandvars(content), file=dest)" - resources: {} - volumeMounts: - - name: resource-dir - mountPath: "/etc/kubernetes/static-pod-resources" - - name: conf-dir - mountPath: "/etc/mdns" - - name: get-vip-subnet-cidr - mountPath: "/usr/local/bin/get_vip_subnet_cidr" - imagePullPolicy: IfNotPresent - containers: - - name: mdns-publisher - image: quay.io/openshift-metal3/mdns-publisher:latest - args: - - "--debug" - resources: - requests: - cpu: 150m - memory: 1Gi - volumeMounts: - - name: conf-dir - mountPath: "/etc/mdns" - terminationMessagePolicy: FallbackToLogsOnError - imagePullPolicy: IfNotPresent - hostNetwork: true - tolerations: - - operator: Exists - priorityClassName: system-node-critical -status: {} diff --git a/assets/files/etc/kubernetes/static-pod-resources/coredns/Corefile.template b/assets/files/etc/kubernetes/static-pod-resources/coredns/Corefile.template deleted file mode 100644 index 817fdf2a7..000000000 --- a/assets/files/etc/kubernetes/static-pod-resources/coredns/Corefile.template +++ /dev/null @@ -1,12 +0,0 @@ -. { - errors - health - mdns $DOMAIN 0 $NAME - forward . /etc/coredns/resolv.conf - cache 30 - reload - hosts /etc/coredns/api-int.hosts $DOMAIN { - $API_VIP api-int.$DOMAIN - fallthrough - } -} diff --git a/assets/files/etc/kubernetes/static-pod-resources/haproxy/haproxy.cfg.template b/assets/files/etc/kubernetes/static-pod-resources/haproxy/haproxy.cfg.template deleted file mode 100644 index 32fe8f986..000000000 --- a/assets/files/etc/kubernetes/static-pod-resources/haproxy/haproxy.cfg.template +++ /dev/null @@ -1,27 +0,0 @@ -defaults - mode tcp - log global - option dontlognull - retries 3 - timeout http-request 10s - timeout queue 1m - timeout connect 10s - timeout client 86400s - timeout server 86400s - timeout tunnel 86400s -frontend main - bind :7443 - default_backend masters -listen stats - bind 127.0.0.1:${STAT_PORT} - mode http - stats enable - stats hide-version - stats uri /haproxy_stats - stats refresh 30s - stats auth Username:Password -backend masters - option httpchk GET /healthz HTTP/1.0 - option log-health-checks - balance roundrobin -${BACKENDS} diff --git a/assets/files/etc/kubernetes/static-pod-resources/haproxy/utils.sh b/assets/files/etc/kubernetes/static-pod-resources/haproxy/utils.sh deleted file mode 100644 index 8a235ff26..000000000 --- a/assets/files/etc/kubernetes/static-pod-resources/haproxy/utils.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/env bash - -function etcd_members { - declare -r domain="$1" - dig +noall +answer -t SRV "_etcd-server-ssl._tcp.$domain" | awk '{print $NF}' -} - -function first_a_addr { - declare -r name="$1" - dig +noall +answer "$name" | awk '$4 == "A" {print $NF; exit}' -} - -function get_backends { - declare -r domain="$1" - declare -r api_port="$2" - local ip - - for item in $(etcd_members "$domain"); do - if ip="$(first_a_addr "$item")" && [[ -n "$ip" ]]; then - echo " server $item ${ip}:$api_port weight 1 verify none check check-ssl inter 3s fall 3 rise 3" - fi - done -} - -function has_master_api_lb_topology_changed { - declare -r domain="$1" - declare -r cfg_path="$2" - local ip - local haproxy_cfg_ip - - for item in $(etcd_members "$domain"); do - ip=$(first_a_addr "$item") - haproxy_cfg_ip=$(awk -v "server=$item" '$2 == server {print substr($3, 0, index($3, ":") - 1); exit}' "$cfg_path") - if [[ -n "$ip" ]]; then - if [[ "$haproxy_cfg_ip" != "$ip" ]]; then - return 0 - fi - fi - done - return 1 -} - -function generate_cfg { - declare -r template_path="$1" - declare -r cfg_path="$2" - declare -r domain="$3" - declare -r api_port="$4" - declare -r STAT_PORT="$5" - local BACKENDS - - BACKENDS="$(get_backends "$domain" "$api_port")" - - export BACKENDS - export STAT_PORT - /usr/libexec/platform-python -c "from __future__ import print_function -import os -with open('${template_path}', 'r') as f: - content = f.read() -with open('${cfg_path}', 'w') as dest: - print(os.path.expandvars(content), file=dest)" -} - -function ensure_prerouting_rules { - declare -r api_vip="$1" - declare -r api_port="$2" - declare -r lb_port="$3" - declare -r rules=$(iptables -w 10 -L PREROUTING -n -t nat --line-numbers | awk '/OCP_API_LB_REDIRECT/ {print $1}' | tac) - if [[ -z "$rules" ]]; then - (>&2 echo "Setting prerouting rule from ${api_vip}:${api_port} to port $lb_port") - iptables -t nat -I PREROUTING --src 0/0 --dst "$api_vip" -p tcp --dport "$api_port" -j REDIRECT --to-ports "$lb_port" -m comment --comment "OCP_API_LB_REDIRECT" - fi -} - -function clean_prerouting_rules { - (>&2 echo "Deleting API HAProxy IPtables rule") - - declare -r rules=$(iptables -w 10 -L PREROUTING -n -t nat --line-numbers | awk '/OCP_API_LB_REDIRECT/ {print $1}' | tac) - for rule in $rules; do - iptables -t nat -D PREROUTING "$rule" - done - - trap - SIGINT SIGTERM -} diff --git a/assets/files/etc/kubernetes/static-pod-resources/keepalived/keepalived.conf.template b/assets/files/etc/kubernetes/static-pod-resources/keepalived/keepalived.conf.template deleted file mode 100644 index a0b3b2af4..000000000 --- a/assets/files/etc/kubernetes/static-pod-resources/keepalived/keepalived.conf.template +++ /dev/null @@ -1,71 +0,0 @@ -vrrp_script chk_ocp { - script "curl -o /dev/null -kLs https://0:6443/readyz" - interval 1 - weight 50 -} - -vrrp_script chk_dns { - script "host -t SRV _etcd-server-ssl._tcp.${DOMAIN} localhost" - interval 1 - weight 50 -} - -vrrp_script chk_ingress { - script "curl -o /dev/null -kLs https://0:1936/healthz" - interval 1 - weight 50 -} - -vrrp_instance ${CLUSTER_NAME}_API { - state BACKUP - interface ${INTERFACE} - virtual_router_id ${API_VRID} - priority 40 - advert_int 1 - authentication { - auth_type PASS - auth_pass ${CLUSTER_NAME}_api_vip - } - virtual_ipaddress { - ${API_VIP}/${NET_MASK} - } - track_script { - chk_ocp - } -} - -vrrp_instance ${CLUSTER_NAME}_DNS { - state BACKUP - interface ${INTERFACE} - virtual_router_id ${DNS_VRID} - priority 40 - advert_int 1 - authentication { - auth_type PASS - auth_pass ${CLUSTER_NAME}_dns_vip - } - virtual_ipaddress { - ${DNS_VIP}/${NET_MASK} - } - track_script { - chk_dns - } -} - -vrrp_instance ${CLUSTER_NAME}_INGRESS { - state BACKUP - interface ${INTERFACE} - virtual_router_id ${INGRESS_VRID} - priority 40 - advert_int 1 - authentication { - auth_type PASS - auth_pass cluster_uuid_ingress_vip - } - virtual_ipaddress { - ${INGRESS_VIP}/${NET_MASK} - } - track_script { - chk_ingress - } -} diff --git a/assets/files/etc/kubernetes/static-pod-resources/mdns/config.template b/assets/files/etc/kubernetes/static-pod-resources/mdns/config.template deleted file mode 100644 index 605b657bd..000000000 --- a/assets/files/etc/kubernetes/static-pod-resources/mdns/config.template +++ /dev/null @@ -1,29 +0,0 @@ -bind_address = "$NON_VIRTUAL_IP" -collision_avoidance = "hostname" - -service { - name = "$CLUSTER_NAME Etcd" - host_name = "$ETCD_HOSTNAME" - type = "_etcd-server-ssl._tcp" - domain = "local." - port = 2380 - ttl = 3200 -} - -service { - name = "$CLUSTER_NAME Workstation" - host_name = "$MASTER_HOSTNAME" - type = "_workstation._tcp" - domain = "local." - port = 42424 - ttl = 3200 -} - -service { - name = "$CLUSTER_NAME EtcdWorkstation" - host_name = "$ETCD_HOSTNAME" - type = "_workstation._tcp" - domain = "local." - port = 42424 - ttl = 300 -} diff --git a/assets/files/etc/kubernetes/static-pod-resources/mdns/worker-config.template b/assets/files/etc/kubernetes/static-pod-resources/mdns/worker-config.template deleted file mode 100644 index 298f99f3c..000000000 --- a/assets/files/etc/kubernetes/static-pod-resources/mdns/worker-config.template +++ /dev/null @@ -1,11 +0,0 @@ -bind_address = "$NON_VIRTUAL_IP" -collision_avoidance = "hostname" - -service { - name = "$CLUSTER_NAME Workstation" - host_name = "$SHORT_HOSTNAME" - type = "_workstation._tcp" - domain = "local." - port = 42424 - ttl = 3200 -} diff --git a/assets/files/usr/local/bin/clusterinfo b/assets/files/usr/local/bin/clusterinfo deleted file mode 100755 index 7c798fdfd..000000000 --- a/assets/files/usr/local/bin/clusterinfo +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -export KUBECONFIG=/etc/kubernetes/kubeconfig -CURRENT_CONTEXT=$(oc config view -o jsonpath='{.current-context}') -NAME=$(oc config view -o "jsonpath={.contexts[?(@.name == '""$CURRENT_CONTEXT""')].context.cluster}") -APIURL=$(oc config view -o "jsonpath={.clusters[?(@.name == '""$NAME""')].cluster.server}") -APIHOST=$(echo $APIURL | sed -e 's/.*\/\/\([^:]\+\).*/\1/g') -DOMAIN=${APIHOST#*.} -NAME_FROM_DOMAIN=${DOMAIN%%.*} -BASE_DOMAIN=${DOMAIN#*.} - -echo ${!1} diff --git a/assets/files/usr/local/bin/fletcher8 b/assets/files/usr/local/bin/fletcher8 deleted file mode 100644 index 901544f36..000000000 --- a/assets/files/usr/local/bin/fletcher8 +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/libexec/platform-python -import sys - -data = map(ord, sys.argv[1]) -ckA = ckB = 0 - -for b in data: - ckA = (ckA + b) & 0xf - ckB = (ckB + ckA) & 0xf -print((ckB << 4) | ckA ) diff --git a/assets/files/usr/local/bin/get_vip_subnet_cidr b/assets/files/usr/local/bin/get_vip_subnet_cidr deleted file mode 100644 index 4868cca81..000000000 --- a/assets/files/usr/local/bin/get_vip_subnet_cidr +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/libexec/platform-python -import sys -import socket -import struct - -vip = sys.argv[1] -iface_cidrs = sys.argv[2].split() -vip_int = struct.unpack("!I", socket.inet_aton(vip))[0] - -for iface_cidr in iface_cidrs: - ip, prefix = iface_cidr.split('/') - ip_int = struct.unpack("!I", socket.inet_aton(ip))[0] - prefix_int = int(prefix) - mask = int('1' * prefix_int + '0' * (32 - prefix_int), 2) - subnet_ip_int_min = ip_int & mask - subnet_ip = socket.inet_ntoa(struct.pack("!I", subnet_ip_int_min)) - subnet_ip_int_max = subnet_ip_int_min | int('1' * (32 - prefix_int), 2) - subnet_ip_max = socket.inet_ntoa(struct.pack("!I", subnet_ip_int_max)) - sys.stderr.write('Is %s between %s and %s\n' % (vip, subnet_ip, subnet_ip_max)) - if subnet_ip_int_min < vip_int < subnet_ip_int_max: - subnet_ip = socket.inet_ntoa(struct.pack("!I", subnet_ip_int_min)) - print('%s/%s' % (subnet_ip, prefix)) - sys.exit(0) -sys.exit(1) diff --git a/assets/templates/99_master-api-haproxy.yaml b/assets/templates/99_master-api-haproxy.yaml deleted file mode 100644 index 3928fb031..000000000 --- a/assets/templates/99_master-api-haproxy.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: machineconfiguration.openshift.io/v1 -kind: MachineConfig -metadata: - generation: 1 - labels: - machineconfiguration.openshift.io/role: master - name: 00-master-api-haproxy -spec: - config: - ignition: - version: 2.2.0 - storage: - files: - - contents: - verification: {} - filesystem: root - mode: 0664 - path: /etc/kubernetes/manifests/haproxy.yaml - - contents: - verification: {} - filesystem: root - mode: 0664 - path: /etc/kubernetes/static-pod-resources/haproxy/haproxy.cfg.template - - contents: - verification: {} - filesystem: root - mode: 0755 - path: /etc/kubernetes/static-pod-resources/haproxy/utils.sh diff --git a/assets/templates/99_master-coredns.yaml b/assets/templates/99_master-coredns.yaml deleted file mode 100644 index 29d5fa547..000000000 --- a/assets/templates/99_master-coredns.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: machineconfiguration.openshift.io/v1 -kind: MachineConfig -metadata: - generation: 1 - labels: - machineconfiguration.openshift.io/role: master - name: 00-master-coredns -spec: - config: - ignition: - version: 2.2.0 - storage: - files: - - contents: - verification: {} - filesystem: root - mode: 0664 - path: /etc/kubernetes/manifests/coredns.yaml - - contents: - verification: {} - filesystem: root - mode: 0664 - path: /etc/kubernetes/static-pod-resources/coredns/Corefile.template diff --git a/assets/templates/99_master-dhclient-dns.yaml b/assets/templates/99_master-dhclient-dns.yaml deleted file mode 100644 index a3f971c25..000000000 --- a/assets/templates/99_master-dhclient-dns.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: machineconfiguration.openshift.io/v1 -kind: MachineConfig -metadata: - generation: 1 - labels: - machineconfiguration.openshift.io/role: master - name: 00-master-dhclient-dns -spec: - config: - ignition: - version: 2.2.0 - storage: - files: - - contents: - verification: {} - filesystem: root - mode: 0664 - path: /etc/dhcp/dhclient.conf.template - - contents: - verification: {} - filesystem: root - mode: 0755 - path: /etc/NetworkManager/dispatcher.d/pre-up.d/dns-vip-prepender diff --git a/assets/templates/99_master-keepalived.yaml b/assets/templates/99_master-keepalived.yaml deleted file mode 100644 index 8d1207557..000000000 --- a/assets/templates/99_master-keepalived.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: machineconfiguration.openshift.io/v1 -kind: MachineConfig -metadata: - generation: 1 - labels: - machineconfiguration.openshift.io/role: master - name: 00-master-keepalived -spec: - config: - ignition: - version: 2.2.0 - storage: - files: - - contents: - verification: {} - filesystem: root - mode: 0664 - path: /etc/kubernetes/manifests/keepalived.yaml - - contents: - verification: {} - filesystem: root - mode: 0664 - path: /etc/kubernetes/static-pod-resources/keepalived/keepalived.conf.template diff --git a/assets/templates/99_master-mdns-publisher.yaml b/assets/templates/99_master-mdns-publisher.yaml deleted file mode 100644 index c47195a5d..000000000 --- a/assets/templates/99_master-mdns-publisher.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: machineconfiguration.openshift.io/v1 -kind: MachineConfig -metadata: - generation: 1 - labels: - machineconfiguration.openshift.io/role: master - name: 00-master-mdns-publisher -spec: - config: - ignition: - version: 2.2.0 - storage: - files: - - contents: - verification: {} - filesystem: root - mode: 0664 - path: /etc/kubernetes/manifests/mdns-publisher.yaml - - contents: - verification: {} - filesystem: root - mode: 0664 - path: /etc/kubernetes/static-pod-resources/mdns/config.template diff --git a/assets/templates/99_master-utils.yaml b/assets/templates/99_master-utils.yaml deleted file mode 100644 index a6d814635..000000000 --- a/assets/templates/99_master-utils.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: machineconfiguration.openshift.io/v1 -kind: MachineConfig -metadata: - generation: 1 - labels: - machineconfiguration.openshift.io/role: master - name: 00-master-utils -spec: - config: - ignition: - version: 2.2.0 - storage: - files: - - contents: - verification: {} - filesystem: root - mode: 0775 - path: /usr/local/bin/clusterinfo - - contents: - verification: {} - filesystem: root - mode: 0775 - path: /usr/local/bin/get_vip_subnet_cidr - - contents: - verification: {} - filesystem: root - mode: 0775 - path: /usr/local/bin/fletcher8 diff --git a/assets/templates/99_openshift-kni-infra-namespace.yaml b/assets/templates/99_openshift-kni-infra-namespace.yaml deleted file mode 100644 index e5eb66c45..000000000 --- a/assets/templates/99_openshift-kni-infra-namespace.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: openshift-kni-infra - annotations: - openshift.io/description: "" - openshift.io/display-name: "" -spec: - finalizers: - - kubernetes diff --git a/assets/templates/99_worker-coredns.yaml b/assets/templates/99_worker-coredns.yaml deleted file mode 100644 index 0a8811941..000000000 --- a/assets/templates/99_worker-coredns.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: machineconfiguration.openshift.io/v1 -kind: MachineConfig -metadata: - generation: 1 - labels: - machineconfiguration.openshift.io/role: worker - name: 00-worker-coredns -spec: - config: - ignition: - version: 2.2.0 - storage: - files: - - contents: - verification: {} - filesystem: root - mode: 0664 - path: /etc/kubernetes/manifests/coredns.yaml - - contents: - verification: {} - filesystem: root - mode: 0664 - path: /etc/kubernetes/static-pod-resources/coredns/Corefile.template diff --git a/assets/templates/99_worker-dhclient-dns.yaml b/assets/templates/99_worker-dhclient-dns.yaml deleted file mode 100644 index 066ee304a..000000000 --- a/assets/templates/99_worker-dhclient-dns.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: machineconfiguration.openshift.io/v1 -kind: MachineConfig -metadata: - generation: 1 - labels: - machineconfiguration.openshift.io/role: worker - name: 00-worker-dhclient-dns -spec: - config: - ignition: - version: 2.2.0 - storage: - files: - - contents: - verification: {} - filesystem: root - mode: 0664 - path: /etc/dhcp/dhclient.conf.template - - contents: - verification: {} - filesystem: root - mode: 0755 - path: /etc/NetworkManager/dispatcher.d/pre-up.d/dns-vip-prepender-worker diff --git a/assets/templates/99_worker-mdns-publisher.yaml b/assets/templates/99_worker-mdns-publisher.yaml deleted file mode 100644 index b8e20f4f4..000000000 --- a/assets/templates/99_worker-mdns-publisher.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: machineconfiguration.openshift.io/v1 -kind: MachineConfig -metadata: - generation: 1 - labels: - machineconfiguration.openshift.io/role: worker - name: 00-worker-mdns-publisher -spec: - config: - ignition: - version: 2.2.0 - storage: - files: - - contents: - verification: {} - filesystem: root - mode: 0664 - path: /etc/kubernetes/manifests/mdns-publisher-worker.yaml - - contents: - verification: {} - filesystem: root - mode: 0664 - path: /etc/kubernetes/static-pod-resources/mdns/worker-config.template - - contents: - verification: {} - filesystem: root - mode: 0775 - path: /usr/local/bin/get_vip_subnet_cidr diff --git a/assets/templates/99_worker-utils.yaml b/assets/templates/99_worker-utils.yaml deleted file mode 100644 index 00ae89bf2..000000000 --- a/assets/templates/99_worker-utils.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: machineconfiguration.openshift.io/v1 -kind: MachineConfig -metadata: - generation: 1 - labels: - machineconfiguration.openshift.io/role: worker - name: 00-worker-utils -spec: - config: - ignition: - version: 2.2.0 - storage: - files: - - contents: - verification: {} - filesystem: root - mode: 0775 - path: /usr/local/bin/clusterinfo - - contents: - verification: {} - filesystem: root - mode: 0775 - path: /usr/local/bin/get_vip_subnet_cidr - - contents: - verification: {} - filesystem: root - mode: 0775 - path: /usr/local/bin/fletcher8