Skip to content

Commit d75e98f

Browse files
author
kcp-ci-bot
committed
Deployed 280844c to main with MkDocs 1.5.3 and mike 2.1.3
1 parent 72ab062 commit d75e98f

File tree

5 files changed

+150
-98
lines changed

5 files changed

+150
-98
lines changed

main/concepts/apis/exporting-apis/index.html

Lines changed: 69 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3789,10 +3789,11 @@ <h3 id="permission-claims">Permission Claims</h3>
37893789
<p>When a consumer creates an <code>APIBinding</code> that binds to an <code>APIExport</code>, the API provider who owns the <code>APIExport</code>
37903790
implicitly has access to instances of the exported APIs in the consuming workspace. There are also times when the API
37913791
provider needs to access additional resource data in a consuming workspace. These resources might come from other
3792-
APIExports the consumer has created <code>APIBindings</code> for, or from APIs that are built in to kcp. The API provider
3793-
requests access to these additional resources by adding <code>PermissionClaims</code> for the desired API's group, resource, and
3794-
identity hash to their <code>APIExport</code>. The API provider is responsible for specifying what operations are required for the
3795-
requested resource by setting the appropriate <a href="https://kubernetes.io/docs/reference/using-api/api-concepts/#api-verbs">API verbs</a>.
3792+
APIExports the consumer has created <code>APIBindings</code> for, or from APIs that are built in to kcp.</p>
3793+
<p>The API provider requests access to these additional resources by adding <code>PermissionClaims</code> for the desired API's
3794+
group, resource, and identity hash to their <code>APIExport</code>. The API provider is responsible for specifying what operations
3795+
are required for the requested resource by setting the appropriate
3796+
<a href="https://kubernetes.io/docs/reference/using-api/api-concepts/#api-verbs">API verbs</a>.
37963797
Let's take the example <code>APIExport</code> from above and add permission claims for <code>ConfigMaps</code> and <code>Things</code>:</p>
37973798
<div class="highlight"><pre><span></span><code><a id="__codelineno-2-1" name="__codelineno-2-1" href="#__codelineno-2-1"></a><span class="nt">apiVersion</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">apis.kcp.io/v1alpha2</span>
37983799
<a id="__codelineno-2-2" name="__codelineno-2-2" href="#__codelineno-2-2"></a><span class="nt">kind</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">APIExport</span>
@@ -3821,10 +3822,15 @@ <h3 id="permission-claims">Permission Claims</h3>
38213822
<li><code>"*"</code> is a special "verb" that matches any possible verb</li>
38223823
</ol>
38233824
<p>This is essentially a request from the API provider, asking each consumer to grant permission for the claimed
3824-
resources. If the consumer does not accept a permission claim, the API provider is not allowed to access the claimed
3825-
resources. Consumer acceptance of permission claims is part of the <code>APIBinding</code> spec. The operations allowed on the
3826-
resource are the intersection of the verbs defined in the <code>APIExport</code> and the verbs accepted in the appropriate
3827-
<code>APIBinding</code>. For more details, see the section on <a href="#apibinding">APIBindings</a>.</p>
3825+
resources. The consumer can, via <code>APIBinding</code>, accept or reject the service provider's request to access these
3826+
resources, i.e. accept or reject PermissionClaims.</p>
3827+
<p>Additionally, the consumer can choose between giving access to all instances (objects) of a claimed resource
3828+
and giving access only to a subset of instances. In the latter case, the consumer can specify labels when accepting
3829+
the PermissionClaim, so the service provider can only access instances which have these specified labels
3830+
(this is also known as a label selector).</p>
3831+
<p>The set of operations that the service provider can perform on the claimed resource is the intersection of the verbs
3832+
defined in the <code>APIExport</code> and the verbs accepted in the appropriate <code>APIBinding</code>.</p>
3833+
<p>For more details, see the section on <a href="#apibinding">APIBindings</a>.</p>
38283834
<h3 id="maximal-permission-policy">Maximal Permission Policy</h3>
38293835
<p>If you want to set an upper bound on what is allowed for a consumer of your exported APIs. you can set a "maximal
38303836
permission policy" using standard RBAC resources. This is optional; if the policy is not set, no upper bound is applied,
@@ -3997,8 +4003,14 @@ <h3 id="apibinding">APIBinding</h3>
39974003
<a id="__codelineno-10-9" name="__codelineno-10-9" href="#__codelineno-10-9"></a><span class="w"> </span><span class="nt">path</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;root:api-provider&quot;</span><span class="w"> </span><span class="c1"># path of your api-provider workspace</span>
39984004
</code></pre></div>
39994005
<h4 id="permission-claims_1">Permission Claims</h4>
4000-
<p>Furthermore, <code>APIBindings</code> provide the <code>APIExport</code> owner access to additional resources defined in an <code>APIExport</code>'s permission claims list. Permission claims must be accepted by the user explicitly, before this access is granted. The resources can be builtin Kubernetes resources or resources from other <code>APIExports</code>.
4001-
When an <code>APIExport</code> is changed after workspaces have bound to it, new or changed APIs are automatically propagated to all <code>APIBindings</code>. New permission claims on the other hand are NOT automatically accepted.</p>
4006+
<p>Furthermore, <code>APIBindings</code> provide the <code>APIExport</code> owner access to additional resources defined in an <code>APIExport</code>'s
4007+
permission claims list. Permission claims must be accepted by the user explicitly, before this access is granted.
4008+
The resources can be builtin Kubernetes resources or resources bound with other <code>APIBindings</code>.</p>
4009+
<div class="admonition information">
4010+
<p class="admonition-title">Information</p>
4011+
<p>When an <code>APIExport</code> is changed after workspaces have bound to it, new or changed APIs are automatically propagated
4012+
to all <code>APIBindings</code>. New permission claims on the other hand are NOT automatically accepted.</p>
4013+
</div>
40024014
<p>Returning to our example, we can grant the requested permissions in the <code>APIBinding</code>:</p>
40034015
<div class="highlight"><pre><span></span><code><a id="__codelineno-11-1" name="__codelineno-11-1" href="#__codelineno-11-1"></a><span class="nt">apiVersion</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">apis.kcp.io/v1alpha2</span>
40044016
<a id="__codelineno-11-2" name="__codelineno-11-2" href="#__codelineno-11-2"></a><span class="nt">kind</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">APIBinding</span>
@@ -4023,23 +4035,62 @@ <h4 id="permission-claims_1">Permission Claims</h4>
40234035
<a id="__codelineno-11-21" name="__codelineno-11-21" href="#__codelineno-11-21"></a><span class="w"> </span><span class="nt">selector</span><span class="p">:</span>
40244036
<a id="__codelineno-11-22" name="__codelineno-11-22" href="#__codelineno-11-22"></a><span class="w"> </span><span class="nt">matchAll</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span>
40254037
</code></pre></div>
4026-
<p>It should be noted that <code>APIBindings</code> do not create <code>CRDs</code> or <code>APIResourceSchemas</code>in the workspace. Instead APIs are directly bound using Kubernetes' internal binding mechanism behind the scenes.</p>
4038+
<p>It should be noted that <code>APIBindings</code> do not create <code>CRDs</code> or <code>APIResourceSchemas</code> in the workspace.
4039+
Instead APIs are directly bound using Kubernetes' internal binding mechanism behind the scenes.</p>
40274040
<h5 id="verbs">Verbs</h5>
40284041
<p>Operations allowed on the resources for which permission claims are accepted is defined as the intersection of
40294042
the verbs in the APIBinding and the verbs in the appropriate APIExport.</p>
40304043
<h5 id="selector">Selector</h5>
4031-
<p><code>APIBindings</code> allow API consumers to scope an API provider's access to claimed resources via the <code>selector</code> field on a permission claim. This means that providers will only be able to see and access those objects matched by the <code>selector</code>.</p>
4044+
<p><code>APIBindings</code> allow API consumers to scope an API provider's access to claimed resources via the <code>selector</code> field on
4045+
a permission claim. This means that providers will only be able to see and access those objects matched by
4046+
the <code>selector</code>.</p>
4047+
<p>There are two types of selectors at the moment:</p>
4048+
<ul>
4049+
<li><code>matchAll</code>: gives the service provider access to all objects of a claimed resource</li>
4050+
<li>label selector: gives the service provider access only to objects which are satisfying the given label selector</li>
4051+
</ul>
4052+
<p>The <code>matchAll</code> selector is shown in the example above.</p>
4053+
<p>A label selector can be defined using <code>matchLabels</code> or <code>matchExpressions</code>:</p>
4054+
<ul>
4055+
<li><code>matchLabels</code> specifies a set of labels (key-value pairs). For the selector to match, <strong>all</strong> of the listed labels
4056+
must be present on the object.</li>
4057+
<li><code>matchExpressions</code> specifies a set of expressions that are evaluated against object’s labels. If multiple expressions
4058+
are specified, <strong>all must evaluate to <code>true</code></strong> for the selector to match.</li>
4059+
</ul>
4060+
<div class="highlight"><pre><span></span><code><a id="__codelineno-12-1" name="__codelineno-12-1" href="#__codelineno-12-1"></a><span class="nn">...</span>
4061+
<a id="__codelineno-12-2" name="__codelineno-12-2" href="#__codelineno-12-2"></a><span class="w"> </span><span class="nt">permissionClaims</span><span class="p">:</span>
4062+
<a id="__codelineno-12-3" name="__codelineno-12-3" href="#__codelineno-12-3"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">resource</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">configmaps</span>
4063+
<a id="__codelineno-12-4" name="__codelineno-12-4" href="#__codelineno-12-4"></a><span class="w"> </span><span class="nt">verbs</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">[</span><span class="s">&quot;get&quot;</span><span class="p p-Indicator">,</span><span class="w"> </span><span class="s">&quot;list&quot;</span><span class="p p-Indicator">,</span><span class="w"> </span><span class="s">&quot;create&quot;</span><span class="p p-Indicator">]</span>
4064+
<a id="__codelineno-12-5" name="__codelineno-12-5" href="#__codelineno-12-5"></a><span class="w"> </span><span class="nt">state</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Accepted</span>
4065+
<a id="__codelineno-12-6" name="__codelineno-12-6" href="#__codelineno-12-6"></a><span class="w"> </span><span class="nt">selector</span><span class="p">:</span>
4066+
<a id="__codelineno-12-7" name="__codelineno-12-7" href="#__codelineno-12-7"></a><span class="w"> </span><span class="nt">matchLabels</span><span class="p">:</span>
4067+
<a id="__codelineno-12-8" name="__codelineno-12-8" href="#__codelineno-12-8"></a><span class="w"> </span><span class="nt">env</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">prod</span>
4068+
<a id="__codelineno-12-9" name="__codelineno-12-9" href="#__codelineno-12-9"></a><span class="w"> </span><span class="nt">app</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">logbook</span>
4069+
<a id="__codelineno-12-10" name="__codelineno-12-10" href="#__codelineno-12-10"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">resource</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">things</span>
4070+
<a id="__codelineno-12-11" name="__codelineno-12-11" href="#__codelineno-12-11"></a><span class="w"> </span><span class="nt">group</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">somegroup.kcp.io</span>
4071+
<a id="__codelineno-12-12" name="__codelineno-12-12" href="#__codelineno-12-12"></a><span class="w"> </span><span class="nt">identityHash</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">5fdf7c7aaf407fd1594566869803f565bb84d22156cef5c445d2ee13ac2cfca6</span>
4072+
<a id="__codelineno-12-13" name="__codelineno-12-13" href="#__codelineno-12-13"></a><span class="w"> </span><span class="nt">verbs</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">[</span><span class="s">&quot;*&quot;</span><span class="p p-Indicator">]</span>
4073+
<a id="__codelineno-12-14" name="__codelineno-12-14" href="#__codelineno-12-14"></a><span class="w"> </span><span class="nt">state</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Accepted</span>
4074+
<a id="__codelineno-12-15" name="__codelineno-12-15" href="#__codelineno-12-15"></a><span class="w"> </span><span class="nt">selector</span><span class="p">:</span>
4075+
<a id="__codelineno-12-16" name="__codelineno-12-16" href="#__codelineno-12-16"></a><span class="w"> </span><span class="nt">matchExpressions</span><span class="p">:</span>
4076+
<a id="__codelineno-12-17" name="__codelineno-12-17" href="#__codelineno-12-17"></a><span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">key</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">env</span>
4077+
<a id="__codelineno-12-18" name="__codelineno-12-18" href="#__codelineno-12-18"></a><span class="w"> </span><span class="nt">operator</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">In</span>
4078+
<a id="__codelineno-12-19" name="__codelineno-12-19" href="#__codelineno-12-19"></a><span class="w"> </span><span class="nt">values</span><span class="p">:</span><span class="w"> </span><span class="p p-Indicator">[</span><span class="s">&quot;prod&quot;</span><span class="p p-Indicator">,</span><span class="w"> </span><span class="s">&quot;staging&quot;</span><span class="p p-Indicator">]</span>
4079+
</code></pre></div>
40324080
<div class="admonition information">
40334081
<p class="admonition-title">Information</p>
4034-
<p>Currently, only <code>selector.matchAll=true</code> is supported, giving the provider that owns the <code>APIExport</code> full access to all objects of a claimed resource. Additional selectors are planned for upcoming releases.</p>
4082+
<p>Special attention is needed by the service provider when creating or updating an object via the APIExport Virtual
4083+
Workspace. If <code>matchLabels</code> is used, the specified labels will be automatically applied to the object that's being
4084+
applied even if not specified by the service provider. However, that's not the case for <code>matchExpressions</code>,
4085+
in which case the service provider needs to explicitly specify labels upon applying the object.</p>
40354086
</div>
40364087
<hr />
40374088
<p>In practice, bound APIs behave similarly to other resources in kcp or Kubernetes. This means you can query for imported APIs using <code>kubectl api-resources</code>. Additionally you can use <code>kubectl explain</code> to get a detailed view on all fields of the API.</p>
4038-
<div class="highlight"><pre><span></span><code><a id="__codelineno-12-1" name="__codelineno-12-1" href="#__codelineno-12-1"></a><span class="c1"># inside consumer workspace</span>
4039-
<a id="__codelineno-12-2" name="__codelineno-12-2" href="#__codelineno-12-2"></a>$<span class="w"> </span>kubectl<span class="w"> </span>api-resources<span class="w"> </span>--api-group<span class="o">=</span><span class="s1">&#39;example.kcp.io&#39;</span>
4040-
<a id="__codelineno-12-3" name="__codelineno-12-3" href="#__codelineno-12-3"></a>
4041-
<a id="__codelineno-12-4" name="__codelineno-12-4" href="#__codelineno-12-4"></a>NAME<span class="w"> </span>SHORTNAMES<span class="w"> </span>APIVERSION<span class="w"> </span>NAMESPACED<span class="w"> </span>KIND
4042-
<a id="__codelineno-12-5" name="__codelineno-12-5" href="#__codelineno-12-5"></a>widgets<span class="w"> </span>example.kcp.io/v1alpha1<span class="w"> </span><span class="nb">false</span><span class="w"> </span>Widget
4089+
<div class="highlight"><pre><span></span><code><a id="__codelineno-13-1" name="__codelineno-13-1" href="#__codelineno-13-1"></a><span class="c1"># inside consumer workspace</span>
4090+
<a id="__codelineno-13-2" name="__codelineno-13-2" href="#__codelineno-13-2"></a>$<span class="w"> </span>kubectl<span class="w"> </span>api-resources<span class="w"> </span>--api-group<span class="o">=</span><span class="s1">&#39;example.kcp.io&#39;</span>
4091+
<a id="__codelineno-13-3" name="__codelineno-13-3" href="#__codelineno-13-3"></a>
4092+
<a id="__codelineno-13-4" name="__codelineno-13-4" href="#__codelineno-13-4"></a>NAME<span class="w"> </span>SHORTNAMES<span class="w"> </span>APIVERSION<span class="w"> </span>NAMESPACED<span class="w"> </span>KIND
4093+
<a id="__codelineno-13-5" name="__codelineno-13-5" href="#__codelineno-13-5"></a>widgets<span class="w"> </span>example.kcp.io/v1alpha1<span class="w"> </span><span class="nb">false</span><span class="w"> </span>Widget
40434094
</code></pre></div>
40444095
<p>Furthermore, you can use the <code>.status.boundResources</code> field to precisely identify which <code>APIResourceSchemas</code> have been imported.</p>
40454096

