<commit_before>#cloud-config

---
write-files:
  - path: /etc/conf.d/nfs
    permissions: '0644'
    content: |
      OPTS_RPC_MOUNTD=""
  - path: /opt/bin/wupiao
    permissions: '0755'
    content: |
      #!/bin/bash
      # [w]ait [u]ntil [p]ort [i]s [a]ctually [o]pen
      [ -n "$1" ] && [ -n "$2" ] && \
        until curl -o /dev/null -sIf http://${1}:${2}; do \
          sleep 1 && echo .;
        done;
      exit $?

coreos:
  fleet:
    public-ip: $public_ipv4
    etcd-servers: http://$private_ipv4:2379
    metadata: "role=master"
  flannel:
    interface: eth1

  units:
    - name: setup-network-environment.service
      command: start
      content: |
        [Unit]
        Description=Setup Network Environment
        Documentation=https://github.com/kelseyhightower/setup-network-environment
        Requires=network-online.target
        After=network-online.target

        [Service]
        ExecStartPre=/usr/bin/mkdir -p /opt/bin
        ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/k8s/setup-network-environment
        ExecStartPre=/usr/bin/chmod +x /opt/bin/setup-network-environment
        ExecStart=/opt/bin/setup-network-environment
        RemainAfterExit=yes
        Type=oneshot
    - name: etcd.service
      command: start
      content: |
        [Unit]
        Description=etcd 2.0
        Requires=early-docker.service
        After=early-docker.service
        Before=early-docker.target

        [Service]
        Restart=always
        RestartSec=5
        Environment="TMPDIR=/var/tmp/"
        Environment="DOCKER_HOST=unix:///var/run/early-docker.sock"
        Environment="ETCD_VER=v2.0.7"
        EnvironmentFile=/etc/environment
        TimeoutStartSec=0
        SyslogIdentifier=writer_process
        LimitNOFILE=40000
        ExecStartPre=-/usr/bin/docker kill etcd
        ExecStartPre=-/usr/bin/docker rm etcd
        ExecStartPre=/usr/bin/docker pull quay.io/coreos/etcd:${ETCD_VER}
        ExecStart=/bin/bash -c "/usr/bin/docker run \
            --net=host \
            -p 2379:2379 \
            -p 2380:2380 \
            -p 4001:4001 \
            -p 7001:7001 \
            --name etcd \
            -v /opt/etcd:/opt/etcd \
            -v /usr/share/ca-certificates/:/etc/ssl/certs \
            quay.io/coreos/etcd:${ETCD_VER} \
            -data-dir /opt/etcd \
            -name __NAME__ \
            -listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 \
            -advertise-client-urls http://$COREOS_PRIVATE_IPV4:2379,http://$COREOS_PRIVATE_IPV4:4001 \
            -initial-cluster-token <PASSWORD> \
            -listen-peer-urls http://0.0.0.0:2380 \
            -initial-advertise-peer-urls http://$COREOS_PRIVATE_IPV4:2380 \
            -initial-cluster __ETCD_SEED_CLUSTER__ \
            -initial-cluster-state new"
        ExecStop=/usr/bin/docker kill etcd

        [X-Fleet]
        Conflicts=etcd*
    - name: flanneld.service
      command: start
      drop-ins:
        - name: 50-network-config.conf
          content: |
            [Unit]
            Requires=etcd.service
            [Service]
            ExecStartPre=/usr/bin/etcdctl set /coreos.com/network/config '{"Network":"10.244.0.0/16", "Backend": {"Type": "vxlan"}}'
    - name: docker-cache.service
      command: start
      content: |
        [Unit]
        Description=Docker cache proxy
        Requires=early-docker.service
        After=early-docker.service
        Before=early-docker.target

        [Service]
        Restart=always
        TimeoutStartSec=0
        RestartSec=5
        Environment="TMPDIR=/var/tmp/"
        Environment="DOCKER_HOST=unix:///var/run/early-docker.sock"
        ExecStartPre=-/usr/bin/docker kill docker-registry
        ExecStartPre=-/usr/bin/docker rm docker-registry
        ExecStartPre=/usr/bin/docker pull quay.io/devops/docker-registry:latest
        # GUNICORN_OPTS is an workaround for
        # https://github.com/docker/docker-registry/issues/892
        ExecStart=/usr/bin/docker run --rm --net host --name docker-registry \
            -e STANDALONE=false \
            -e GUNICORN_OPTS=[--preload] \
            -e MIRROR_SOURCE=https://registry-1.docker.io \
            -e MIRROR_SOURCE_INDEX=https://index.docker.io \
            -e MIRROR_TAGS_CACHE_TTL=1800 \
            quay.io/devops/docker-registry:latest
    - name: fleet.service
      command: start
    - name: docker.service
      command: start
      drop-ins:
        - name: 51-docker-mirror.conf
          content: |
            [Unit]
            # making sure that docker-cache is up and that flanneld finished
            # startup, otherwise containers won't land in flannel's network...
            Requires=docker-cache.service flanneld.service
            After=docker-cache.service flanneld.service
            [Service]
            Environment=DOCKER_OPTS='--registry-mirror=http://$private_ipv4:5000'
    - name: rpc-statd.service
      command: start
      enable: true
    - name: kube-apiserver.service
      command: start
      content: |
        [Unit]
        Description=Kubernetes API Server
        Documentation=https://github.com/GoogleCloudPlatform/kubernetes
        Requires=etcd.service docker-cache.service fleet.service docker.service
        Requires=flanneld.service
        After=etcd.service docker-cache.service fleet.service docker.service
        After=flanneld.service
        [Service]
        ExecStartPre=-/usr/bin/mkdir -p /opt/bin
        ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/__RELEASE__/bin/linux/amd64/kube-apiserver
        ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-apiserver
        ExecStart=/opt/bin/kube-apiserver \
        --address=0.0.0.0 \
        --port=8080 \
        --portal_net=10.100.0.0/16 \
        --etcd_servers=http://127.0.0.1:2379 \
        --public_address_override=__MASTER_IP__ \
        --logtostderr=true
        Restart=always
        RestartSec=10
    - name: kube-controller-manager.service
      command: start
      content: |
        [Unit]
        Description=Kubernetes Controller Manager
        Documentation=https://github.com/GoogleCloudPlatform/kubernetes
        Requires=kube-apiserver.service
        After=kube-apiserver.service

        [Service]
        ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/__RELEASE__/bin/linux/amd64/kube-controller-manager
        ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-controller-manager
        ExecStart=/opt/bin/kube-controller-manager \
        --master=127.0.0.1:8080 \
        --logtostderr=true
        Restart=always
        RestartSec=10
    - name: kube-scheduler.service
      command: start
      content: |
        [Unit]
        Description=Kubernetes Scheduler
        Documentation=https://github.com/GoogleCloudPlatform/kubernetes
        Requires=kube-apiserver.service
        After=kube-apiserver.service

        [Service]<commit_msg>Activated v1beta3 api<commit_after>#cloud-config

