Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions docs/partials/application-links/_nginx-service.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
labels:
app: nginx
annotations:
kots.io/when: '{{repl not IsKurl }}'
kots.io/when: 'repl{{ and (ne Distribution "embedded-cluster") (ne Distribution "kurl")}}'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

^ this is used as part of the port forwarding example

spec:
type: ClusterIP
ports:
Expand All @@ -21,7 +21,7 @@ metadata:
labels:
app: nginx
annotations:
kots.io/when: '{{repl IsKurl }}'
kots.io/when: 'repl{{ or (eq Distribution "embedded-cluster") (eq Distribution "kurl")}}'
spec:
type: NodePort
ports:
Expand Down
1 change: 0 additions & 1 deletion docs/partials/helm/_helm-cr-exclude.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ When Replicated KOTS processes Helm charts, it excludes the entire chart if the

For more information about optional charts, template functions, and how KOTS processes Helm charts, see:

* [Optional Charts](/vendor/helm-optional-charts)
* [About Template Function Contexts](template-functions-about)
* [About Distributing Helm Charts with KOTS](/vendor/helm-native-about)
1 change: 0 additions & 1 deletion docs/reference/template-functions-examples.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -439,5 +439,4 @@ The following topics include additional examples of using KOTS template function

* [Add Status Informers](/vendor/admin-console-display-app-status#add-status-informers) in _Adding Resource Status Informers_
* [Conditionally Including or Excluding Resources](/vendor/packaging-include-resources)
* [Example: Including Optional Helm Charts](/vendor/helm-optional-charts)
* [Templating Annotations](/vendor/resources-annotations-templating)
71 changes: 18 additions & 53 deletions docs/vendor/admin-console-port-forward.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import ServicePortNote from "../partials/custom-resource-application/_servicePort-note.mdx"
import GiteaKotsApp from "../partials/getting-started/_gitea-kots-app-cr.mdx"
import GiteaHelmChart from "../partials/getting-started/_gitea-helmchart-cr.mdx"
import GiteaK8sApp from "../partials/getting-started/_gitea-k8s-app-cr.mdx"
import PortsApplicationURL from "../partials/custom-resource-application/_ports-applicationURL.mdx"
import NginxKotsApp from "../partials/application-links/_nginx-kots-app.mdx"
import NginxK8sApp from "../partials/application-links/_nginx-k8s-app.mdx"
import NginxService from "../partials/application-links/_nginx-service.mdx"
import NginxDeployment from "../partials/application-links/_nginx-deployment.mdx"
import EcCr from "../partials/getting-started/_slackernews-embedded-cluster.mdx"

# Port Forward Services with KOTS

Expand Down Expand Up @@ -162,61 +160,18 @@ The following example shows an **Open App** link on the dashboard of the Admin C

[View a larger version of this image](/images/gitea-open-app.png)

## Examples
## Example: NGINX Application with ClusterIP and NodePort Services
Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated this example so that it also works with EC (previously it was just kots and kurl)


This section provides examples of how to configure the `ports` key to port-forward a service in existing cluster installations and add links to services on the Admin Console dashboard.

### Example: Bitnami Gitea Helm Chart with LoadBalancer Service
Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed this example


This example uses a KOTS Application custom resource and a Kubernetes SIG Application custom resource to configure port forwarding for the Bitnami Gitea Helm chart in existing cluster installations, and add a link to the port-forwarded service on the Admin Console dashboard. To view the Gitea Helm chart source, see [bitnami/gitea](https://github.com/bitnami/charts/blob/main/bitnami/gitea) in GitHub.
The following example demonstrates how to link to a port-forwarded ClusterIP service for existing cluster KOTS installations. It also shows how to use the `ports` key to add a link to a NodePort service for Embedded Cluster or kURL installations. Although the primary purpose of the `ports` key is to port forward services for existing cluster KOTS installations, it is also possible to use the `ports` key so that links to NodePort services for Embedded Cluster or kURL installations use the hostname in the browser. For information about exposing NodePort services for Embedded Cluster or kURL installations, see [Exposing Services Using NodePorts](kurl-nodeport-services).

To test this example:

1. Pull version 1.0.6 of the Gitea Helm chart from Bitnami:

```
helm pull oci://registry-1.docker.io/bitnamicharts/gitea --version 1.0.6
```

1. Add the `gitea-1.0.6.tgz` chart archive to a new, empty release in the Vendor Portal along with the `kots-app.yaml`, `k8s-app.yaml`, and `gitea.yaml` files provided below. Promote to the channel that you use for internal testing. For more information, see [Manage Releases with the Vendor Portal](releases-creating-releases).

<Tabs>
<TabItem value="kots-app" label="kots-app.yaml" default>
<h5>Description</h5>
<p>Based on the <a href="https://github.com/bitnami/charts/blob/main/bitnami/gitea/templates/svc.yaml">templates/svc.yaml</a> and <a href="https://github.com/bitnami/charts/blob/main/bitnami/gitea/values.yaml">values.yaml</a> files in the Gitea Helm chart, the following KOTS Application custom resource adds port 3000 to the port forward tunnel and maps local port 8888. Port 3000 is the container port of the Pod where the <code>gitea</code> service runs.</p>
<h5>YAML</h5>
<GiteaKotsApp/>
</TabItem>
<TabItem value="k8s-app" label="k8s-app.yaml" default>
<h5>Description</h5>
<p>The Kubernetes Application custom resource lists the same URL as the `ports.applicationUrl` field in the KOTS Application custom resource (`"http://nginx"`). This adds a link to the port-forwarded service from the Admin Console dashboard. It also triggers KOTS to rewrite the URL to use the hostname in the browser and append the specified `localPort`. The label to be used for the link in the Admin Console is "Open App".</p>
<h5>YAML</h5>
<GiteaK8sApp/>
</TabItem>
<TabItem value="helmchart" label="gitea.yaml" default>
<h5>Description</h5>
<p>The KOTS HelmChart custom resource provides instructions to KOTS about how to deploy the Helm chart. The <code>name</code> and <code>chartVersion</code> listed in the HelmChart custom resource must match the name and version of a Helm chart archive in the release. Each Helm chart archive in a release requires a unique HelmChart custom resource.</p>
<h5>YAML</h5>
<GiteaHelmChart/>
</TabItem>
</Tabs>

1. Install the release to confirm that the service was port-forwarded successfully. To test the port forward, click **Open App** on the Admin Console dashboard after the application reaches a Ready state. For more information, see [Online Installation in Existing Clusters with KOTS](/enterprise/installing-existing-cluster).

### Example: NGINX Application with ClusterIP and NodePort Services

The following example demonstrates how to link to a port-forwarded ClusterIP service for existing cluster installations.

It also shows how to use the `ports` key to add a link to a NodePort service for kURL installations. Although the primary purpose of the `ports` key is to port forward services for existing cluster installations, it is also possible to use the `ports` key so that links to NodePort services for Embedded Cluster or kURL installations use the hostname in the browser. For information about exposing NodePort services for Embedded Cluster or kURL installations, see [Exposing Services Using NodePorts](kurl-nodeport-services).

To test this example:

1. Add the `example-service.yaml`, `example-deployment.yaml`, `kots-app.yaml`, and `k8s-app.yaml` files provided below to a new, empty release in the Vendor Portal. Promote to the channel that you use for internal testing. For more information, see [Manage Releases with the Vendor Portal](releases-creating-releases).
1. Add the `example-service.yaml`, `example-deployment.yaml`, `kots-app.yaml`, `k8s-app.yaml`, and `embedded-cluster.yaml` files provided below to a new, empty release in the Vendor Portal. Promote to the channel that you use for internal testing. For more information, see [Manage Releases with the Vendor Portal](releases-creating-releases).

<Tabs>
<TabItem value="service" label="example-service.yaml" default>
<h5>Description</h5>
<p>The YAML below contains ClusterIP and NodePort specifications for a service named <code>nginx</code>. Each specification uses the <code>kots.io/when</code> annotation with the Replicated IsKurl template function to conditionally include the service based on the installation type (existing cluster or kURL cluster). For more information, see <a href="/vendor/packaging-include-resources">Conditionally Including or Excluding Resources</a> and <a href="/reference/template-functions-static-context#iskurl">IsKurl</a>.</p>
<p>The YAML below contains ClusterIP and NodePort specifications for a service named <code>nginx</code>. Each specification uses the <code>kots.io/when</code> annotation with the Replicated <a href="/reference/template-functions-static-context#distribution">Distribution</a> template function to conditionally include the service based on the installation type (existing cluster or Embedded Cluster/kURL cluster). For more information, see <a href="/vendor/packaging-include-resources">Conditionally Including or Excluding Resources</a>.</p>
<p>As shown below, both the ClusterIP and NodePort <code>nginx</code> services are exposed on port 80.</p>
<h5>YAML</h5>
<NginxService/>
Expand All @@ -239,14 +194,24 @@ To test this example:
<h5>YAML</h5>
<NginxK8sApp/>
</TabItem>
<TabItem value="embedded" label="embedded-cluster.yaml" default>
<h5>Description</h5>
<p>To install your application with Embedded Cluster, an Embedded Cluster Config must be present in the release. At minimum, the Embedded Cluster Config sets the version of Embedded Cluster that will be installed. You can also define several characteristics about the cluster.</p>
<h5>YAML</h5>
<EcCr/>
</TabItem>
</Tabs>

1. Install the release into an existing cluster and confirm that the service was port-forwarded successfully by clicking **Open App** on the Admin Console dashboard. For more information, see [Online Installation in Existing Clusters with KOTS](/enterprise/installing-existing-cluster).

1. If there is not already a kURL installer promoted to the channel, add a kURL installer to the release to support kURL installs. For more information, see [Create a kURL Installer](/vendor/packaging-embedded-kubernetes).

1. Install the release on a VM and confirm that the service was exposed successfully. To test the port forward, click **Open App** on the Admin Console dashboard after the application reaches a Ready state. For more information, see [Online Installation with kURL](/enterprise/installing-kurl).
1. Install the release on a VM and confirm that you can open the application by clicking **Open App** on the Admin Console dashboard. For more information, see [Online Installation with Embedded Cluster](/enterprise/installing-embedded) or [Online Installation with kURL](/enterprise/installing-kurl).

:::note
Ensure that the VM where you install allows HTTP traffic.
:::

:::note
If you used Replicated Compatibility Matrix to create the VM, follow the steps in [Expose Ports on Running VMs](/vendor/testing-vm-create#expose-ports-on-running-vms) to add these DNS records to the VM:
* A DNS record with a **Target Port** of **30000** to get a hostname where you can access the Admin Console
* A DNS record with a **Target Port** of **8888** to get a hostname where you can access the NGINX application
:::
145 changes: 0 additions & 145 deletions docs/vendor/helm-optional-charts.md
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this topic was an example using a bitnami chart

This file was deleted.

6 changes: 5 additions & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@

[[redirects]]
from = "https://docs.replicated.com/vendor/helm-chart-components"
to = "https://docs.replicated.com/vendor/helm-optional-charts"
to = "https://docs.replicated.com/vendor/packaging-include-resources"

[[redirects]]
from = "https://docs.replicated.com/vendor/helm-optional-charts"
to = "https://docs.replicated.com/vendor/packaging-include-resources"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

redirect the deleted topic


[[redirects]]
from = "https://docs.replicated.com/vendor/packaging-custom-resources"
Expand Down
1 change: 0 additions & 1 deletion sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@ const sidebars = {
label: 'Conditionally Deploy Resources',
items: [
'vendor/packaging-include-resources',
'vendor/helm-optional-charts',
'vendor/tutorial-adding-db-config',
],
},
Expand Down