Skip to content

Commit

Permalink
Merge pull request #482 from entando/ENDOC-447
Browse files Browse the repository at this point in the history
ENDOC-447 Change host names to single
  • Loading branch information
jyunmitch authored Apr 13, 2022
2 parents b4ea819 + aa0905d commit 7bc7a60
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 42 deletions.
59 changes: 28 additions & 31 deletions vuepress/docs/next/docs/reference/local-tips-and-tricks.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Here are a few common questions about the quickstart environment. The quickstart
### General
**Q: How can I remove a quickstart environment?**

**A:** If you want to completely remove the VM created by Multipass, you can use `multipass delete <VM-NAME>` (where the default VM-NAME for a quickstart is `entando`) and then `multipass purge` to recover the resources. If you just want to shutdown Entando but keep the VM, you can use `multipass shell <VM-NAME>` to shell into the VM and then remove the namespace via `sudo kubectl delete namespace entando`.
**A:** If you want to completely remove the VM created by Multipass, you can use `multipass delete YOUR-VM-NAME` (where the default YOUR-VM-NAME for a quickstart is `entando`) and then `multipass purge` to recover the resources. If you just want to shutdown Entando but keep the VM, you can use `multipass shell YOUR-VM-NAME` to shell into the VM and then remove the namespace via `sudo kubectl delete namespace entando`.

**Q: What if the installation fails due to timeout?**

Expand All @@ -24,23 +24,23 @@ ent k delete namespace entando

2. Run the following
```
ent quickstart "entando" "quickstart" --simple --debug=1 --yes --with-vm --release=v6.3.2
ent quickstart "entando" "quickstart" --simple --debug=1 --yes --with-vm --release=v7.0.0
```

The namespace will be recreated, preserving the images already pulled, so it's unlikely the installation time will exceed the timeout threshold again.

### Multipass
**Q: How can I shell into a Multipass VM?**

**A:** `multipass shell <VM-NAME>`. If you don't provide a VM-NAME, Multipass will use the default name `primary`, and even launch it for you if it doesn't exist.
**A:** `multipass shell YOUR-VM-NAME`. If you don't provide YOUR-VM-NAME, Multipass will use the default name `primary`, and even launch it for you if it doesn't exist.

**Q: What do I need to do after restarting my laptop?**

**A:** By default, Multipass is installed as a service and will restart automatically. If Multipass isn't running, you'll need to first initialize this service; then you can start your VM via `multipass start <VM-NAME>`. Kubernetes will launch automatically along with any installed pods, including Entando. It can take a few minutes for all of the pods to fully initialize, but you can use `sudo kubectl -n entando get pods --watch` to observe the progress.
**A:** By default, Multipass is installed as a service and will restart automatically. If Multipass isn't running, you'll need to first initialize this service; then you can start your VM via `multipass start YOUR-VM-NAME`. Kubernetes will launch automatically along with any installed pods, including Entando. It can take a few minutes for all of the pods to fully initialize, but you can use `sudo kubectl -n entando get pods --watch` to observe the progress.

**Q: How can I pause or idle my Entando instance?**

**A:** You can pause with `multipass stop <VM-NAME>`, or idle with `multipass suspend <VM-NAME>` to preserve the VM state. You can then use `multipass start <VM-NAME>` to start the VM.
**A:** You can pause with `multipass stop YOUR-VM-NAME`, or idle with `multipass suspend YOUR-VM-NAME` to preserve the VM state. You can then use `multipass start YOUR-VM-NAME` to start the VM.

**Q: What else can Multipass do?**

Expand All @@ -49,37 +49,36 @@ The namespace will be recreated, preserving the images already pulled, so it's u
### Entando in Kubernetes
**Q: How can I install a new copy of Entando into an existing VM?**

**A:** By default, the quickstart installation deploys Kubernetes resources into a dedicated namespace called `entando`. If you want to remove all of the resources in `entando`, you can simply delete the namespace with `sudo kubectl delete namespace entando`. You can then re-create the namespace and re-install the resources by applying the Helm template for your environment. Alternatively, you can achieve this with `ent quickstart --vm-reuse=true`, but you'll need to set other `ent quickstart` options, so check the `ent` help.
**A:** By default, the quickstart installation deploys Kubernetes resources into a dedicated namespace called `entando`. If you want to remove all of the resources in `entando`, you can simply delete the namespace with `sudo kubectl delete namespace entando`. You can then re-create the namespace and re-install the resources. Alternatively, you can achieve this with `ent quickstart --vm-reuse=true`, but you'll need to set other `ent quickstart` options, so check the `ent` help.