main/concepts/quickstart-tenancy-and-apis/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3776,6 +3776,7 @@ <h2 id="managing-permissions">Managing Permissions</h2>
37763776
<a id="__codelineno-37-9" name="__codelineno-37-9" href="#__codelineno-37-9"></a><span class="w"> </span><span class="nt">matchAll</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span>
37773777
</code></pre></div>
37783778
<p>Operations allowed on the resources for which permission claim is accepted is defined as the intersection of the verbs in the <code>APIBinding</code> and the verbs in the <code>APIExport</code>. Verbs in this case are matching the verbs used by the <a href="https://kubernetes.io/docs/reference/using-api/api-concepts/#api-verbs">Kubernetes API</a>. There is the possibility to further limit the access claim to single resources.</p>
3779+
<p>PermissionClaims allows for additional selectors, for more details, check out the <a href="../apis/exporting-apis/#apibinding">APIBindings documentation</a>.</p>
37793780
<h2 id="dig-deeper-into-apiexports">Dig Deeper into APIExports</h2>
37803781
<p>Switching back to the service provider persona:</p>
37813782
<div class="highlight"><pre><span></span><code><a id="__codelineno-38-1" name="__codelineno-38-1" href="#__codelineno-38-1"></a>kubectl<span class="w"> </span>ws<span class="w"> </span>root:wildwest:cowboys-service

main/search/search_index.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)