1
0
mirror of https://github.com/rancher/os.git synced 2025-06-25 14:31:33 +00:00
os/config/default.go

354 lines
7.7 KiB
Go
Raw Normal View History

2015-02-17 05:08:48 +00:00
package config
import (
"github.com/rancherio/rancher-compose/project"
)
2015-02-17 05:08:48 +00:00
func NewConfig() *Config {
return &Config{
2015-02-17 08:18:48 +00:00
Debug: DEBUG,
2015-03-18 13:23:27 +00:00
State: StateConfig{
2015-02-17 08:18:48 +00:00
Required: false,
Dev: "LABEL=RANCHER_STATE",
FsType: "auto",
},
2015-04-03 21:59:24 +00:00
BootstrapDocker: DockerConfig{
2015-03-18 13:23:27 +00:00
Args: []string{
"docker",
"-d",
2015-04-05 01:59:13 +00:00
"-s", "overlay",
"-b", "none",
2015-03-18 13:23:27 +00:00
"--restart=false",
"-g", "/var/lib/system-docker",
"-G", "root",
2015-04-03 21:59:24 +00:00
"-H", DOCKER_SYSTEM_HOST,
},
},
SystemDocker: DockerConfig{
Args: []string{
"docker",
"-d",
2015-04-06 13:52:17 +00:00
"--log-driver", "syslog",
2015-04-05 01:59:13 +00:00
"-s", "overlay",
"-b", "docker-sys",
"--fixed-cidr", "172.18.42.1/16",
2015-04-03 21:59:24 +00:00
"--restart=false",
"-g", "/var/lib/system-docker",
"-G", "root",
2015-03-18 13:23:27 +00:00
"-H", DOCKER_SYSTEM_HOST,
},
},
Modules: []string{},
UserDocker: DockerConfig{
TLSArgs: []string{
"--tlsverify",
"--tlscacert=ca.pem",
"--tlscert=server-cert.pem",
"--tlskey=server-key.pem",
"-H=0.0.0.0:2376",
},
Args: []string{
"docker",
"-d",
"-s", "overlay",
"-G", "docker",
"-H", DOCKER_HOST,
},
2015-02-19 20:47:06 +00:00
},
2015-03-07 04:20:46 +00:00
Network: NetworkConfig{
2015-03-18 13:23:27 +00:00
Dns: DnsConfig{
Nameservers: []string{"8.8.8.8", "8.8.4.4"},
},
Interfaces: map[string]InterfaceConfig{
"eth0": {
2015-03-18 13:23:27 +00:00
DHCP: true,
2015-03-07 04:20:46 +00:00
},
2015-03-18 13:23:27 +00:00
"lo": {
2015-03-07 04:20:46 +00:00
Address: "127.0.0.1/8",
2015-03-02 23:03:21 +00:00
},
},
},
2015-02-23 19:00:24 +00:00
CloudInit: CloudInit{
Datasources: []string{"configdrive:/media/config-2"},
},
2015-03-18 13:23:27 +00:00
Upgrade: UpgradeConfig{
2015-03-19 21:57:53 +00:00
Url: "https://releases.rancher.com/os/versions.yml",
Image: "rancher/os",
2015-03-18 13:23:27 +00:00
},
BootstrapContainers: map[string]*project.ServiceConfig{
"udev": {
Net: "host",
Privileged: true,
Labels: project.NewSliceorMap(map[string]string{
DETACH: "false",
SCOPE: SYSTEM,
}),
Volumes: []string{
"/dev:/host/dev",
2015-04-04 19:24:50 +00:00
"/lib/modules:/lib/modules",
"/lib/firmware:/lib/firmware",
},
Image: "udev",
LogDriver: "json-file",
2015-03-18 13:23:27 +00:00
},
},
SystemContainers: map[string]*project.ServiceConfig{
"udev": {
Image: "udev",
2015-04-28 10:20:42 +00:00
Restart: "always",
Net: "host",
Privileged: true,
Labels: project.NewSliceorMap(map[string]string{
DETACH: "true",
SCOPE: SYSTEM,
}),
Environment: []string{
"DAEMON=true",
},
2015-04-06 13:52:17 +00:00
VolumesFrom: []string{
"system-volumes",
},
},
"system-volumes": {
Image: "state",
Net: "none",
ReadOnly: true,
Privileged: true,
Labels: project.NewSliceorMap(map[string]string{
CREATE_ONLY: "true",
SCOPE: SYSTEM,
}),
Volumes: []string{
2015-04-06 13:52:17 +00:00
"/dev:/host/dev",
"/var/lib/rancher/conf:/var/lib/rancher/conf",
2015-04-10 06:20:19 +00:00
"/etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt.rancher",
2015-04-04 19:24:50 +00:00
"/lib/modules:/lib/modules",
"/lib/firmware:/lib/firmware",
"/var/run:/var/run",
"/var/log:/var/log",
},
2015-04-06 13:52:17 +00:00
LogDriver: "json-file",
},
"command-volumes": {
Image: "state",
Net: "none",
ReadOnly: true,
Privileged: true,
Labels: project.NewSliceorMap(map[string]string{
CREATE_ONLY: "true",
SCOPE: SYSTEM,
}),
Volumes: []string{
"/init:/sbin/halt:ro",
"/init:/sbin/poweroff:ro",
"/init:/sbin/reboot:ro",
"/init:/sbin/shutdown:ro",
"/init:/sbin/netconf:ro",
"/init:/usr/bin/cloud-init:ro",
"/init:/usr/bin/rancherctl:ro",
"/init:/usr/bin/respawn:ro",
"/init:/usr/bin/system-docker:ro",
2015-04-04 16:55:41 +00:00
"/init:/usr/sbin/wait-for-docker:ro",
2015-04-04 19:24:50 +00:00
"/lib/modules:/lib/modules",
"/usr/bin/docker:/usr/bin/docker:ro",
},
LogDriver: "json-file",
},
"user-volumes": {
Image: "state",
Net: "none",
ReadOnly: true,
Privileged: true,
Labels: project.NewSliceorMap(map[string]string{
CREATE_ONLY: "true",
SCOPE: SYSTEM,
}),
Volumes: []string{
"/home:/home",
"/opt:/opt",
},
LogDriver: "json-file",
},
"docker-volumes": {
Image: "state",
Net: "none",
ReadOnly: true,
Privileged: true,
Labels: project.NewSliceorMap(map[string]string{
CREATE_ONLY: "true",
SCOPE: SYSTEM,
}),
Volumes: []string{
"/var/lib/rancher:/var/lib/rancher",
"/var/lib/docker:/var/lib/docker",
"/var/lib/system-docker:/var/lib/system-docker",
},
LogDriver: "json-file",
},
"all-volumes": {
Image: "state",
Net: "none",
ReadOnly: true,
Privileged: true,
Labels: project.NewSliceorMap(map[string]string{
CREATE_ONLY: "true",
SCOPE: SYSTEM,
}),
VolumesFrom: []string{
"docker-volumes",
"command-volumes",
"user-volumes",
"system-volumes",
},
LogDriver: "json-file",
},
"cloud-init-pre": {
Image: "cloudinit",
Privileged: true,
Net: "host",
Labels: project.NewSliceorMap(map[string]string{
RELOAD_CONFIG: "true",
DETACH: "false",
SCOPE: SYSTEM,
}),
Environment: []string{
"CLOUD_INIT_NETWORK=false",
},
VolumesFrom: []string{
"command-volumes",
"system-volumes",
},
},
"network": {
Image: "network",
2015-03-31 21:28:14 +00:00
Privileged: true,
Net: "host",
Labels: project.NewSliceorMap(map[string]string{
DETACH: "false",
SCOPE: SYSTEM,
}),
Links: []string{
"cloud-init-pre",
},
VolumesFrom: []string{
"command-volumes",
"system-volumes",
},
},
"cloud-init": {
Image: "cloudinit",
Privileged: true,
Labels: project.NewSliceorMap(map[string]string{
RELOAD_CONFIG: "true",
DETACH: "false",
SCOPE: SYSTEM,
}),
Net: "host",
Links: []string{
"cloud-init-pre",
2015-02-23 21:30:51 +00:00
"network",
},
VolumesFrom: []string{
"command-volumes",
"system-volumes",
},
2015-02-23 21:30:51 +00:00
},
"ntp": {
Image: "ntp",
2015-04-28 10:20:42 +00:00
Restart: "always",
Privileged: true,
Net: "host",
Labels: project.NewSliceorMap(map[string]string{
SCOPE: SYSTEM,
}),
Links: []string{
"cloud-init",
"network",
},
},
"syslog": {
Image: "syslog",
2015-04-28 10:20:42 +00:00
Restart: "always",
Privileged: true,
Net: "host",
Labels: project.NewSliceorMap(map[string]string{
SCOPE: SYSTEM,
}),
VolumesFrom: []string{
"system-volumes",
},
2015-04-06 13:52:17 +00:00
LogDriver: "json-file",
},
"docker": {
Image: "docker",
2015-04-28 10:20:42 +00:00
Restart: "always",
Privileged: true,
Pid: "host",
Ipc: "host",
Net: "host",
Labels: project.NewSliceorMap(map[string]string{
SCOPE: SYSTEM,
}),
Links: []string{
"network",
},
2015-04-04 17:09:17 +00:00
VolumesFrom: []string{
"all-volumes",
},
},
"dockerwait": {
Image: "dockerwait",
2015-04-04 16:55:41 +00:00
Net: "host",
Labels: project.NewSliceorMap(map[string]string{
DETACH: "false",
SCOPE: SYSTEM,
}),
2015-04-04 16:55:41 +00:00
Links: []string{
"docker",
2015-04-04 16:55:41 +00:00
},
VolumesFrom: []string{
"all-volumes",
},
},
"console": {
Image: "console",
Privileged: true,
Links: []string{
"cloud-init",
},
Labels: project.NewSliceorMap(map[string]string{
SCOPE: SYSTEM,
}),
VolumesFrom: []string{
"all-volumes",
},
Restart: "always",
Pid: "host",
Ipc: "host",
Net: "host",
2015-02-17 05:08:48 +00:00
},
2015-04-28 11:34:32 +00:00
"acpid": {
Image: "acpid",
Privileged: true,
Labels: project.NewSliceorMap(map[string]string{
SCOPE: SYSTEM,
}),
2015-04-28 11:34:32 +00:00
VolumesFrom: []string{
"command-volumes",
"system-volumes",
},
Net: "host",
},
2015-02-17 05:08:48 +00:00
},
2015-04-16 05:57:59 +00:00
ServicesInclude: map[string]bool{
2015-04-16 06:16:23 +00:00
"ubuntu-console": false,
},
2015-04-16 05:57:59 +00:00
Repositories: map[string]Repository{
"core": Repository{
2015-04-16 14:26:42 +00:00
Url: "https://raw.githubusercontent.com/rancherio/os-services/master",
},
},
2015-04-16 05:57:59 +00:00
Services: map[string]*project.ServiceConfig{},
2015-02-17 05:08:48 +00:00
}
}