blob: 16b4b9a7279f3cca2cf44529d028ecbf6e4cd13f [file] [log] [blame]
Jun Hu9e45abc2018-01-17 17:07:36 -05001# ============LICENSE_START==========================================
2# ===================================================================
Jun (Nicolas) Hu8cbcb302018-02-21 14:18:44 -05003# Copyright (c) 2017 AT&T
Jun Hu9e45abc2018-01-17 17:07:36 -05004#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#============LICENSE_END============================================
17
18# this is the cloud init. It will install the reqiured packages and do some basic config on every VM.
19
20node_templates:
21
22 cloudify_host_cloud_config:
23 type: cloudify.nodes.CloudInit.CloudConfig
24 properties:
25 resource_config:
26 groups:
27 - docker
28 users:
29 - name: { get_input: agent_user }
30 primary-group: wheel
31 groups: docker
32 shell: /bin/bash
33 sudo: ['ALL=(ALL) NOPASSWD:ALL']
34 ssh-authorized-keys:
35 - { get_secret: agent_key_public }
36 write_files:
37 - path: /etc/yum.repos.d/kubernetes.repo
38 owner: root:root
39 permissions: '0444'
40 content: |
41 # installed by cloud-init
42 [kubernetes]
43 name=Kubernetes
44 baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
45 enabled=1
46 gpgcheck=1
47 repo_gpgcheck=1
48 gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
49 https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
50
51 - path: /etc/sysctl.d/k8s.conf
52 owner: root:root
53 permissions: '0444'
54 content: |
55 # installed by cloud-init
56 net.bridge.bridge-nf-call-ip6tables = 1
57 net.bridge.bridge-nf-call-iptables = 1
58
59 packages:
60 - [docker, 1.12.6]
61 - [kubelet, 1.8.6-0]
62 - [kubeadm, 1.8.6-0]
63 - [kubectl, 1.8.6-0]
64 - [kubernetes-cni, 0.5.1-1]
65 - [nfs-utils]
66 runcmd:
67 - [ setenforce, 0 ]
68 - [ sysctl , '--system' ]
69 - [ systemctl, enable, docker ]
70 - [ systemctl, start, docker ]
71 - [ systemctl, enable, kubelet ]
72 - [ systemctl, start, kubelet ]
73 - [ mkdir, '-p', /tmp/data ]
74 - [ chcon, '-Rt', svirt_sandbox_file_t, /tmp/data ]
75 - [ mkdir, '-p', /dockerdata-nfs ]
76 - [ chmod, 777, /dockerdata-nfs ]