Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
176 changes: 132 additions & 44 deletions admin_guide/master_node_configuration.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,44 +10,123 @@
toc::[]

== Overview
`openshift start`, `openshift start master`, and `openshift start node` all take a limited set of arguments that are sufficient for development and experimental purposes, but are insufficient to describe and control the full set of configuration and security options that are necessary in a production environment. To provide those options, it is necessary to use the dedicated master and node config files.
The `openshift start` command is used to launch OpenShift servers. The command
and its subcommands (`master` to launch a
link:../architecture/infrastructure_components/kubernetes_infrastructure.html#master[master

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to get this long sentence broken into two, but I think it's okay to leave it as one. However, I'd wrap that middle part in parentheses, not commas: "The command and its subcommands (master to launch a master server and node to launch a node server) all take a limited set of arguments that are sufficient for launching servers in a development or experimental environment."

server] and `node` to launch a
link:../architecture/infrastructure_components/kubernetes_infrastructure.html#node[node
server]) all take a limited set of arguments that are sufficient for launching
servers in a development or experimental environment.

The config files are fully specifying with no defaulting. This means that any empty value means that you want to start up with an empty value for that parameter. It makes it easy to reason about exactly what your configuration is, but it also means that it can be difficult to remember all of the options to specify. To make this easier, the config files can be created with the `--write-config` flag and can be used via the `--config` flag.
However, these arguments are insufficient to describe and control the full set
of configuration and security options that are necessary in a production
environment. To provide those options, it is necessary to use the dedicated
master and node configuration files.

== Create the starting config files
The `openshift start` command accepts flags that indicate that it should simply write the config file that it would have used and terminate. This is useful for getting a starting point for the config. You can do this by running
link:#master-configuration-files[Master configuration files] and
link:#node-configuration-files[node configuration files] are fully specified
with no default values. Therefore, any empty value indicates that you want to
start up with an empty value for that parameter. This makes it easy to reason
about exactly what your configuration is, but it also makes it difficult to
remember all of the options to specify. To make this easier, the configuration
files can be created with the `--write-config` option and then used with the
`--config` option.

* `openshift start --write-config=openshift.local.config`
* `openshift start master --write-config=openshift.local.config/master`
* `osadm create-node-config --node-dir=openshift.local.config/node-myhost --node=myhost --hostnames=myhost.local,10.0.0.1`
== Creating New Configuration Files
For masters, the `openshift start` command accepts options that indicate that it
should simply write the configuration files that it would have used, then
terminate. For nodes, a configuration file can be written using the `osadm
create-node-config` command. Creating new configuration files is useful to get a
starting point for defining your configuration.

== Use the config files
Once you have modified the config files to your liking, you can make use of them by specifying them as an argument. Keep in mind that if you specify a config file, *none of the other flags you pass in will be respected*. You can run them like:
The following commands write the relevant launch configuration file(s),
certificate files, and any other necessary files to the specified
`--write-config` or `--node-dir` directory.

* `openshift start --master-config=openshift.local.config/master/master-config.yaml --node-config=openshift.local.config/node-<node-name>/node-config.yaml`
* `openshift start master --config=openshift.local.config/master/master-config.yaml`
* `openshift start node --config=openshift.local.config/node-myhost/node-config.yaml`
To create configuration files for an all-in-one server (a master and a node on
the same host) in the specified directory:

== Stub for discussion of generating the config for a new node
[options="nowrap"]
----
$ openshift start --write-config=/openshift.local.config
----

To create a link:#master-configuration-files[master configuration file] and
other required files in the specified directory:

== Example master.yaml
This is an example at a point in time. You should run `--write-config` to generate a file of your own.
[options="nowrap"]
----
$ openshift start master --write-config=/openshift.local.config/master
----

[source]
---
To create a link:#node-configuration-files[node configuration file] and other
related files in the specified directory:

[options="nowrap"]
----
$ osadm create-node-config --node-dir=/openshift.local.config/node-<node_hostname> --node=<node_hostname> --hostnames=<hostname>,<ip_address>
----

For the `--hostnames` option in the above command, use a comma-delimited list of
every host name or IP address you want server certificates to be valid for. The
above command also assumes that certificate files are located in an
*_openshift.local.config/master/_* directory. If they are not, you can include
options to specify their location. Run the command with the `-h` option to see
details.

== Launching Servers Using Configuration Files
Once you have modified the master and/or node configuration files to your
specifications, you can use them when launching servers by specifying them as an
argument. Keep in mind that if you specify a configuration file, none of the
other command line options you pass are respected.

To launch an all-in-one server using a master configuration and a node
configuration file:

[options="nowrap"]
----
$ openshift start --master-config=/openshift.local.config/master/master-config.yaml --node-config=/openshift.local.config/node-<node_hostname>/node-config.yaml
----

To launch a master server using a master configuration file:

[options="nowrap"]
----
$ openshift start master--config=/openshift.local.config/master/master-config.yaml
----

To launch a node server using a node configuration file:

[options="nowrap"]
----
$ openshift start node --config=/openshift.local.config/node-<node_hostname>/node-config.yaml
----

== Master Configuration Files
The following *_master-config.yaml_* file is a sample master configuration
file taken at a point in time. You can
link:#creating-new-configuration-files[create a new master configuration file]
to see the valid options for your installed version of OpenShift.

.Sample Master Configuration File
[source,yaml]
----
NetworkConfig:
clusterNetworkCIDR: 10.1.0.0/16
hostSubnetLength: 8
networkPluginName: ""
apiVersion: v1
assetConfig:
logoutURL: ""
masterPublicURL: https://10.0.0.1:8443
publicURL: https://10.0.0.1:8443/console/
masterPublicURL: https://10.0.2.15:8443
publicURL: https://10.0.2.15:8443/console/
servingInfo:
bindAddress: 0.0.0.0:8443
certFile: master.server.crt
clientCA: ""
keyFile: master.server.key
corsAllowedOrigins:
- 10.0.0.1:8443
- 10.0.2.15:8443
- 127.0.0.1
- localhost
dnsConfig:
Expand All @@ -57,10 +136,10 @@ etcdClientInfo:
certFile: master.etcd-client.crt
keyFile: master.etcd-client.key
urls:
- https://10.0.0.1:4001
- https://10.0.2.15:4001
etcdConfig:
address: 10.0.0.1:4001
peerAddress: 10.0.0.1:7001
address: 10.0.2.15:4001
peerAddress: 10.0.2.15:7001
peerServingInfo:
bindAddress: 0.0.0.0:7001
certFile: etcd.server.crt
Expand All @@ -71,7 +150,12 @@ etcdConfig:
certFile: etcd.server.crt
clientCA: ca.crt
keyFile: etcd.server.key
storageDirectory: openshift.local.etcd
storageDirectory: /openshift.local.etcd
etcdStorageConfig:
kubernetesStoragePrefix: kubernetes.io
kubernetesStorageVersion: v1beta3
openShiftStoragePrefix: openshift.io
openShiftStorageVersion: v1beta1
imageConfig:
format: openshift/origin-${component}:${version}
latest: false
Expand All @@ -82,17 +166,18 @@ kubeletClientInfo:
keyFile: master.kubelet-client.key
port: 10250
kubernetesMasterConfig:
masterIP: 10.0.0.1
masterCount: 1
masterIP: 10.0.2.15
schedulerConfigFile: ""
servicesSubnet: 172.30.0.0/16
staticNodeNames:
- deads-dev-01
staticNodeNames: []
masterClients:
deployerKubeConfig: openshift-deployer.kubeconfig
kubernetesKubeConfig: kube-client.kubeconfig
externalKubernetesKubeConfig: ""
openshiftLoopbackKubeConfig: openshift-client.kubeconfig
masterPublicURL: https://10.0.2.15:8443
oauthConfig:
assetPublicURL: https://10.0.0.1:8443/console/
assetPublicURL: https://10.0.2.15:8443/console/
grantConfig:
method: auto
identityProviders:
Expand All @@ -102,8 +187,8 @@ oauthConfig:
provider:
apiVersion: v1
kind: AllowAllPasswordIdentityProvider
masterPublicURL: https://10.0.0.1:8443
masterURL: https://10.0.0.1:8443
masterPublicURL: https://10.0.2.15:8443
masterURL: https://10.0.2.15:8443
sessionConfig:
sessionMaxAgeSeconds: 300
sessionName: ssn
Expand All @@ -113,23 +198,27 @@ oauthConfig:
authorizeTokenMaxAgeSeconds: 300
policyConfig:
bootstrapPolicyFile: policy.json
masterAuthorizationNamespace: master
openshiftSharedResourcesNamespace: openshift
projectRequestConfig:
projectRequestMessage: ""
projectRequestTemplate: ""
servingInfo:
bindAddress: 0.0.0.0:8443
certFile: master.server.crt
clientCA: ca.crt
keyFile: master.server.key
projectNodeSelector: ""
---
----

=== Stub for discussion of what the different values actually do
== Node Configuration Files

== Example node.yaml
This is an example at a point in time. You should run `osadm create-node-config` to generate a file of your own.
The following *_node-config.yaml_* file is a sample node configuration file
taken at a point in time. You can link:#creating-new-configuration-files[create
a new node configuration file] to see the valid options for your installed
version of OpenShift.

[source]
---
.Sample Node Configuration File
[source,yaml]
----
allowDisabledDocker: false
apiVersion: v1
dnsDomain: local
Expand All @@ -140,13 +229,12 @@ imageConfig:
kind: NodeConfig
masterKubeConfig: node.kubeconfig
networkPluginName: ""
nodeName: myhost
nodeName: mynode
podManifestConfig: null
servingInfo:
bindAddress: 0.0.0.0:10250
certFile: server.crt
clientCA: node-client-ca.crt
keyFile: server.key
volumeDirectory: openshift.local.volumes
---

=== Stub for discussion of what the different values actually do
volumeDirectory: /openshift.local.volumes
----