---
write-files:
  - path: /etc/conf.d/nfs
    permissions: '0644'
    content: |
      OPTS_RPC_MOUNTD=""
  - path: /opt/bin/wupiao
    permissions: '0755'
    content: |
      #!/bin/bash
      # [w]ait [u]ntil [p]ort [i]s [a]ctually [o]pen
      [ -n "$1" ] && [ -n "$2" ] && \
        until curl -o /dev/null -sIf http://${1}:${2}; do \
          sleep 1 && echo .;
        done;
      exit $?

coreos:
  fleet:
    public-ip: $public_ipv4
    etcd-servers: http://$private_ipv4:2379
    metadata: "role=master"
  flannel:
    interface: eth1

  units:
    - name: setup-network-environment.service
      command: start
      content: |
        [Unit]
        Description=Setup Network Environment
        Documentation=https://github.com/kelseyhightower/setup-network-environment
        Requires=network-online.target
        After=network-online.target

        [Service]
        ExecStartPre=/usr/bin/mkdir -p /opt/bin
        ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/k8s/setup-network-environment
        ExecStartPre=/usr/bin/chmod +x /opt/bin/setup-network-environment
        ExecStart=/opt/bin/setup-network-environment
        RemainAfterExit=yes
        Type=oneshot
    - name: etcd.service
      command: start
      content: |
        [Unit]
        Description=etcd 2.0
        Requires=early-docker.service
        After=early-docker.service
        Before=early-docker.target

        [Service]
        Restart=always
        RestartSec=5
        Environment="TMPDIR=/var/tmp/"
        Environment="DOCKER_HOST=unix:///var/run/early-docker.sock"
        Environment="ETCD_VER=v2.0.7"
        EnvironmentFile=/etc/environment
        TimeoutStartSec=0
        SyslogIdentifier=writer_process
        LimitNOFILE=40000
        ExecStartPre=-/usr/bin/docker kill etcd
        ExecStartPre=-/usr/bin/docker rm etcd
        ExecStartPre=/usr/bin/docker pull quay.io/coreos/etcd:${ETCD_VER}
        ExecStart=/bin/bash -c "/usr/bin/docker run \
            --net=host \
            -p 2379:2379 \
            -p 2380:2380 \
            -p 4001:4001 \
            -p 7001:7001 \
            --name etcd \
            -v /opt/etcd:/opt/etcd \
            -v /usr/share/ca-certificates/:/etc/ssl/certs \
            quay.io/coreos/etcd:${ETCD_VER} \
            -data-dir /opt/etcd \
            -name __NAME__ \
            -listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 \
            -advertise-client-urls http://$COREOS_PRIVATE_IPV4:2379,http://$COREOS_PRIVATE_IPV4:4001 \
            -initial-cluster-token <PASSWORD> \
            -listen-peer-urls http://0.0.0.0:2380 \
            -initial-advertise-peer-urls http://$COREOS_PRIVATE_IPV4:2380 \
            -initial-cluster __ETCD_SEED_CLUSTER__ \
            -initial-cluster-state new"
        ExecStop=/usr/bin/docker kill etcd

        [X-Fleet]
        Conflicts=etcd*
    - name: flanneld.service
      command: start
      drop-ins:
        - name: 50-network-config.conf
          content: |
            [Unit]
            Requires=etcd.service
            [Service]
            ExecStartPre=/usr/bin/etcdctl set /coreos.com/network/config '{"Network":"10.244.0.0/16", "Backend": {"Type": "vxlan"}}'
    - name: docker-cache.service
      command: start
      content: |
        [Unit]
        Description=Docker cache proxy
        Requires=early-docker.service
        After=early-docker.service
        Before=early-docker.target

        [Service]
        Restart=always
        TimeoutStartSec=0
        RestartSec=5
        Environment="TMPDIR=/var/tmp/"
        Environment="DOCKER_HOST=unix:///var/run/early-docker.sock"
        ExecStartPre=-/usr/bin/docker kill docker-registry
        ExecStartPre=-/usr/bin/docker rm docker-registry
        ExecStartPre=/usr/bin/docker pull quay.io/devops/docker-registry:latest
        # GUNICORN_OPTS is an workaround for
        # https://github.com/docker/docker-registry/issues/892
        ExecStart=/usr/bin/docker run --rm --net host --name docker-registry \
            -e STANDALONE=false \
            -e GUNICORN_OPTS=[--preload] \
            -e MIRROR_SOURCE=https://registry-1.docker.io \
            -e MIRROR_SOURCE_INDEX=https://index.docker.io \
            -e MIRROR_TAGS_CACHE_TTL=1800 \
            quay.io/devops/docker-registry:latest
    - name: fleet.service
      command: start
    - name: docker.service
      command: start
      drop-ins:
        - name: 51-docker-mirror.conf
          content: |
            [Unit]
            # making sure that docker-cache is up and that flanneld finished
            # startup, otherwise containers won't land in flannel's network...
            Requires=docker-cache.service flanneld.service
            After=docker-cache.service flanneld.service
            [Service]
            Environment=DOCKER_OPTS='--registry-mirror=http://$private_ipv4:5000'
    - name: rpc-statd.service
      command: start
      enable: true
    - name: kube-apiserver.service
      command: start
      content: |
        [Unit]
        Description=Kubernetes API Server
        Documentation=https://github.com/GoogleCloudPlatform/kubernetes
        Requires=etcd.service docker-cache.service fleet.service docker.service
        Requires=flanneld.service
        After=etcd.service docker-cache.service fleet.service docker.service
        After=flanneld.service
        [Service]
        ExecStartPre=-/usr/bin/mkdir -p /opt/bin
        ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/__RELEASE__/bin/linux/amd64/kube-apiserver
        ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-apiserver
        ExecStart=/opt/bin/kube-apiserver \
        --address=0.0.0.0 \
        --port=8080 \
        --portal_net=10.100.0.0/16 \
        --etcd_servers=http://127.0.0.1:2379 \
        --public_address_override=__MASTER_IP__ \
        --runtime_config=api/v1beta3 \
        --logtostderr=true
        Restart=always
        RestartSec=10
    - name: kube-controller-manager.service
      command: start
      content: |
        [Unit]
        Description=Kubernetes Controller Manager
        Documentation=https://github.com/GoogleCloudPlatform/kubernetes
        Requires=kube-apiserver.service
        After=kube-apiserver.service

        [Service]
        ExecStartPre=/usr/bin/wget -N -P /opt/bin https://storage.googleapis.com/kubernetes-release/release/__RELEASE__/bin/linux/amd64/kube-controller-manager
        ExecStartPre=/usr/bin/chmod +x /opt/bin/kube-controller-manager
        ExecStart=/opt/bin/kube-controller-manager \
        --master=127.0.0.1:8080 \
        --logtostderr=true
        Restart=always
        RestartSec=10
    - name: kube-scheduler.service
      command: start
      content: |
        [Unit]
        Description=Kubernetes Scheduler
        Documentation=https://github.com/GoogleCloudPlatform/kubernetes
        Requires=kube-apiserver.service
        After=kube-apiserver.service

        [Service]
{'fraction_non_alphanumeric': 0.12063695173100164, 'fraction_numerical': 0.0254496338949314, 'mean_word_length': 1.986202504776056, 'pattern_counts': {'":': 6, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 20, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 16, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '166944', 'n_tokens_mistral': 4850, 'n_tokens_neox': 4479, 'n_words': 680}