title | description | type | weight |
---|---|---|---|
Install the OSM Control Plane |
This section describes how to install/uninstall Open Service Mesh (OSM) on a Kubernetes cluster |
docs |
2 |
- Kubernetes cluster running Kubernetes v1.19.0 or greater
- The osm CLI or the helm 3 CLI or the OpenShift
oc
CLI.
OSM can be run on Kubernetes versions that are supported at the time of the OSM release. The current support matrix is:
Open Service Mesh | Kubernetes |
---|---|
0.11 | 1.19 - 1.22 |
0.10 | 1.19 - 1.21 |
Use the osm
CLI to install the OSM control plane on to a Kubernetes cluster.
Each version of the OSM CLI is designed to work only with the matching version of the OSM Helm chart. Many operations may still work when some version skew exists, but those scenarios are not tested and issues that arise when using different CLI and chart versions may not get fixed even if reported.
Run osm install
to install the OSM control plane.
$ osm install
OSM installed successfully in namespace [osm-system] with mesh name [osm]
Run osm install --help
for more options.
Note: Installing OSM via the CLI enforces deploying only one mesh in the cluster. OSM installs and manages the CRDs by adding a conversion webhook field to all the CRDs to support multiple API versions, which ties the CRDs to a specific instance of OSM. Hence, for OSM's correct operation it is strongly recommended to have only one OSM mesh per cluster.
The [OSM chart](https://github.com/openservicemesh/osm/tree/{{< param osm_branch >}}/charts/osm) can be installed directly via the Helm CLI.
You can configure the OSM installation by overriding the values file.
-
Create a copy of the [values file](https://github.com/openservicemesh/osm/blob/{{< param osm_branch >}}/charts/osm/values.yaml) (make sure to use the version for the chart you wish to install).
-
Change any values you wish to customize. You can omit all other values.
-
To see which values correspond to the MeshConfig settings, see the OSM MeshConfig documentation
-
For example, to set the
logLevel
field in the MeshConfig toinfo
, save the following asoverride.yaml
:osm: envoyLogLevel: info
-
Then run the following helm install
command. The chart version can be found in the Helm chart you wish to install [here](https://github.com/openservicemesh/osm/blob/{{< param osm_branch >}}/charts/osm/Chart.yaml#L17).
$ helm install <mesh name> osm --repo https://openservicemesh.github.io/osm --version <chart version> --namespace <osm namespace> --values override.yaml
Omit the --values
flag if you prefer to use the default settings.
Run helm install --help
for more options.
To install OSM on OpenShift:
- Enable privileged init containers so that they can properly program iptables. The NET_ADMIN capability is not sufficient on OpenShift.
osm install --set="osm.enablePrivilegedInitContainer=true"
- If you have already installed OSM without enabling privileged init containers, set
enablePrivilegedInitContainer
totrue
in the OSM MeshConfig and restart any pods in the mesh.
- If you have already installed OSM without enabling privileged init containers, set
- Add the
privileged
security context constraint to each service account in the mesh.- Install the oc CLI.
- Add the security context constraint to the service account
oc adm policy add-scc-to-user privileged -z <service account name> -n <service account namespace>
Deprecated: PSP support has been deprecated in OSM since v0.10.0
PSP support will be removed in OSM 1.0.0
If you are running OSM in a cluster with PSPs enabled, pass in --set osm.pspEnabled=true
to your osm install
or helm install
CLI command.
If you wish to enable a reconciler in OSM, pass in --set osm.enableReconciler=true
to your osm install
or helm install
CLI command. More information on the reconciler can be found in the Reconciler Guide.
A few components will be installed by default. Inspect them by using the following kubectl
command:
# Replace osm-system with the namespace where OSM is installed
$ kubectl get pods,svc,secrets,meshconfigs,serviceaccount --namespace osm-system
A few cluster wide (non Namespaced components) will also be installed. Inspect them using the following kubectl
command:
kubectl get clusterrolebinding,clusterrole,mutatingwebhookconfiguration,validatingwebhookconfigurations -l app.kubernetes.io/name=openservicemesh.io
Under the hood, osm
is using Helm libraries to create a Helm release
object in the control plane Namespace. The Helm release
name is the mesh-name. The helm
CLI can also be used to inspect Kubernetes manifests installed in more detail. Goto https://helm.sh for instructions to install Helm.
# Replace osm-system with the namespace where OSM is installed
$ helm get manifest osm --namespace osm-system
Now that the OSM control plane is up and running, add services to the mesh.