blob: f27cd25f4ea482c77d3c2e1fde9350570d334387 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="keywords" content="workspaceruntimedockerkubernetes, workspace, runtime, recipe, docker, stack">
<title>Recipes | Eclipse Che Documentation</title>
<link rel="stylesheet" href="css/syntax.css">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" crossorigin="anonymous">
<!--<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">-->
<link rel="stylesheet" href="css/modern-business.css">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="css/customstyles.css">
<link rel="stylesheet" href="css/boxshadowproperties.css">
<!-- most color styles are extracted out to here -->
<link rel="stylesheet" href="css/theme-che.css">
<link rel="stylesheet" href="/css/coderay.css" media="screen" type="text/css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js" crossorigin="anonymous"></script>
<script src="js/jquery.navgoco.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<!-- Anchor.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/2.0.0/anchor.min.js" crossorigin="anonymous"></script>
<script src="js/toc.js"></script>
<script src="js/customscripts.js"></script>
<link rel="shortcut icon" href="che/docs/images/favicon.ico">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<link rel="alternate" type="application/rss+xml" title="che" href="http://0.0.0.0:4000/feed.xml">
<script>
$(document).ready(function() {
// Initialize navgoco with default options
$("#mysidebar").navgoco({
caretHtml: '',
accordion: true,
openClass: 'active', // open
save: false, // leave false or nav highlighting doesn't work right
cookie: {
name: 'navgoco',
expires: false,
path: '/'
},
slide: {
duration: 400,
easing: 'swing'
}
});
$("#collapseAll").click(function(e) {
e.preventDefault();
$("#mysidebar").navgoco('toggle', false);
});
$("#expandAll").click(function(e) {
e.preventDefault();
$("#mysidebar").navgoco('toggle', true);
});
});
</script>
<script>
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
</script>
<script>
$(document).ready(function() {
$("#tg-sb-link").click(function() {
$("#tg-sb-sidebar").toggle();
$("#tg-sb-content").toggleClass('col-md-9');
$("#tg-sb-content").toggleClass('col-md-12');
$("#tg-sb-icon").toggleClass('fa-toggle-on');
$("#tg-sb-icon").toggleClass('fa-toggle-off');
});
});
</script>
</head>
<body>
<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-static-top">
<div class="container topnavlinks">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="fa fa-home fa-lg navbar-brand" href="index.html">&nbsp;<span class="projectTitle"> Eclipse Che Documentation</span></a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<!-- toggle sidebar button -->
<li><a id="tg-sb-link" href="#"><i id="tg-sb-icon" class="fa fa-toggle-on"></i> Nav</a></li>
<!-- entries without drop-downs appear here -->
<li><a href="https://medium.com/eclipse-che-blog/" target="_blank">Blog</a></li>
<li><a href="https://github.com/eclipse/che" target="_blank">Source Code</a></li>
<!-- entries with drop-downs appear here -->
<!-- conditional logic to control which topnav appears for the audience defined in the configuration file.-->
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Get Support<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="https://github.com/eclipse/che/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Akind%2Fbug" target="_blank">Known Bugs</a></li>
<li><a href="https://github.com/eclipse/che/issues/new" target="_blank">File an Issue</a></li>
<li><a href="https://stackoverflow.com/questions/tagged/eclipse-che" target="_blank">Che on StackOverflow</a></li>
</ul>
</li>
<!--
<li>
<a class="email" title="Submit feedback" href="#" onclick="javascript:window.location='mailto:?subject= feedback&body=I have some feedback about the Recipes page: ' + window.location.href;"><i class="fa fa-envelope-o"></i> Feedback</a>
</li>
-->
<!--comment out this block if you want to hide search-->
<li>
<!--start search-->
<div id="search-demo-container">
<input type="text" id="search-input" placeholder="search...">
<ul id="results-container"></ul>
</div>
<script src="js/jekyll-search.js" type="text/javascript"></script>
<script type="text/javascript">
SimpleJekyllSearch.init({
searchInput: document.getElementById('search-input'),
resultsContainer: document.getElementById('results-container'),
dataSource: 'search.json',
searchResultTemplate: '<li><a href="{url}" title="Recipes">{title}</a></li>',
noResultsText: 'No results found.',
limit: 10,
fuzzy: true,
})
</script>
<!--end search-->
</li>
</ul>
</div>
</div>
<!-- /.container -->
</nav>
<!-- Page Content -->
<div class="container">
<div id="main">
<!-- Content Row -->
<div class="row">
<!-- Sidebar Column -->
<div class="col-md-3" id="tg-sb-sidebar">
<ul id="mysidebar" class="nav">
<li class="sidebarTitle"> </li>
<li>
<a href="#">Overview</a>
<ul>
<li><a href="index.html">Introduction</a></li>
<li><a href="quick-start.html">Getting Started</a></li>
<li><a href="single-multi-user.html">Single and Multi-User Flavors</a></li>
<li><a href="infra-support.html">Supported Infrastructures</a></li>
</ul>
</li>
<li>
<a href="#">Che on Docker</a>
<ul>
<li><a href="docker-single-user.html">Docker - Single User</a></li>
<li><a href="docker-multi-user.html">Docker - Multi User</a></li>
<li><a href="docker-config.html">Docker - Configuration</a></li>
<li><a href="docker-cli.html">Docker - CLI Reference</a></li>
</ul>
</li>
<li>
<a href="#">Che on Kubernetes</a>
<ul>
<li><a href="kubernetes-single-user.html">Kubernetes - Single User</a></li>
<li><a href="kubernetes-multi-user.html">Kubernetes - Multi User</a></li>
<li><a href="kubernetes-config.html">Kubernetes - Configuration</a></li>
<li><a href="kubernetes-admin-guide.html">Kubernetes - Admin Guide</a></li>
</ul>
</li>
<li>
<a href="#">Che on OpenShift</a>
<ul>
<li><a href="openshift-single-user.html">OpenShift - Single User</a></li>
<li><a href="openshift-multi-user.html">OpenShift - Multi User</a></li>
<li><a href="openshift-config.html">OpenShift - Configuration</a></li>
<li><a href="openshift-admin-guide.html">OpenShift - Admin Guide</a></li>
</ul>
</li>
<li>
<a href="#">User Management</a>
<ul>
<li><a href="user-management.html">Authentication and Authorization</a></li>
<li><a href="authentication.html">Security Model</a></li>
<li><a href="permissions.html">Permissions</a></li>
<li><a href="organizations.html">Organizations in UD</a></li>
<li><a href="resource-management.html">Resource Management</a></li>
</ul>
</li>
<li>
<a href="#">User Guides</a>
<ul>
<li><a href="creating-starting-workspaces.html">Creating and starting Workspaces</a></li>
<li><a href="ide-projects.html">Projects</a></li>
<li><a href="editor-code-assistance.html">Editor and Code-Assistance</a></li>
<li><a href="dependency-management.html">Dependency Management</a></li>
<li><a href="commands-ide-macro.html">Commands and IDE Macros</a></li>
<li><a href="version-control.html">Version Control</a></li>
<li><a href="debug.html">Debug</a></li>
</ul>
</li>
<li>
<a href="#">Workspace Administration</a>
<ul>
<li><a href="what-are-workspaces.html">Workspace Overview</a></li>
<li><a href="stacks.html">Workspace - Stacks</a></li>
<li class="active"><a href="recipes.html">Workspace - Recipes</a></li>
<li><a href="servers.html">Workspace - Servers</a></li>
<li><a href="installers.html">Workspace - Installers</a></li>
<li><a href="volumes.html">Workspace - Volumes Mount</a></li>
<li><a href="env-variables.html">Workspace - Environment Variables</a></li>
<li><a href="projects.html">Workspace - Projects</a></li>
<li><a href="workspaces-troubleshooting.html">Workspace - Troubleshooting</a></li>
<li><a href="workspace-data-model.html">Workspace Data Model</a></li>
</ul>
</li>
<li>
<a href="#">Portable Workspaces</a>
<ul>
<li><a href="chedir-getting-started.html">Chedir - Getting Started</a></li>
<li><a href="why-chedir.html">Chedir - Why Chedir?</a></li>
<li><a href="chedir-installation.html">Chedir - Installation</a></li>
<li><a href="chedir-project-setup.html">Chedir - Project Setup</a></li>
<li><a href="chedir-up-and-down.html">Chedir - Up and Down</a></li>
<li><a href="chefile.html">Chedir - Chefile</a></li>
<li><a href="chedir-ssh.html">Chedir - SSH</a></li>
<li><a href="factories-getting-started.html">Factory - Getting Started</a></li>
<li><a href="creating-factories.html">Factory - Creating</a></li>
<li><a href="factories_json_reference.html">Factory - JSON Reference</a></li>
</ul>
</li>
<li>
<a href="#">Developer Guides</a>
<ul>
<li><a href="framework-overview.html">Overview</a></li>
<li><a href="rest-api.html">SDK - REST API</a></li>
<li><a href="che-in-che-quickstart.html">SDK - Your First Plugin</a></li>
<li><a href="build-reqs.html">SDK - Building Che</a></li>
<li><a href="assemblies.html">SDK - Assemblies</a></li>
<li><a href="logging.html">SDK - Logging</a></li>
<li><a href="ide-extensions-gwt.html">SDK - GWT IDE Extensions</a></li>
<li><a href="server-side-extensions.html">SDK - Server Side Extensions</a></li>
<li><a href="custom-installers.html">SDK - Installers</a></li>
<li><a href="project-types.html">SDK - Project Types</a></li>
<li><a href="language-servers.html">SDK - Language Support</a></li>
<li><a href="parts.html">IDE UI&#58 Parts</a></li>
<li><a href="actions.html">IDE UI&#58 Actions</a></li>
</ul>
</li>
<li>
<a href="#">Dev Essentials</a>
<ul>
<li><a href="guice.html">Dependency Injection</a></li>
<li><a href="dto.html">Transport&#58 DTO</a></li>
<li><a href="json-rpc.html">Communication&#58 JSON-RPC</a></li>
<li><a href="handling-projects-in-plugins.html">Handling Projects in Plugins</a></li>
<li><a href="dao.html">Persistence, DAO</a></li>
<li><a href="properties.html">Properties</a></li>
</ul>
</li>
<li>
<a href="#">Infrastructure and SPI</a>
<ul>
<li><a href="spi_overview.html">Overview</a></li>
<li><a href="spi-implementation.html">Implementation Notes</a></li>
</ul>
</li>
<!-- if you aren't using the accordion, uncomment this block:
<p class="external">
<a href="#" id="collapseAll">Collapse All</a> | <a href="#" id="expandAll">Expand All</a>
</p>
-->
</ul>
<!-- this highlights the active parent class in the navgoco sidebar. this is critical so that the parent expands when you're viewing a page. This must appear below the sidebar code above. Otherwise, if placed inside customscripts.js, the script runs before the sidebar code runs and the class never gets inserted.-->
<script>$("li.active").parents('li').toggleClass("active");</script>
</div>
<!-- Content Column -->
<div class="col-md-9" id="tg-sb-content">
<div class="post-header">
<h1 class="post-title-main">Recipes</h1>
</div>
<div class="post-content">
<!-- this handles the automatic toc. use ## for subheads to auto-generate the on-page minitoc. if you use html tags, you must supply an ID for the heading element in order for it to appear in the minitoc. -->
<script>
$( document ).ready(function() {
// Handler for .ready() called.
$('#toc').toc({ minimumHeaders: 0, listType: 'ul', showSpeed: 0, headers: 'h2' });
/* this offset helps account for the space taken up by the floating toolbar. */
$('#toc').on('click', 'a', function() {
var target = $(this.getAttribute('href'))
, scroll_target = target.offset().top
$(window).scrollTop(scroll_target - 10);
return false
})
});
</script>
<div id="toc"></div>
<!--
-->
<div class="sect1">
<h2 id="supported-recipe-formats">Supported Recipe Formats</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Depending on the infrastructure, Che supports the following recipes out of the box (default Che build):</p>
</div>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 20%;">
<col style="width: 20%;">
<col style="width: 20%;">
<col style="width: 20%;">
<col style="width: 20%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top"><strong>Infrastructure</strong></th>
<th class="tableblock halign-left valign-top"><strong>Docker Image</strong></th>
<th class="tableblock halign-left valign-top"><strong>Dockerfile</strong></th>
<th class="tableblock halign-left valign-top"><strong>Composefile</strong></th>
<th class="tableblock halign-left valign-top"><strong>Kubernetes yaml</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>Docker</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Supported</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Supported</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Supported</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Not supported</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><strong>OpenShift</strong></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Supported</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Not supported</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Not supported</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Supported</p></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="sect1">
<h2 id="docker-image">Docker Image</h2>
<div class="sectionbody">
<div class="paragraph">
<p>DockerImage recipe type implies that Che will pull an image from a Docker registry or use the one that is local and run it (in case of Docker) or create a pod that references this image in container spec. There are certain requirements and limitations for a Docker image to be a workspace machine:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Non-terminating <code>CMD</code> or <code>ENTRYPOINT</code>. If you use your custom image, make sure it has something like <code>tail -f /dev/null</code> as one of its main processes.</p>
</li>
<li>
<p>No processes and operations with <code>sudo</code> in <code>CMD</code> (OpenShift only, see <a href="openshift-config.html#enable-ssh-and-sudo">Enable sudo</a>)</p>
</li>
<li>
<p>OpenShift only - it is recommended to use <a href="https://github.com/eclipse/che-dockerfiles/tree/master/recipes/stack-base">Che base stacks</a> that are certified to run OK on OpenShift. You can also build your own image, but inherit from one of base stacks.</p>
</li>
</ol>
</div>
</div>
</div>
<div class="sect1">
<h2 id="dockerfile">Dockerfile</h2>
<div class="sectionbody">
<div class="paragraph">
<p>A Dockerfile is a set of instructions that Docker performs to build an image. After you provide a Dockerfile for your workspace machine, Che will initiate Docker build, and once successful, run the resulting image. There are certain limitations here as well:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>There’s no context in docker build in Che. It means that commands like <code>COPY</code> and <code>ADD</code> will fail.</p>
</li>
<li>
<p>Build of huge images may take much time, so, if you have a long Dockerfile, it’s better to build an image locally, push it to DockerHub and then use it as DockerImage recipe type (see above). Che has a reasonable timeout for a workspace to start which is 5 mins.</p>
</li>
</ol>
</div>
</div>
</div>
<div class="sect1">
<h2 id="composefile">Composefile</h2>
<div class="sectionbody">
<div class="paragraph">
<p>When on Docker, you can run multi-container workspaces using Composefiles. However, there is some unsupported syntax:</p>
</div>
<div class="paragraph">
<p><strong>Local "build.context" and "build.dockerfile"</strong></p>
</div>
<div class="paragraph">
<p>Since Che workspaces can be distributed, you cannot have host-local build and Dockerfile contexts. You can, however, place these aspects so that they are remotely hosted in a git repository. Che will source the file from the remote system and then use it as its build context.</p>
</div>
<div class="paragraph">
<p>If the Dockerfile or build context requires other files to be <code>ADD</code> or <code>COPY</code> into the image that is created, then you could run into a failure, as the local Che workspace generator will not have access to those other remote files. To address this issue, you can pre-package the build context or Dockerfile into an image, push into a registry, and then reference the already-built image in your compose file. This is what we do for internal development at Codenvy.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="yaml"><span class="key">build</span>:
<span class="comment">## remote context will work</span>
<span class="key">context</span>: <span class="string"><span class="content">https://github.com/eclipse/che-dockerfiles.git#master:recipes/stack-base/ubuntu</span></span>
<span class="comment">## local context will not work</span>
<span class="key">context</span>: <span class="string"><span class="content">./my/local/filesystem</span></span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Using Private Repositories:</p>
</div>
<div class="paragraph">
<p>To use private repositories in a remote build context, you need to setup ssh keys on your host machine and add remote repository hostname/IP to the list of known hosts.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="yaml"><span class="comment">## The following will use master branch and build in recipes/stack-base/ubuntu folder</span>
<span class="key">build</span>:
<span class="key">context</span>: <span class="string"><span class="content">git@github.com:eclipse/che-dockerfiles.git#master:recipes/stack-base/ubuntu</span></span></code></pre>
</div>
</div>
<div class="paragraph">
<p><strong>Build Image</strong></p>
</div>
<div class="paragraph">
<p>In the event that a Compose file includes both build instructions and a build image the build instructions are seen as overriding, so the build image is skipped if it exists.</p>
</div>
<div class="paragraph">
<p><strong>Container Name</strong></p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="yaml"><span class="key">container_name</span>: <span class="string"><span class="content">my_container</span></span></code></pre>
</div>
</div>
<div class="paragraph">
<p><code>container_name</code> is skipped during execution. Instead, Che generates container names based on its own internal patterns. Because many developers could be running the same Compose file on the same Che workspace node at the same time naming conflicts need to be avoided.</p>
</div>
<div class="paragraph">
<p><strong>Volumes</strong></p>
</div>
<div class="paragraph">
<p>To define volumes for workspace machines, see Volumes[volumes]. Volume instructions in a Composefile are not supported.</p>
</div>
<div class="paragraph">
<p><strong>Networks</strong></p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="yaml"><span class="comment">## Not supported</span>
<span class="key">networks</span>:
<span class="key">internal</span>:
<span class="key">aliases</span>: <span class="string"><span class="content">['my.alias’]</span></span>
<span class="comment">## Not supported</span>
<span class="key">networks</span>:
<span class="key">internal</span>:
<span class="key">driver</span>: <span class="string"><span class="content">bridge</span></span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Che does not yet currently support compose networks. We do, however, support the use of aliases through <code>links</code> command.</p>
</div>
<div class="paragraph">
<p><strong>Hostname</strong></p>
</div>
<div class="paragraph">
<p>Hostname is not supported and the machine’s name will be used for the hostname. User can use <code>links</code> aliases syntax to add additional hostname(s) to a machine.</p>
</div>
<div class="paragraph">
<p><strong>Ports</strong></p>
</div>
<div class="paragraph">
<p>Binding ports to the host system is not supported. This is done to ensure that each container does not used already assigned host ports because many developers could be running the same compose file on the same Che server host at the same time. Users can add <a href="servers.html">servers</a> to machines though.</p>
</div>
<div class="paragraph">
<p><strong>Privileged</strong></p>
</div>
<div class="paragraph">
<p>To secure the underlying host system <code>privileged</code> compose command is not supported.</p>
</div>
<div class="paragraph">
<p>The Che server can be configured to give all containers privileged access by setting the environment variable <code>CHE_PROPERTY_machine_docker_privilege__mode=true</code>. However, this makes the host system vulnerable and gives all containers access to the host system.</p>
</div>
<div class="paragraph">
<p><strong>Environment File</strong> The <code>env_file</code> compose command is not supported. Environment variables can be manually entered in compose file or machine configuration. See: <a href="env-variables.html">Environment variables</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="kubernetes-yaml">Kubernetes YAML</h2>
<div class="sectionbody">
<div class="paragraph">
<p>When a workspace is being started, Che creates a <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod/">Kubernetes pod</a>. A few gotchas:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Che allows user to create pods and services only</p>
</li>
<li>
<p>Other object kinds will be ignored (PVC and route) or a workspace fails to start with an exception from Kubernetes.</p>
</li>
<li>
<p>Volumes are not supported both in container and pod definition. See: <a href="volumes.html">Volumes</a> for info about persisting ans sharing data between pods.</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>Below is an example of a custom recipe with two containers and one pod, and a service that is bound to port 8081:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="yaml"><span class="key">kind</span>: <span class="string"><span class="content">List</span></span>
<span class="key">items</span>:
-
<span class="key">kind</span>: <span class="string"><span class="content">Service</span></span>
<span class="key">apiVersion</span>: <span class="string"><span class="content">v1</span></span>
<span class="key">metadata</span>:
<span class="key">name</span>: <span class="string"><span class="content">my-service</span></span>
<span class="key">spec</span>:
<span class="key">selector</span>:
<span class="key">name</span>: <span class="string"><span class="content">app</span></span>
<span class="key">ports</span>:
- <span class="string"><span class="content">protocol: TCP</span></span>
<span class="key">port</span>: <span class="string"><span class="content">8081</span></span>
<span class="key">targetPort</span>: <span class="string"><span class="content">8081</span></span>
-
<span class="key">apiVersion</span>: <span class="string"><span class="content">v1</span></span>
<span class="key">kind</span>: <span class="string"><span class="content">Pod</span></span>
<span class="key">metadata</span>:
<span class="key">name</span>: <span class="string"><span class="content">app</span></span>
<span class="key">spec</span>:
<span class="key">containers</span>:
-
<span class="key">image</span>: <span class="string"><span class="content">eclipse/ubuntu_jdk8:latest</span></span>
<span class="key">name</span>: <span class="string"><span class="content">main</span></span>
<span class="key">ports</span>:
-
<span class="key">containerPort</span>: <span class="string"><span class="content">8081</span></span>
<span class="key">protocol</span>: <span class="string"><span class="content">TCP</span></span>
-
<span class="key">image</span>: <span class="string"><span class="content">eclipse/ubuntu_jdk8:latest</span></span>
<span class="key">name</span>: <span class="string"><span class="content">main1</span></span></code></pre>
</div>
</div>
<div class="paragraph">
<p>You can also have one pod and several containers in it. Che will treat those containers as workspace machines. You can also define machine names in annotations. <code>PodName/Container Name</code> is the default naming pattern for a machine. You can use annotations though:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="yaml"><span class="key">kind</span>: <span class="string"><span class="content">List</span></span>
<span class="key">items</span>:
-
<span class="key">apiVersion</span>: <span class="string"><span class="content">v1</span></span>
<span class="key">kind</span>: <span class="string"><span class="content">Pod</span></span>
<span class="key">metadata</span>:
<span class="key">name</span>: <span class="string"><span class="content">any123123</span></span>
<span class="key">annotations</span>:
<span class="key">org.eclipse.che.container.main.machine_name</span>: <span class="string"><span class="content">myMachine</span></span>
<span class="key">org.eclipse.che.container.main1.machine_name</span>: <span class="string"><span class="content">myMachine1</span></span>
<span class="key">spec</span>:
<span class="key">containers</span>:
-
<span class="key">image</span>: <span class="string"><span class="content">rhche/spring-boot:latest</span></span>
<span class="key">name</span>: <span class="string"><span class="content">main</span></span>
<span class="key">ports</span>:
-
<span class="key">containerPort</span>: <span class="string"><span class="content">8080</span></span>
<span class="key">protocol</span>: <span class="string"><span class="content">TCP</span></span>
<span class="key">resources</span>: <span class="string"><span class="content">{}</span></span>
-
<span class="key">image</span>: <span class="string"><span class="content">rhche/spring-boot:latest</span></span>
<span class="key">name</span>: <span class="string"><span class="content">main1</span></span>
<span class="key">ports</span>:
-
<span class="key">containerPort</span>: <span class="string"><span class="content">8080</span></span>
<span class="key">protocol</span>: <span class="string"><span class="content">TCP</span></span>
<span class="key">resources</span>: <span class="string"><span class="content">{}</span></span></code></pre>
</div>
</div>
</div>
</div>
<div class="tags">
<b>Tags: </b>
<a href="tag_workspace.html" class="btn btn-default navbar-btn cursorNorm" role="button">workspace</a>
<a href="tag_runtime.html" class="btn btn-default navbar-btn cursorNorm" role="button">runtime</a>
<a href="tag_docker.html" class="btn btn-default navbar-btn cursorNorm" role="button">docker</a>
<a href="tag_kubernetes.html" class="btn btn-default navbar-btn cursorNorm" role="button">kubernetes</a>
</div>
<!--
-->
</div>
<hr class="shaded"/>
<footer>
<div class="row">
<div class="col-lg-12 footer">
Eclipse Che - Documentation <br/>
Site last generated: Sep 13, 2018 <br/>
<hr>
<a href="http://www.eclipse.org" target="_blank">Eclipse Foundation</a><br/>
<a href="http://www.eclipse.org/legal/privacy.php" target="_blank">Privacy Policy</a><br/>
<a href="http://www.eclipse.org/legal/termsofuse.php" target="_blank">Terms of Use</a><br/>
<a href="https://www.eclipse.org/legal/epl-2.0/" target="_blank">Eclipse Public License</a><br/>
<a href="http://www.eclipse.org/legal" target="_blank">Legal Resources</a><br/>
</div>
</div>
</footer>
<!-- /.row -->
</div>
<!-- /.container -->
</div>
<!-- /#main -->
</div>
</body>
</html>