diff --git a/docs/deployment/configuration/files.md b/docs/deployment/configuration/files.md index 4a3df490..7eb2acaa 100644 --- a/docs/deployment/configuration/files.md +++ b/docs/deployment/configuration/files.md @@ -3,6 +3,8 @@ title: Configuration files sidebar_label: Configuration files description: Onepanel provider specific configuration files --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; There are two files generated after running `opctl init --provider `: @@ -18,6 +20,11 @@ It is highly recommended that you commit `params.yaml` file into a private repos ## Content of configuration file `params.yaml` :::important The template below is automatically generated when your run `opctl init` for your provider. + +This particular one was generated by running +```shell script +opctl init --provider aks --enable-https --enable-cert-manager --dns-provider route53 +``` ::: ```yaml @@ -28,14 +35,12 @@ The template below is automatically generated when your run `opctl init` for you application: # First namespace that will be created in Onepanel, more can be added later defaultNamespace: default - # Domain or IP where Onepanel is hosted - # Use an IP address if running local, use `minikube ip` or `multipass list` to get this IP - # In the cloud, use a first-level or multi-level subdomain like example.com or sub.example.com - domain: + # Domain where Onepanel is hosted + # Use a first-level or multi-level subdomain like example.com or sub.example.com + domain: # The Fully Qualified Domain (FQDN) where Onepanel will be hosted. - # Use the same IP address as `domain` above if running local, use `minikube ip` or `multipass list` to get this IP - # In the cloud, if `domain` above is set to example.com or sub.example.com, then your FQDN could be: app.example.com or app.sub.example.com respectively - fqdn: + # If `domain` above is set to example.com or sub.example.com, then your FQDN could be: app.example.com or app.sub.example.com respectively + fqdn: # HTTP or HTTPS - Do not change, determined by `opctl init --enable-https` # CLI flag: --enable-https insecure: false @@ -53,6 +58,9 @@ application: value: - name: 'Use friendly name 2' value: + # The kubernetes cluster where Onepanel will be deployed. + # Valid values: minikube, microk8s, aks, eks, gke + provider: aks # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Component: Artifact repository # Description: S3 compatible object storage for storing files across Onepanel @@ -71,6 +79,8 @@ artifactRepository: endpoint: s3.amazonaws.com # Change to true if endpoint does NOT support HTTPS insecure: false + # Key Format for objects stored by Workflows. This can reference Workflow variables + keyFormat: artifacts/{{workflow.namespace}}/{{workflow.name}}/{{pod.name}} # Bucket region region: us-west-2 # S3 secret key @@ -82,44 +92,16 @@ artifactRepository: # CLI flag: --enable-cert-manager # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - certManager: - # - - - - - - - - - - - - Select Only One DNS Provider - - - - - - - - - - - - - - - # DNS Provider: AzureDNS - # Docs: https://onepanelio.github.io/core-docs/docs/deployment/configuration/tls#azuredns - # CLI flag: --dns-provider=azuredns - azuredns: - clientId: - spPassword: - subscriptionId: - tenantId: - resourceGroupName: - hostedZoneName: - environment: AzurePublicCloud - # DNS Provider: Google CloudDNS - # Docs: https://onepanelio.github.io/core-docs/docs/deployment/configuration/tls#google-clouddns - # CLI flag: --dns-provider=clouddns - clouddns: - projectId: - serviceAccountKey: - # DNS Provider: Cloudflare - # Docs: https://onepanelio.github.io/core-docs/docs/deployment/configuration/tls#cloudflare - # CLI flag: --dns-provider=cloudflare - cloudflare: - apiToken: - email: + # Enter certificate admin email + # Example: admin@example.com + email: # DNS Provider: Amazon Route53 # Docs: https://onepanelio.github.io/core-docs/docs/deployment/configuration/tls#route53 # CLI flag: --dns-provider=route53 route53: - region: access_key: + region: secret_key: - - # - - - - - - - - - - - - - End DNS Provider Selection - - - - - - - - - - - - - - - - # Enter certificate admin email - # Example: admin@example.com - email: # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Component: Database # Description: Database connection information @@ -143,16 +125,6 @@ database: # If using an external production database, use the username for that database. # For in-cluster test database, use any username you like. username: -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# Component: Application and system logging -# Description: ElasticSearch, Fluentd and Kibana (EFK) logging -# CLI flag: --enable-efk-logging -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -logging: - # ElasticSearch container image - image: docker.elastic.co/elasticsearch/elasticsearch:7.6.0 - # Volume size for EFK logging - volumeStorage: 100Gi ``` ## Sections @@ -161,7 +133,7 @@ What follows is a more detailed description of each section of the `params.yaml` ### application This is where you set the basic application configuration. -Below are the sections you will need to adjust. +The `insecure` field is set to `true` by default and will be set to `false` if you add the `--enable-https` when running `opctl init`. #### defaultNamespace This is the first [Namespace](/docs/getting-started/concepts/namespaces) you want created. This could be a project name or a team name. It is set to `default` by default but we recommend you use something more meaningful. @@ -169,8 +141,16 @@ This is the first [Namespace](/docs/getting-started/concepts/namespaces) you wan #### domain This is the domain for your Onepanel resources. Some resources like Workspaces create subdomains of this domain so they can be accessed by a browser. This can be a top level domain like `example.com` or a subdomain `sub.example.com`. +:::important +Domains, not ip addresses, are required with Istio. +::: + #### fqdn -This is where Onepanel UI and API will be deployed. This should be a subdomain of the `domain` field mentioned above. Example: `app.example.com` or `app.sub.example.com`. +This is where Onepanel UI and API will be deployed. This should be a subdomain of the `domain` field mentioned above. For example: `app.example.com` or `app.sub.example.com`. + +:::important +Domains, not ip addresses, are required with Istio. +::: #### insecure The `insecure` field is set to `true` by default and will be set to `false` if you add the `--enable-https` when running `opctl init`. @@ -186,6 +166,17 @@ You can see all labels on your nodes by running: kubectl get nodes --show-labels ``` +:::note +For minikube, you can use this configuration. +```yaml +nodePool: + label: minikube.k8s.io/minikube + options: + - name: 'Minikube' + value: minikube +``` +::: + Note that this lists many different labels, so you can pick and choose any label key/value that is unique to that node. For example after running the `kubectl` command above, you may get the following list of labels: @@ -262,6 +253,96 @@ database: For a production environment, use a managed database service and set the configuration accordingly. ::: +### metalLB +This is to configure a load balancer for local or bare-metal deployments. + +Example: +```yaml +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Component: Application and kubernetes load balancing on non-cloud deployments. +# Description: MetalLB, LoadBalancer +# CLI flag: --enable-metallb +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +metalLb: + addresses: + - 10.1.31.1/24 +``` + +Getting the address range + + + +First, find minikube's ip. + +```shell script +minikube ip +``` + +For the first part of the range, use `minikube ip + 1` + +So if `minikube ip` gives us `192.168.64.64` + +We use `192.168.64.65` + +For the second part of the range, change the last part to `255` + +So we can use a range of `192.168.64.65` to `192.168.64.255` + +```yaml +metalLb: + addresses: + - 192.168.64.65-192.168.64.255 +``` + + + + +Get inside the VM of multipass. + +```shell script +multipass shell microk8s-vm +``` + +```shell script +ifconfig -a +``` + +You'll get something like this +```shell script +cni0: flags=4163 mtu 1450 + inet 10.1.31.1 netmask 255.255.255.0 broadcast 0.0.0.0 + inet6 fe80::58ce:8dff:fe5e:2be5 prefixlen 64 scopeid 0x20 + ether 5a:ce:8d:5e:2b:e5 txqueuelen 1000 (Ethernet) + RX packets 37251 bytes 4363323 (4.3 MB) + RX errors 0 dropped 0 overruns 0 frame 0 + TX packets 38095 bytes 9152263 (9.1 MB) + TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 +[...Other output...] +``` + +We want CNI because it's the Container Network Interface. + +In our case, we have `10.1.31.1` + +So we can use `10.1.31.0/24` for a range of `10.1.31.0` to `10.1.31.255` + +```yaml +metalLb: + addresses: + - 10.1.31.1/24 +# or +# - 10.1.31.0 - 10.1.31.255 +``` + + + + ### workflowEngine #### containerRuntimeExecutor The executor workflow engine uses to perform certain actions like monitoring pod logs, collecting artifacts, managing container lifecycles, etc. @@ -269,4 +350,4 @@ The executor workflow engine uses to perform certain actions like monitoring pod The possible values are `docker` and `pns`: - `docker` is more reliable, however it mounts the `docker.sock` of the host makes it less secure. -- `pns` is more secure, however in some versions of Kubernetes, it tends to fail on tasks that take less than 15 seconds. \ No newline at end of file +- `pns` is more secure, however in some versions of Kubernetes, it tends to fail on tasks that take less than 15 seconds. diff --git a/docs/deployment/overview.md b/docs/deployment/overview.md index 4a07b184..c419af62 100644 --- a/docs/deployment/overview.md +++ b/docs/deployment/overview.md @@ -13,11 +13,12 @@ You can install Onepanel on: Follow these guides to install Onepanel in public cloud. -- To install on Azure Kubernetes Engine (AKS) follow [AKS installation guide](/docs/deployment/public/aks) -- To install on Google Kubernetes Engine (GKE) follow [GKE installation guide](/docs/deployment/public/gke) -- To install on Elastic Kubernetes Service (EKS) follow [EKS installation guide](/docs/deployment/public/eks) +- To deploy on Azure Kubernetes Engine (AKS) follow [AKS deployment guide](/docs/deployment/public/aks) +- To deploy on Google Kubernetes Engine (GKE) follow [GKE deployment guide](/docs/deployment/public/gke) +- To deploy on Elastic Kubernetes Service (EKS) follow [EKS deployment guide](/docs/deployment/public/eks) ## Installing on a single-node cluster -Coming soon +- To deploy on Minikube follow [Minikube deployment guide](/docs/deployment/single-node/minikube) +- To deploy on MicroK8s follow [MicroK8s deployment guide](/docs/deployment/single-node/microk8s) diff --git a/docs/deployment/single-node/microk8s.md b/docs/deployment/single-node/microk8s.md index 0e3c7f2a..0d4a767a 100644 --- a/docs/deployment/single-node/microk8s.md +++ b/docs/deployment/single-node/microk8s.md @@ -1,7 +1,6 @@ --- -title: MicroK8s installation guide -sidebar_label: Installing on MicroK8s -description: Deploy Onepanel on MicroK8s +title: MicroK8s deployment guide +sidebar_label: MicroK8s deployment --- This document outlines the installation steps for single node installation using [Multipass](https://multipass.run/) VM and [MicroK8s](https://microk8s.io/). @@ -23,31 +22,31 @@ import TabItem from '@theme/TabItem'; }> -:::important Instructions +:::info Instructions See [Installing on Linux](https://multipass.run/docs/installing-on-linux) ::: -:::important Instructions +:::info Instructions See [Installing on macOS](https://multipass.run/docs/installing-on-macos) ::: -:::important Instructions +:::info Instructions See [Installing on Windows](https://multipass.run/docs/installing-on-windows) ::: -With multipass installed, you can now create a VM to run MicroK8s. At least 4 Gigabytes of RAM and 40G of storage is recommended – you can pass these requirements when you launch the VM: +With multipass installed, you can now create a VM to run MicroK8s. At least 8 Gigabytes of RAM and 40G of storage is recommended – you can pass these requirements when you launch the VM: ```bash -multipass launch --name microk8s-vm --mem 4G --disk 40G +multipass launch --name microk8s-vm --mem 8G --disk 40G --cpus 4 # 8G ram for Istio, recommended ``` You can now find the IP address which has been allocated by running: @@ -74,7 +73,7 @@ multipass shell microk8s-vm Install the MicroK8s snap and configure the network: ```bash -sudo snap install microk8s --classic --channel=1.17/stable +sudo snap install microk8s --classic --channel=1.18/stable sudo iptables -P FORWARD ACCEPT ``` @@ -82,18 +81,52 @@ You will also need to add `ubuntu` user to `microk8s` group as follows: ```bash sudo usermod -a -G microk8s ubuntu +# Re-enter bash session for group changes ``` Then, enable the following required add-ons: ```bash -sudo microk8s.enable storage dns +sudo microk8s.enable storage dns rbac dashboard ``` -```bash -sudo microk8s.enable dashboard +Enable TokenRequest feature (required by Istio) by passing in extra argument to the api server. +```shell script +nano /var/snap/microk8s/current/args/kube-apiserver +``` + +:::note +If you don't see any content, try exiting the multipass vm and entering again. +::: + +Add the lines: +```text +--service-account-signing-key-file=${SNAP_DATA}/certs/serviceaccount.key +--service-account-key-file=${SNAP_DATA}/certs/serviceaccount.key +--service-account-issuer=api +--service-account-api-audiences=api,nats +``` +Make sure this line is set to these values: +```text +--authorization-mode=RBAC,Node +``` + +Save your changes. +Execute to make changes take effect +```shell script +sudo systemctl restart snap.microk8s.daemon-apiserver ``` +Check microk8s is running with `microk8s status` +:::note +If you see a "not running" error, run `microk8s inspect`. +- Since the api server was just changed, it's most likely that's where the error is. +- Check what reports as "FAIL" +- Assuming it's the api server +- Untar the report file, go to the daemon-apiserver folder, open `journal` log file. +- Search for "error" and see what comes up. +::: + ## Install Onepanel 1. Download the latest `opctl` for your operating system from [our release page](https://github.com/onepanelio/core/releases/latest). @@ -104,7 +137,19 @@ sudo microk8s.enable dashboard opctl init --provider microk8s ``` -3. Populate `params.yaml` by following the instructions in the template, you can also refer to the [configuration files](/docs/deployment/configuration/files) section. +:::note +If you don't have a loadbalancer, and want to use a local one, you can use metallb. +```shell script +opctl init --provider microk8s --enable-metallb +``` +::: + + +3. Populate `params.yaml` before applying, follow the instructions in the template, you can also refer to the [configuration files](/docs/deployment/configuration/files) section. + +:::note +See [configuration metallb](/docs/deployment/configuration/files#metal-lb) for metallb specific details. +::: 4. Get Kubernetes config from MicroK8s: @@ -122,8 +167,109 @@ KUBECONFIG=./kubeconfig opctl apply The CLI will display the URL for accessing Onepanel once the deployment completes. ::: -6. Use the following command to get your auth token to log into Onepanel: +6. To get access to this new cluster via browser, we need to carry out extra steps. + +Example request flow + +Request Flow with Multipass + +Execute these steps in the host machine. + +```shell script +multipass list +``` + +Grab the IP address for your microk8s. +Example: +```text +Name State IPv4 Image +microk8s-vm Running 10.174.163.50 Ubuntu 18.04 LTS +``` + +Add an entry to your hosts file to point to the fqdn you setup in `params.yaml` +Example entry: +```yaml + # The Fully Qualified Domain (FQDN) where Onepanel will be hosted. + # If `domain` above is set to example.com or sub.example.com, then your FQDN could be: app.example.com or app.sub.example.com respectively + fqdn: app.alex.xyz +``` + +Entry to `/etc/hosts` +```text +10.174.163.50 app.alex.xyz +``` + +Adding this entry means the host browser will try to access the multipass vm we setup +for microk8s. + +Next, enter into multipass VM +```shell script +multipass shell microk8s-vm +``` + +:::note Execute inside the multipass VM +```shell script +microk8s.kubectl get services -n istio-system +``` + +```text +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE +istio-ingressgateway LoadBalancer 10.152.183.166 10.1.31.0 15020:31979/TCP,80:31394/TCP,443:30038/TCP,15029:32204/TCP,15030:32688/TCP,15031:31420/TCP,15032:30575/TCP,15443:30386/TCP 3d3h +``` + +Inside the multipass VM, add an entry to the `/etc/hosts` file. +```shell script +sudo nano /etc/hosts +``` +```text +10.1.31.0 app.alex.xyz +``` + +Once you have entered and saved the host change, verify you the onepanel website +is running. + +```shell script +curl app.alex.xyz # Your params.yaml fqdn entry +``` + +Example output. +```text + + + + + Onepanel + + + + + + + + + + +``` + +You can debug the request with `curl -vvv app.alex.xyz` + +We need a listener running on port 80. That listener should direct traffic +to the istio gateway. + +```shell script +sudo apt install socat +sudo socat TCP-LISTEN:80,fork TCP:app.alex.xyz:80 +``` +This will run actively in the current terminal prompt. +::: + +Now, go back to your host machine, open your internet browser and go to: +`app.alex.xyz`. + +You should see the website load up. + +7. Use the following command to get your auth token to log into Onepanel: ```bash KUBECONFIG=./kubeconfig opctl auth token -``` \ No newline at end of file +``` diff --git a/docs/deployment/single-node/minikube.md b/docs/deployment/single-node/minikube.md index d69e77ea..b1af7591 100644 --- a/docs/deployment/single-node/minikube.md +++ b/docs/deployment/single-node/minikube.md @@ -1,7 +1,6 @@ --- -title: Minikube installation guide -sidebar_label: Installing on Minikube -description: Deploy Onepanel on Minikube +title: Minikube deployment guide +sidebar_label: Minikube deployment --- This document outlines the installation steps for single node installation using [Minikube](https://kubernetes.io/docs/setup/learning-environment/minikube/). @@ -10,10 +9,15 @@ This document outlines the installation steps for single node installation using See [Install Minikube](https://kubernetes.io/docs/tasks/tools/install-minikube/) and follow the instructions for your operating system. -Once Minikube is installed, start it with at least 4 Gigabytes of RAM and 40G of storage – you can pass these requirements as follows: +Once Minikube is installed, start it with at least 8 Gigabytes of RAM, 4 CPUs, and 40G of storage (for Istio) – you can pass these requirements as follows: ```bash -minikube start --memory '4gb' --disk-size '40g' +minikube start --driver=virtualbox --memory '8gb' --cpus=4 --disk-size '40g' \ + --extra-config=apiserver.service-account-signing-key-file=/var/lib/minikube/certs/sa.key \ + --extra-config=apiserver.service-account-key-file=/var/lib/minikube/certs/sa.pub \ + --extra-config=apiserver.service-account-issuer=api \ + --extra-config=apiserver.service-account-api-audiences=api,nats \ + --extra-config=apiserver.authorization-mode=Node,RBAC ``` You can now find the IP address which has been allocated by running: diff --git a/docs/getting-started/concepts/environment-variables.md b/docs/getting-started/concepts/environment-variables.md index 6852a674..f04795c5 100644 --- a/docs/getting-started/concepts/environment-variables.md +++ b/docs/getting-started/concepts/environment-variables.md @@ -10,6 +10,6 @@ The following system environment variables are always automatically added to bot - `ONEPANEL_API_URL` Platform API URL that can be used to make SDK or API calls from any container. - `ONEPANEL_FQDN` Fully qualified domain name (FQDN) where platform UI and API is installed. Example: `app.sub.domain.com` -- `ONEPANEL_DOMAIN` Domain name where the platofrm is installed. Example: `sub.domain.com` +- `ONEPANEL_DOMAIN` Domain name where the platform is installed. Example: `sub.domain.com` - `ONEPANEL_RESOURCE_NAMESPACE` The namespace where the resource is running. - `ONEPANEL_RESOURCE_UID` The unique ID of the resource in namespace. diff --git a/docs/getting-started/quickstart.md b/docs/getting-started/quickstart.md index 8781ca28..6f8876d6 100644 --- a/docs/getting-started/quickstart.md +++ b/docs/getting-started/quickstart.md @@ -20,11 +20,14 @@ Before getting started, take a look at [concepts](/docs/getting-started/concepts Next, create a Kubernetes cluster in one of the following cloud providers: @@ -110,6 +113,134 @@ The command above will automatically retrieve your cluster's access credentials gcloud container clusters get-credentials --zone ``` + + + +:::note +Make sure [Minikube](https://minikube.sigs.k8s.io/docs/start/) (`minikube`) is installed before proceeding. +::: + +Run the following `minikube` command to create a cluster: + +```shell script +minikube start --driver=virtualbox --memory '8gb' --cpus=4 --disk-size '40g' \ + --extra-config=apiserver.service-account-signing-key-file=/var/lib/minikube/certs/sa.key \ + --extra-config=apiserver.service-account-key-file=/var/lib/minikube/certs/sa.pub \ + --extra-config=apiserver.service-account-issuer=api \ + --extra-config=apiserver.service-account-api-audiences=api,nats \ + --extra-config=apiserver.authorization-mode=Node,RBAC +``` + +Your kubectl context will be automatically updated once minikube finishes starting. + + + + +First, install Multipass for your operating system: + + + + +:::info Instructions +See [Installing on Linux](https://multipass.run/docs/installing-on-linux) +::: + + + + +:::info Instructions +See [Installing on macOS](https://multipass.run/docs/installing-on-macos) +::: + + + + +:::info Instructions +See [Installing on Windows](https://multipass.run/docs/installing-on-windows) +::: + + + + +Run the following `multipass` command to launch Multipass: + +```shell script +multipass launch --name microk8s-vm --mem 8G --disk 40G --cpus 4 # 8G ram recommended for Istio +``` + +Multipass creates a virtual machine (VM). Inside that VM, we will create a Kubernetes cluster with microk8s. + +Run a shell into your VM: + +```bash +multipass shell microk8s-vm +``` + +Install the MicroK8s snap and configure the network: + +```bash +sudo snap install microk8s --classic --channel=1.18/stable +sudo iptables -P FORWARD ACCEPT +``` + +You will also need to add `ubuntu` user to `microk8s` group as follows: + +```bash +sudo usermod -a -G microk8s ubuntu + +# Re-enter bash session for group changes +exit +multipass shell microk8s-vm +``` + +Then, enable the following required add-ons: + +```bash +sudo microk8s.enable storage dns rbac dashboard +``` + +Enable TokenRequest feature (required by Istio) by passing in extra argument to `kube-apiserver`. + +```shell script +nano /var/snap/microk8s/current/args/kube-apiserver +``` +Add the lines: +```text +--service-account-signing-key-file=${SNAP_DATA}/certs/serviceaccount.key +--service-account-key-file=${SNAP_DATA}/certs/serviceaccount.key +--service-account-issuer=api +--service-account-api-audiences=api,nats +``` +Make sure this line is set to these values: +```text +--authorization-mode=RBAC,Node +``` + +Save your changes. +Execute to make changes take effect +```shell script +sudo systemctl restart snap.microk8s.daemon-apiserver +``` + +Exit out of the VM for the next steps. +```shell script +exit +``` + +Next, get the kubeconfig by running + +```shell script + multipass exec microk8s-vm -- /snap/bin/microk8s.config > kubeconfig + ``` + @@ -118,6 +249,7 @@ gcloud container clusters get-credentials --zone 1. Download the latest `opctl` for your operating system from [our release page](https://github.com/onepanelio/core/releases/latest). @@ -198,17 +333,104 @@ opctl init --provider eks opctl init --provider gke ``` + + + + +```bash +opctl init --provider minikube +``` + +:::note +If you do not have a loadbalancer setup, you can use metallb +```shell script +opctl init --provider minikube --enable-metallb +``` +::: + + + + + +```bash +opctl init --provider microk8s +``` + +:::note +If you do not have a loadbalancer setup, you can use metallb +```shell script +opctl init --provider microk8s --enable-metallb +``` +::: + 3. Populate `params.yaml` by following the instructions in the template, you can also refer to [configuration file sections](/docs/deployment/configuration/files#sections) for more detailed information. +:::note +See [configuration metallb](/docs/deployment/configuration/files#metal-lb) for metallb specific details. +::: + 4. Finally, run the following command to deploy Onepanel to your cluster: + + + +```bash +opctl apply +``` + + + + +```bash +opctl apply +``` + + + + +```bash +opctl apply +``` + + + + + ```bash opctl apply ``` + + + + +```bash +KUBECONFIG=./kubeconfig opctl apply +``` + +:::note +If you do not have a loadbalancer setup, you can use metallb +```shell script +opctl init --provider microk8s --enable-metallb +``` +::: + + + + :::note If the command completes but it indicates that your cluster is not ready, you can check status again by running `opctl app status`. If you're still seeing issues, visit our [Troubleshooting](/docs/deployment/troubleshooting/overview) page. ::: @@ -231,7 +453,139 @@ If you don't have a domain name handy or you're waiting for your DNS record to p If the application is not loading, visit our [Troubleshooting](/docs/deployment/troubleshooting/overview) page for some steps that can help resolve most issues. If you are still having issues, join our [Slack community](https://join.slack.com/t/onepanel-ce/shared_invite/zt-eyjnwec0-nLaHhjif9Y~gA05KuX6AUg) or open an issue in [GitHub](https://github.com/onepanelio/core/issues). ::: -8. Use the following command to get your auth token to log into Onepanel: +8. Network setup + + + + None + + + None + + + None + + + None + + +To get access to this new cluster via browser, we need to carry out extra steps. + +Example request flow + +Request Flow with Multipass + +Execute these steps in the host machine. + +```shell script +multipass list +``` + +you should see something like this + +```text +Name State IPv4 Image +microk8s-vm Running 10.174.163.50 Ubuntu 18.04 LTS +``` + +Grab the IP address, 10.174.163.50 in this case. + +Add an entry to your hosts file to point to the fqdn you setup in `params.yaml` +For example, if our fqdn was set up like this +```yaml +# The Fully Qualified Domain (FQDN) where Onepanel will be hosted. +# If `domain` above is set to example.com or sub.example.com, then your FQDN could be: app.example.com or app.sub.example.com respectively +fqdn: app.alex.xyz +``` + +Then we add this to `/etc/hosts` +```text +10.174.163.50 app.alex.xyz +``` + +Adding this entry means the host browser will try to access the multipass vm we setup +for microk8s. + +Next, enter into the multipass VM +```shell script +multipass shell microk8s-vm +``` + +:::note Execute inside the multipass VM +```shell script +microk8s.kubectl get services -n istio-system +``` +::: + +```text +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE +istio-ingressgateway LoadBalancer 10.152.183.166 10.1.31.0 15020:31979/TCP,80:31394/TCP,443:30038/TCP,15029:32204/TCP,15030:32688/TCP,15031:31420/TCP,15032:30575/TCP,15443:30386/TCP 3d3h +``` + +Inside the multipass VM, add an entry to the `/etc/hosts` file using the EXTERNAL-IP from above. +```shell script +sudo nano /etc/hosts +``` + +```text +10.1.31.0 app.alex.xyz +``` + +Once you have entered and saved the host change, verify the onepanel website is running. + +```shell script +curl app.alex.xyz # This is the fqdn entry from params.yaml +``` + +Example output. +```text + + + + + Onepanel + + + + + + + + + + +``` + +You can debug the request with `curl -vvv app.alex.xyz` + +We need a listener running on port 80. That listener should direct traffic +to the istio gateway. + +```shell script +sudo apt install socat +sudo socat TCP-LISTEN:80,fork TCP:app.alex.xyz:80 +``` + +This will run actively in the current terminal prompt. + +Now, go back to your host machine, open your internet browser and go to: +`app.alex.xyz`. + +You should see the website load up. + + + +9. Use the following command to get your auth token to log into Onepanel: ```bash opctl auth token diff --git a/sidebars.js b/sidebars.js index 0c9ad028..2cddf514 100644 --- a/sidebars.js +++ b/sidebars.js @@ -80,6 +80,8 @@ module.exports = { 'deployment/public/aks', 'deployment/public/eks', 'deployment/public/gke', + 'deployment/single-node/microk8s', + 'deployment/single-node/minikube', ] }, { diff --git a/static/img/multipass_request_flow.png b/static/img/multipass_request_flow.png new file mode 100755 index 00000000..790a15b6 Binary files /dev/null and b/static/img/multipass_request_flow.png differ