**Q: How can I shell into a running pod or view its logs?**

**A:** You can use the standard Kubernetes commands, e.g. `sudo kubectl exec -it <POD-NAME> -c <CONTAINER-NAME -- bash` or `sudo kubectl logs <POD-NAME> <CONTAINER-NAME>`.
**A:** You can use the standard Kubernetes commands, e.g. `sudo kubectl exec -it YOUR-POD-NAME -c YOUR-CONTAINER-NAME -- bash` or `sudo kubectl logs YOUR-POD-NAME YOUR-CONTAINER-NAME`.

**Q: What do I do if Entando doesn't fully initialize?**

**A:** The most common cause of this is a networking problem. See the [Network issues](#network-issues) section below for details. If all else fails, reach out to the Entando team on Slack or in the Forums.

## Shared Servers
We recommend using Multipass to quickly spin up an Ubuntu VM to host a local Kubernetes cluster for test purposes. A local environment is often useful, but most teams utilize a shared Kubernetes cluster. This shared cluster is managed by an operations team, and installed either on premise or with a cloud provider for full integration testing, CI/CD, DevOps, etc.
We recommend using Multipass to quickly spin up an Ubuntu VM to host a local Kubernetes cluster for test purposes. A local environment is often useful, but most teams utilize a shared Kubernetes cluster. This shared cluster is managed by an operations team, and installed either on-premise or with a cloud provider for full integration testing, CI/CD, DevOps, etc.

## Network Issues
A local Entando 7 quickstart installation (e.g. what you'll get if you follow the [Getting Started](../../docs/getting-started/) guide) may use a set of local domain names to enable access to Entando services. Your IP address will vary, but may look something like this:
A local Entando 7 quickstart installation (e.g. what you get if you follow the [Getting Started](../../docs/getting-started/) guide) may use a set of local domain names to enable access to Entando services. Your IP address will vary, but may look something like this:
```
quickstart-entando.192.168.99.1.nip.io
quickstart-kc-entando.192.168.99.1.nip.io
quickstart-eci-entando.192.168.99.1.nip.io
quickstart.192.168.99.1.nip.io
YOUR-APP.192.168.99.1.nip.io
```
The base domain configured via the ENTANDO_DEFAULT_ROUTING_SUFFIX (e.g. in your entando.yaml) borrows a fixed IP address that is created during the initial installation. This domain is used to generate ingress routes to map incoming URLs to individual services. In production environments there's generally a dedicated network layer to manage IPs/routing (both on premise and in the cloud), but this is not readily available in most local setups. Below are a couple of common issues that can prevent Entando from initializing in a local environment:

The base domain configured via the ingressHostName (e.g. in your entandoapp.yaml) is based on the IP address that is created during the initial VM installation. This domain is used to generate ingress routes to map incoming URLs to individual services. In production environments, there's generally a dedicated network layer to manage IPs/routing (both on premise and in the cloud), but this is not readily available in most local setups. Below are a couple of common issues that can prevent Entando from initializing in a local environment:

### `.nip.io isn't allowed`
- This could be due to firewall settings or corporate security policies. The simplest workaround is to manually edit your /etc/hosts file and map the necessary domains to the IP of your local virtual machine.
- This could be due to firewall settings or corporate security policies. The simplest workaround is to manually edit your /etc/hosts file and map the domain to the IP of your local virtual machine.
```
192.168.99.1 quickstart-kc-entando.192.168.99.1.nip.io
192.168.99.1 quickstart-eci-entando.192.168.99.1.nip.io
192.168.99.1 quickstart-entando.192.168.99.1.nip.io
192.168.99.1 quickstart.192.168.99.1.nip.io
192.168.99.1 YOUR-APP.192.168.99.1.nip.io
```
- If you add microservices to your installation, you may need to add additional mappings for the new ingresses.
- See [this section below](#option-2-manually-update-your-hosts-file) for detailed steps to perform this on Windows.
- To update files on Windows, see the [Windows process](#option-2-manually-update-your-hosts-file) below.

### `The IP address changed after the initial install`
- Restarting a Windows computer can cause this (see [Windows Hyper-V IP Changes](#hyper-v-ip-changes) below), and the workaround noted in the `.nip.io isn't allowed` section above also applies (i.e. update your /etc/hosts file). Simply update the IP address in the first column to use the current IP of your virtual machine.
Expand All @@ -97,7 +96,7 @@ Internet Connection Sharing (ICS) is a Windows service that provides Internet co
**A:** The basic issue is that Windows Hyper-V makes it difficult to set a static IP for a VM (see this [forum post](https://techcommunity.microsoft.com/t5/windows-insider-program/hyper-v-default-switch-ip-address-range-change-ver-1809-build/m-p/261431) for details). As discussed [above](#network-issues), Entando's ingress routes rely on a fixed IP address and will break if the IP address changes after initial installation. Here are a few options to solve this issue, short of modifying your router or network switch settings:

#### Option 1: Single host routing
The simplest way to deal with the peculiarities of Hyper-V IP assignment is to avoid it, instead using Windows-specific mshome.net addresses. This allows you to access a VM with an address like `<VM-NAME>.mshome.net`. If you set up your enviroment using the [Automatic Install](../getting-started/#automatic-install) instructions, then the ent CLI will select the single host option and the address will be `entando.mshome.net`. You can accomplish the same thing yourself using the `ent quickstart` script, but see its `--help` for the current set of options.
The simplest way to deal with the peculiarities of Hyper-V IP assignment is to avoid it, instead using Windows-specific mshome.net addresses. This allows you to access a VM with an address like `YOUR-VM-NAME.mshome.net`. If you set up your enviroment using the [Automatic Install](../getting-started/#automatic-install) instructions, then the ent CLI will select the single host option and the address will be `entando.mshome.net`. You can accomplish the same thing yourself using the `ent quickstart` script, but see `--help` for the current set of options.

#### Option 2: Manually update your hosts file
The next simplest option to re-enable external access to your cluster is to update your hosts file after each Windows restart.
Expand All @@ -106,10 +105,9 @@ You need two pieces of information for this workaround, and you'll also need adm

1. Determine the original IP used for your VM. This is included in the `ENTANDO_DEFAULT_ROUTING_SUFFIX`, or you can find it included in the ingress names. Run ` kubectl -n entando get ingress` to see something like this:
````
NAME CLASS HOSTS
quickstart-kc-ingress <none> quickstart-kc-entando.192.168.235.100.nip.io
quickstart-eci-ingress <none> quickstart-eci-entando.192.168.235.100.nip.io
quickstart-ingress <none> quickstart-entando.192.168.235.100.nip.io
NAME CLASS HOSTS
default-sso-in-namespace-ingress <none> quickstart.192.168.235.100.nip.io
quickstart-ingress <none> quickstart.192.168.235.100.nip.io
````

2. Determine the current IP using `hostname -I` in the VM, or by running `multipass list` from Windows:
Expand All @@ -122,9 +120,8 @@ primary Running 172.31.118.12 Ubuntu 18.04 LTS
3. As a Windows administrator, edit your hosts file `(C:\Windows\System32\drivers\etc\hosts)` to map any required URLs from the old IP to the new IP. This will bypass .nip.io lookups.

```
172.31.118.12 quickstart-kc-entando.192.168.235.100.nip.io
172.31.118.12 quickstart-eci-entando.192.168.235.100.nip.io
172.31.118.12 quickstart-entando.192.168.235.100.nip.io
172.31.118.12 quickstart.192.168.235.100.nip.io
172.31.118.12 YOUR-APP.192.168.235.100.nip.io
```

4. You should now be able to access your Entando URLs via the new IP. If your Entando installation stalled during startup, it should continue initializing as soon as the external address is functional again.
Expand All @@ -149,7 +146,7 @@ route -p add 192.168.99.1 mask 255.255.255.255 0.0.0.0 IF 32
```
4. Verify the route was added via `route print 192.168.99.1`. This command is useful after restart to check if the route needs to be created again.

5. Configure your VM to claim the same address. Shell into the VM using `winpty multipass shell [YOUR-VM-NAME]`.
5. Configure your VM to claim the same address. Shell into the VM using `winpty multipass shell YOUR-VM-NAME`.

6. Change to the root user to make the following steps simpler: `sudo -i`

Expand All @@ -171,10 +168,10 @@ network:
version: 2
renderer: networkd
ethernets:
[YOUR-NETWORK-ADAPTER]:
YOUR-NETWORK-ADAPTER:
dhcp4: no
addresses:
- [YOUR-IP]/24
- YOUR-IP/24
```
Example:

Expand All @@ -201,7 +198,7 @@ python3 -m http.server 8000
13. You should now be able to install Entando using the static IP. If your Entando installation stalled during startup, and was previously configured with a static IP, it should continue initializing as soon as the external address is functional again.

#### Option 4: Reinstall Entando
We're including this option because it works and requires no additional configuration. If you plan to regularly work with Entando we recommend developing against a centralized and shared Kubernetes instance rather than running a full stack locally. If you require a local cluster we recommend using option 1 or 2.
We're including this option because it works and requires no additional configuration. If you work with Entando regularly, we recommend developing in a centralized and shared Kubernetes instance rather than running a full stack locally. If you require a local cluster, we recommend using option 1 or 2.

### JHipster
**Q: How can I run JHipster on Windows?**
Expand All @@ -216,7 +213,7 @@ We're including this option because it works and requires no additional configur

**A:** Multipass supports the use of VirtualBox on Windows as an alternative to Hyper-V. Refer to the Multipass documentation for VirtualBox configuration instructions.

For Entando to work correctly with VirtualBox you will need to add a port forwarding rule to access Entando from your host system.
For Entando to work correctly with VirtualBox, you will need to add a port forwarding rule to access Entando from your host system.
* Create your VM within Multipass
* Go to the Oracle VM VirtualBox Manager to edit the `Network` settings for the VM
* Go to the `Advanced` options and click `Port Forwarding Rules`
Expand Down
22 changes: 11 additions & 11 deletions vuepress/docs/next/tutorials/create/mfe/communication.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ sidebarDepth: 2

# Communicate Between Micro Frontends

::: warning Recommended Learning
::: tip Recommended Learning
- Tutorial: [Create a React Micro Frontend](react.md)
- Tutorial: [Create an Angular Micro Frontend](angular.md)
:::

Entando supports communication between micro frontends using [Custom Events](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent), an established web standard. In this tutorial, we'll build:
Entando supports communication between micro frontends using [Custom Events](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent), an established web standard. In this tutorial, we build:

- A React micro frontend that publishes an event
- A React micro frontend that listens to an event
Expand Down Expand Up @@ -275,7 +275,7 @@ You’ve now created a micro frontend that listens to custom events.

Now let's add the publisher and subscriber micro frontends in Entando.

> Note: These are the same steps as the `Create a React Micro Frontend` tutorial.
> Note: These follow the same steps as in the [Create a React Micro Frontend](./react.md#build-it) tutorial.
### Create Environment File

Expand All @@ -288,11 +288,11 @@ Now let's add the publisher and subscriber micro frontends in Entando.
Example:

```
PUBLIC_URL=http://quickstart-entando.192.168.64.34.nip.io/entando-de-app/cmsresources/publisher-widget
PUBLIC_URL=http://quickstart.192.168.64.34.nip.io/entando-de-app/cmsresources/publisher-widget
```

::: warning Notes
- Replace `quickstart-entando.192.168.64.34.nip.io` with the ingress you use to access Entando from your local browser.
::: tip Notes
- Replace `quickstart.192.168.64.34.nip.io` with the ingress you use to access Entando from your local browser.
- `/entando-de-app/cmsresources/` is your Resource URL.
- `publisher-widget` is the public folder we'll create to host the publisher micro frontend.
:::
Expand All @@ -308,7 +308,7 @@ PUBLIC_URL=http://quickstart-entando.192.168.64.34.nip.io/entando-de-app/cmsreso
Example:

```
PUBLIC_URL=http://quickstart-entando.192.168.64.34.nip.io/entando-de-app/cmsresources/subscriber-widget
PUBLIC_URL=http://quickstart.192.168.64.34.nip.io/entando-de-app/cmsresources/subscriber-widget
```

### Run npm build
Expand Down Expand Up @@ -415,7 +415,7 @@ Repeat steps 1-5 for the subscriber widget.
```

### View on a Page
You can setup the widgets on an existing page (such as the Home page) or create your own page using the tutorial [here](../../compose/page-management.md). The following steps assume you'll use the Home page.
You can setup the widgets on an existing page (such as the Home page) or [create your own page](../../compose/page-management.md). The following steps assume you'll use the Home page.

1. Go to `Pages``Management`

Expand Down Expand Up @@ -645,11 +645,11 @@ This will generate a `dist` directory.

> Replace `Publisher Widget`.
3. Click `Publish`.
5. Click `Publish`.

4. In the top navigation, on the right, click `Go to Homepage`.
6. In the top navigation, on the right, click `Go to Homepage`.

5. Enter a greeting in the input field. Press the submit button. The subscriber widget will update with the greeting. Done!
7. Enter a greeting in the input field. Press the submit button. The subscriber widget will update with the greeting. Done!

- Note: If you don't see an input field, refresh the page.

Expand Down

0 comments on commit 7bc7a60

Please sign in to comment.