Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
Revise doc; include new example kubeconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
Chr1st1anSears committed Sep 28, 2023
1 parent 3721858 commit 91efb1d
Showing 1 changed file with 50 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,31 +1,63 @@
= Creating your own environment

Use {ProductName} to continuously build and test your application. Use your own cluster as your deployment environment. By using your own cluster outside Red Hat, you have more control over where your application is deployed, and you can ensure it meets your specific needs. If you bring your own cluster you can still access all the features and benefits of {ProductName}.
You can configure {ProductName} to deploy applications to your own cloud-hosted cluster, outside the default development environment. By using this option to bring your own cluster (BYOC), you can deploy your applications to an environment that meets your specific needs. And if you bring your own cluster, you can still access all the features and benefits of {ProductName}.

.Prerequisites

* You must have access to credentials with full read and write access to the namespace that you provided to {ProductName}.
* When you upload a `kubeconfig` file, it must include a credential with full read and write access to your provided namespace.
* The supplied `kubeconfig` file must use token-based authentication to connect to your cluster. Other mechanisms, such as certificate-based authentication, are not yet supported.
* The context in your `kubeconfig` file must point to the cluster you want to use at the time you upload the file.
.Procedures

To create your own environment and upload your own `kubeconfig` file, complete the following steps in the {ProductName} UI:

. Go to *Environments* > *Create Environment*.
. Complete all the required fields for *Create Environment*.
* You must have credentials for full read and write access to the namespace for your cluster.
.Procedure

To create your own environment, you first need to create a functional `kubeconfig` file. Then, using that file, you add the cluster as a new environment in the {ProductName} UI.

. In your preferred text editor, create a `kubeconfig` file based on the following example:

+
[source]
--
apiVersion: v1
clusters:
- cluster:
server: https://api.sandbox-m2.ll9k.p1.openshiftapps.com:6443
name: api-sandbox-m2-ll9k-p1-openshiftapps-com:6443
contexts:
- context:
cluster: api-sandbox-m2-ll9k-p1-openshiftapps-com:6443
namespace: rhn-support-csears-dev
user: rhn-support-csears/api-sandbox-m2-ll9k-p1-openshiftapps-com:6443
name: rhn-support-csears-dev/api-sandbox-m2-ll9k-p1-openshiftapps-com:6443/rhn-support-csears
current-context: rhn-support-csears-dev/api-sandbox-m2-ll9k-p1-openshiftapps-com:6443/rhn-support-csears
kind: Config
preferences: {}
users:
- name: rhn-support-csears/api-sandbox-m2-ll9k-p1-openshiftapps-com:6443
user:
token: sha256~<remainder of token omitted>
--

+
. In the {ProductName} UI, go to *Environments* > *Create Environment*.
. Enter a name for the new environment.
. Complete all the required fields for *Cluster information*:
.. For *Select cluster*, select that you are bringing your own cluster.
.. For *Cluster type*, select *Non-OpenShift* or *OpenShift*.
. Upload your `kubeconfig` file.
. Attach the namespace to the cluster that you selected for this application.
.. Upload your `kubeconfig` file, or paste its contents into the space provided.
.. Specify the namespace for the cluster that you are using.
. Select *Create environment*.
. Confirm that your environment is created and is accessible under *Environments*.

.Troubleshooting

If there were any errors while creating your environment, complete the following steps:
If any errors occur while creating your environment, complete the following steps:

. Make sure the token you provided in your `kubeconfig` is valid. If the token in your `kubeconfig` has expired, log in to your cluster and request a new token.
. Verify that you entered the correct values in the correct places in your `kubeconfig` file. When reading the example file, you can easily mistake the namespace, `rhn-support-csears-dev`, for the username, `rhn-support-csears`, and vice versa.
. Confirm that your cluster can support another pod for deploying your application.
. If you do not find any errors in your `kubeconfig` file, go to *Environments* in the {ProductName} UI, select the three dots next to your new environment, delete the failed environment, and create it again.
. If that still does not work, try clearing the cache of your browser. If you are using Chrome, try deleting and creating the environment again using Incognito Mode.

.Additional resources

. Go to *Environment Card* > *Connection error*.
. Delete the failed environment.
. Create a new environment. Only include the sections of your `kubeconfig` file that relate to the target cluster and credentials.
* If you have the rights in your cluster to assign the `cluster-admin` role to a Service Account, you can follow link:https://gist.github.com/jannfis/07095088c0b5a10681db3b48fd197641[these instructions] to create a `kubeconfig` with a token that doesn't expire.

0 comments on commit 91efb1d

Please sign in to comment.