Prerequisites
- Kubernetes cluster running Kubernetes v1.19.0 or greater
- The osm CLI or the helm 3 CLI or the OpenShift
oc
CLI.
Using the OSM CLI
Use the osm
CLI to install the OSM control plane on to a Kubernetes cluster.
OSM CLI and Chart Compatibility
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.
Running the CLI
Run osm install
.
# Install osm control plane components
$ 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.
Using the Helm CLI
The OSM chart can be installed directly via the Helm CLI.
Editing the Values File
You can configure the OSM installation by overriding the values file.
-
Create a copy of the values file (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
:OpenServiceMesh: envoyLogLevel: info
-
Helm install
Then run the following helm install
command. The chart version can be found in the Helm chart you wish to install here.
$ 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.
OpenShift
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="OpenServiceMesh.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>
Pod Security Policy
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 OpenServiceMesh.pspEnabled=true
to your osm install
or helm install
CLI command.
Enable Reconciler in OSM
If you wish to enable a reconcielr in OSM, pass in --set OpenServiceMesh.enableReconciler=true
to your osm install
or helm install
CLI command. More information on the reconciler can be found in the Reconciler Guide.
Inspect OSM Components
A few components will be installed by default into the osm-system
Namespace. Inspect them by using the following kubectl
command:
$ 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
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.
$ helm get manifest osm --namespace osm-system
Next Steps
Now that the OSM control plane is up and running, add services to the mesh.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.