File: enable-kube-proxy-minion.sh

package info (click to toggle)
magnum 2.0.0-5~bpo8+1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 5,572 kB
  • sloc: python: 42,786; sh: 1,915; makefile: 50
file content (56 lines) | stat: -rw-r--r-- 1,243 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/sh

. /etc/sysconfig/heat-params

init_templates () {
    local KUBE_PROTOCOL="https"
    local KUBE_CONFIG="/srv/kubernetes/kubeconfig.yaml"
    if [ "${TLS_DISABLED}" = "True" ]; then
        KUBE_PROTOCOL="http"
        KUBE_CONFIG=
    fi

    local MASTER="${KUBE_PROTOCOL}://${KUBE_MASTER_IP}:${KUBE_API_PORT}"
    local TEMPLATE=/etc/kubernetes/manifests/kube-proxy.yaml
    [ -f ${TEMPLATE} ] || {
        echo "TEMPLATE: $TEMPLATE"
        mkdir -p $(dirname ${TEMPLATE})
        cat << EOF > ${TEMPLATE}
apiVersion: v1
kind: Pod
metadata:
  name: kube-proxy
  namespace: kube-system
spec:
  hostNetwork: true
  containers:
  - name: kube-proxy
    image: gcr.io/google_containers/hyperkube:v1.0.6
    command:
    - /hyperkube
    - proxy
    - --master=${MASTER}
    - --kubeconfig=${KUBE_CONFIG}
    - --logtostderr=true
    - --v=0
    securityContext:
      privileged: true
    volumeMounts:
    - mountPath: /etc/ssl/certs
      name: ssl-certs-host
      readOnly: true
    - mountPath: /srv/kubernetes
      name: "srv-kube"
      readOnly: true
  volumes:
  - hostPath:
      path: /etc/ssl/certs
    name: ssl-certs-host
  - hostPath:
        path: "/srv/kubernetes"
    name: "srv-kube"
EOF
    }
}

init_templates