From 921b9d81528f326634932bc92dcd45c5d26082cc Mon Sep 17 00:00:00 2001 From: inohmonton99 Date: Fri, 4 Dec 2020 22:40:04 +0800 Subject: [PATCH 1/4] dnsmasq configuration --- docs/deployment/configuration/dnsmasq.md | 82 ++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 docs/deployment/configuration/dnsmasq.md diff --git a/docs/deployment/configuration/dnsmasq.md b/docs/deployment/configuration/dnsmasq.md new file mode 100644 index 00000000..2ea21059 --- /dev/null +++ b/docs/deployment/configuration/dnsmasq.md @@ -0,0 +1,82 @@ +--- +title: DNSMASQ - Ubuntu18.04 +sidebar_label: DNSMasq +description: Manage your Onepanel deployment using dnsmasq +--- + +:::caution +This will temporarily break your internet +::: + +1. To use dnsmasq we'll need to first disable Ubuntu’s resolver service. + ```bash + sudo systemctl stop systemd-resolved + ``` +2. We’re going to edit /etc/resolv.conf, so we'll back it up + ```bash + sudo cp /etc/resolv.conf /etc/resolv.conf.bk + ``` +3. Then, set Googles DNS server for our use. + ```bash + shell script echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf + ``` +4. Your internet should work at this point. Run `sudo apt update` Then install dnsmasq + ```bash + sudo apt install dnsmasq + ``` +5. Next, we want to pick a domain name. In this case, we’ll use dnsmasq, add this value to your /etc/hosts file. + ```bash + sudo nano /etc/hosts + ``` + Add: + ``` + 127.0.0.1 dnsmasq + # Other values + ``` + Then save the file. +6. Then, we want to edit dnsmasq.conf file, make sure to back it up before editing. + ```bash + sudo cp /etc/dnsmasq.conf /etc/dnsmasq.conf.bk + sudo nano /etc/dnsmasq.conf + ``` +7. Assuming our web-url we want accessible, from our dnsmasq, is `onepanel.lan` and all the subdomains, such as `waffles.onepanel.lan`, or `app.onepanel.lan` +We need the IP address of onepanel.lan , which is `52.142.34.187` for our guide +You want the following values to be set: + + port=53 + domain-needed + bogus-priv + strict-order + expand-hosts + #IMPORTANT TO MATCH YOUR /etc/hosts value! + domain=dnsmasq + #IP ADDRESS MAY NEED TO BE LOOKED UP FIRST + address=/onepanel.lan/52.142.34.187 + + You may have to run the find command to find these places to update. - Or you can start with a blank conf file and just add those values in. + +8. Finally, we are almost ready to use dnsmasq. +Add one more nameserver. +`sudo nano /etc/resolve.conf` + + nameserver 127.0.0.1 + nameserver 8.8.8.8 + +:::important +Note the order of the nameservers. This is **IMPORTANT**. +We are instructing DNSMasq the order to check in. +::: +Finally, run +```bash +sudo dnsmasq +``` +Then, you can test out in your CLI or Browser. +```bash +dig onepanel.lan +dig loc.onepanel.lan +or +dig waffles.onepanel.lan +``` +The server should return *127.0.0.1#53* + +If you load it in the browser, you’ll get a 404 if the sub-domain has no content it can serve up. - But not a failure to look up Domain \ No newline at end of file From 47ea75d34b81cbe529faf763c55c618e17e789f3 Mon Sep 17 00:00:00 2001 From: inohmonton99 Date: Fri, 4 Dec 2020 22:41:20 +0800 Subject: [PATCH 2/4] minio deployment configuration guide --- docs/deployment/configuration/minio.md | 89 ++++++++++++++++++++++++++ sidebars.js | 1 + 2 files changed, 90 insertions(+) create mode 100644 docs/deployment/configuration/minio.md diff --git a/docs/deployment/configuration/minio.md b/docs/deployment/configuration/minio.md new file mode 100644 index 00000000..869af6d9 --- /dev/null +++ b/docs/deployment/configuration/minio.md @@ -0,0 +1,89 @@ +--- +title: Minio +sidebar_label: Minio +description: Onepanel deployment with MinIO +--- + +MinIO is an object storage server that exposes S3-compatible APIs and it has a gateway feature that allows proxying requests to Azure Blob Storage. To setup our gateway, we will make use of Azure’s Web App on Linux. + +To get started, make sure you have installed Azure CLI and you are logged in (az login). Proceed to create a Resource group, if you don’t have one already: + +```shell +az group create --name "" --location "" +``` + +## Storage Account + +Create a Storage account in your resource group, the name of the storage account must be globally unique: + +```shell +az storage account create \ + --name "" \ + --kind BlobStorage \ + --sku Standard_LRS \ + --access-tier Cool \ + --resource-group "" \ + --location "" +``` + +Retrieve the account key for the storage account: + +```shell +az storage account show-connection-string \ + --name "" \ + --resource-group "" +``` + +The output should be in the format: + +```json +{ + "connectionString": "DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=gitlab-azure-minio-storage;AccountKey=h0tSyeTebs+..." +} +``` + +## Deploy MinIO to Web App on Linux + +First, we need to create an App Service Plan in the same resource group. + +```shell +az appservice plan create \ + --name "" \ + --is-linux \ + --sku B1 \ + --resource-group "" \ + --location "" +``` + +Create a Web app configured with the minio/minio Docker container, the name you specify will be used in the URL of the web app: + +```shell +az webapp create \ + --name "" \ + --deployment-container-image-name "minio/minio" \ + --plan "" \ + --resource-group "" +``` + +The Web app should now be accessible at https://gitlab-minio-app.azurewebsites.net. + +Lastly, we need to set up the startup command and create environment variables that will store our storage account name and key for use by the web app, MINIO_ACCESS_KEY & MINIO_SECRET_KEY. + +```shell +az webapp config appsettings set \ + --settings "MINIO_ACCESS_KEY=" "MINIO_SECRET_KEY=" "PORT=9000" \ + --name "" \ + --resource-group "" + +# Startup command +az webapp config set \ + --startup-file "gateway azure" \ + --name "" \ + --resource-group "" +``` + +## Conclusion + +You can proceed to use this gateway with any client with s3-compability. Your webapp URL will be the **s3 endpoint**, storage account name will be your **accesskey**, and storage account key will be your **secretkey**. + +This guide was adapted for posterity from [Alessandro Segala’s blog post on same topic](https://withblue.ink/2017/10/29/how-to-use-s3cmd-and-any-other-amazon-s3-compatible-app-with-azure-blob-storage.html). \ No newline at end of file diff --git a/sidebars.js b/sidebars.js index f972893e..fbdc4794 100644 --- a/sidebars.js +++ b/sidebars.js @@ -21,6 +21,7 @@ module.exports = { 'getting-started/concepts/workspaces', 'getting-started/concepts/workflows', 'getting-started/concepts/environment-variables', + 'getting-started/concepts/minio' ] }, { From 383f57bd398839b4c932ec6b898204137992fe64 Mon Sep 17 00:00:00 2001 From: inohmonton99 Date: Tue, 8 Dec 2020 03:17:47 +0800 Subject: [PATCH 3/4] minio local deployment documentation guide --- docs/deployment/configuration/files.md | 12 +++++ docs/deployment/configuration/minio.md | 66 +++++++++++++++++++++++++- 2 files changed, 77 insertions(+), 1 deletion(-) diff --git a/docs/deployment/configuration/files.md b/docs/deployment/configuration/files.md index ca78a45d..db4b4bfd 100644 --- a/docs/deployment/configuration/files.md +++ b/docs/deployment/configuration/files.md @@ -260,6 +260,7 @@ artifactRepository: And example Minio configuration: +#### Azure Minio Webapp ```yaml artifactRepository: s3: @@ -270,6 +271,17 @@ artifactRepository: secretKey: 5bEYu26084qjSFyclM/f2pz4gviSfoOg+mFwBH39 ``` +#### Local Minio Server +```yaml +artifactRepository: + s3: + accessKey: AKIAIOSFODNN7EXAMPLE + bucket: my-bucket + endpoint: f67f39e6b94d.ngrok.io + region: us-west-2 + secretKey: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY +``` +