Networking
The Networking section of the Cockpit lets you create and manage ingresses, domains, and certificates, as well as handle redirects and configure your desired redirect settings.
Select desired cluster
Select your desired cluster from the dropdown menu at the top of the Cockpit.
Ingresses
You can add an ingress for any domain you choose. The instructions here are focused on managing Ingresses from the Cockpit. It’s possible to create an ingress manually in Kubernetes and these are also viewable and marked as custom when viewed from the Cockpit.
- Actions
Add an ingress
-
Go to Networking > Ingresses.
-
Select the desired Cluster from the dropdown list.
-
Click Add Ingress.
-
In the dialog:
-
Give your Ingress a Name.
-
Choose a Namespace.
-
If you want, add rule(s) under Rules.
What are Ingress rules?Ingress rules specify the direction of allowed access to and from different identities and resources.
-
Path type: Choose the path type.
-
ImplementationSpecific
: Matching is up to the IngressClass. -
Exact
: Matches the URL path exactly including being case-sensitive. -
Prefix
: Matches based on a URL path prefix split by/
. This is case-sensitive.
-
-
Host: Choose the host from the dropdown menu. Only available hosts are listed.
-
Path: Specify the path itself, such as
/icons
or/docs
. -
Service: Choose the desired service from the dropdown. This is typically
public
orauthor
. -
Port: Choose the port. This can be the port number (such as
9090
) or the port name if a name is given.Check Rancher for the port name and number if needed.
-
-
If you want, add Certificates to the Ingress.
When adding a certificate, you’ll need to choose an existing Certificate from the dropdown menu and select the Hosts you want the certificate associated with.
-
Don’t forget to click Add Ingress.
-
Associate an ingress with CDN
To associate an ingress with the CDN:
-
Under Networking > Ingresses (tab), select your desired Ingress from the list.
-
On the right, select the accordion.
-
Click Enable CDN.
-
Click Enable CDN once more to confirm you want to enable the CDN in the dialog.
Edit an ingress
-
Under Networking > Ingresses (tab), select your desired Ingress from the list.
-
On the right, select the accordion. (you may need to scroll over)
-
Click Edit Ingress.
-
Edit the Rules or Certificates.
-
Click Edit Ingress to save your changes.
Delete an ingress
To delete an ingress:
-
Under Networking > Ingresses (tab), select your desired Ingress from the list.
-
On the right, select the accordion.
-
Click Delete Ingress.
Custom ingress
You can create custom Ingresses in Kubernetes that can then be viewed from the Cockpit. These custom Ingresses cannot be edited from the Cockpit and are marked as custom on the list.
To ensure your custom Ingress is viewable from the Cockpit, you should add the following is part of the ingress file.
...
magnolia.info/is-custom = true
...
Manage certificates
You can manage your own certificates directly in the Cockpit under the Networking section.
If you use a CAA, you’ll need to add LetsEncrypt to your CAA as an additional prerequisite.
Select desired cluster
Select your desired cluster from the dropdown menu at the top of the Cockpit.
Add certificate
Follow the instructions here to add a certificate.
The maximum number of subdomains per domain is 100.
The maximum subdomain and domain length combined is 250 characters.
You should upload a certificate with either a 2048-bit RSA key, 4096-bit RSA key or 256-bit ECDSA key.
You can use wildcards for custom certificates, which are handled as part of these instructions.
However, if using LetsEncrypt, you must file a Support request for wildcard certificates.
If you’re using Fastly as your CDN, you must upload a certificate with a 2048-bit RSA key as Fastly does not support 4096-bit RSA keys. |
-
Go to your Cockpit and navigate to Networking > Certificates.
-
Click Add.
-
Give the certificate a Name.
Names must start with a letter and can contain letters, numbers, hyphens (
-
), and underscores (_
) only. -
Select the Key size for your certificate.
Key sizes explained
-
If desired, provide an Alternative name for your certificate.
-
Enter the Common Name for your certificate.
Important additional information
-
Enter the Organization associated with the certificate.
This is the full legal company or personal name. (such as Magnolia International or Thomas Bianconi)
-
If applicable, provide the Organizational Unit name.
Example: Product Development
-
Enter the Locality, the full city name.
Example: Basel.
-
Enter the State, the full state name.
Example: Basel Stadt
-
Enter the Country’s two letter code.
Example: CH
-
Click Add to complete the process.
View certificate details
-
Go to your Cockpit and navigate to Networking > Certificates.
-
Go to the certificate you want to view.
-
On the right, click the green circle with lines.
-
Click Certificate details.
Here, you can see important details such as:
-
Certificate hierarchy
-
Certificate type
-
Who the certificate was issued to
-
Who the certificate was issued by
-
The validity period of the certificate
-
Fingerprints such as Algorithm and key size
Create redirects
You can view redirects that you have created or add them directly yourself from the Cockpit. You must publish any changes you make to redirects.
Good to knows
-
The redirects server is a proxy server.
-
Redirects are evaluated in order of appearance when entered. The first match is accepted.
-
Only
3xx
status codes are acceptable. Different codes affect the browser in different ways. For more, see here. -
Wrong entries in a CSV file won’t cause any issues. They’ll simply be ignored.
-
Some applications (like Microsoft Excel) wrap quotations (
"
) around CSV lines. You need to remove those quotations if importing or adding a redirect in the Cockpit. -
You can use RE2 syntax.
RE2 Syntax examples
Regex example
https://www.example.com/0-9{2}(bar|baz)` matches
https://www.example.com/01bar
or `\https://www.example.com/14bazWildcard example
https://www.example.com/(.*)
→https://www.example.com/$1.html
redirectshttps://www.example.com/test
tohttps://www.example.com/test.html
- Actions
Select desired cluster
Select your desired cluster from the dropdown menu at the top of the Cockpit.
Add redirect server
By default, redirects are served from the backend. However, you can configure the settings to suit your needs if you want to use a Frontend redirect. Follow the instructions here to do just that:
-
In your Cockpit, go to Networking > Redirects.
-
Click the Add redirect server button.
-
In the dialog, choose the settings that best suit your needs.
-
Choose the number of Replicas you would like. There is a minimum of 2 redirect server replicas.
You may choose as many replicas as needed. However, if no more memory is available, the system rejects new replicas.
-
Under Redirects server, choose Backend or Frontend .
If choosing Frontend, you’ll need to pass the port number you want to use, such as
8080
. -
Under Load balancing, choose Round Robin or Cookie based load balancing.
If choosing Cookie based, you’ll need to give the cookie a name. If you have sticky sessions enabled, this name must be the same as the value in the nginx.ingress.kubernetes.io/session-cookie-name
ingress annotation in yourvalues.yml
file.
-
-
Don’t forget to save your updates.
Add redirects
-
Go to Networking > Redirects.
-
Select the desired Environment from the dropdown list.
-
Add a single redirect or import a redirect CSV file.
-
Click Add.
-
In the dialog, fill out the following.
-
The Source URL. This is the place to redirect from.
-
The Target URL. This is the place to redirect to.
-
The Code. This is the http status code passed with the redirect. Only
3xx
http codes are acceptable. -
Check Url with regular expression if the URL provided uses RegEx.
(.*)
Why use RegEx? -
Click Add to complete the action.
-
-
Click Add (CSV).
-
Click Choose File to import a CSV file for redirects.
formatId,Source,Target,Code,IsRegex (1)
1 Only 3xx
http codes are acceptable.exampleId,Source,Target,Code,IsRegex 1,https:://www.example.com/[0-9]{2}(bar%7Cbaz),https://www.example.be/barbaz.html,308,true
-
Select your file.
-
Click Add (CSV) to complete the action.
-
Manage redirects
If necessary, you can also edit or delete a redirect.
-
Go to Networking > Redirects.
-
Select the desired Cluster from the dropdown list.
-
Select the desired Environment from the dropdown list.
-
Select the redirect you want to manage.
Publish redirects
You must publish any changes you’ve made to redirects from within the Cockpit.
-
Go to Networking > Redirects.
-
Make changes as desired inside the Redirects screen.
-
Click Publish.
-
Enter a meaningful message so it’s easier to understand what changes were made. This is useful if you need to restore changes.
-
Click Publish.