Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If something in the UI changes this is outdated.
I would explain the necessary configuration options along with sensible default values.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somewhat the same nitpick as with the other UI screenshot.
Although a good description would be preferred, in this case I would at least only select the relevant part of the page so it's better legible.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/modules/ROOT/assets/images/logos/nextcloud.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
** xref:tutorials/demo-app/mastodon.adoc[Mastodon]
** xref:tutorials/demo-app/takahe.adoc[Takahē]
** xref:tutorials/demo-app/gitea.adoc[Gitea]
** xref:tutorials/demo-app/appcat-nextcloud.adoc[Nextcloud]

* Databases
** xref:how-to/install-postgres-db-helm.adoc[PostgreSQL]
Expand Down
128 changes: 128 additions & 0 deletions docs/modules/ROOT/pages/tutorials/demo-app/appcat-nextcloud.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
= Deploy https://products.vshn.ch/appcat/nextcloud.html[VSHNNextcloud] to {product}

image:logos/nextcloud.svg[role="related thumb right",alt="Service logo nextcloud",width=120,height=120] This tutorial explains how to run https://nextcloud.com/[Nextcloud] with link:++https://products.vshn.ch/appcat/nextcloud.html[VSHNNextcloud]++[VSHNNextcloud] on {product} using the pipeline from https://www.vshn.ch/en/solutions/appflow/[Appflow].

== Requirements

This tutorial requires an {product}, a https://github.com[GitHub] account.

== Add the https://products.vshn.ch/appcat/index.html[VSHN Application Catalog] claim

To provision Nextcloud, we need a https://products.vshn.ch/appcat/nextcloud.html[VSHNNextcloud] claim. The documentation for VSHNNextcloud can be found here: https://docs.appcat.ch/vshn-managed/nextcloud/index.html[Nextcloud by VSHN].
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep the docs at one sentence per line. That makes reviewing (in particular when making suggestions or reviewing changes later on) much easier. Antora/Asciidoc will only insert paragraph breaks for empty lines.

Nicer formatting for the 2nd sentence might be:

Suggested change
To provision Nextcloud, we need a https://products.vshn.ch/appcat/nextcloud.html[VSHNNextcloud] claim. The documentation for VSHNNextcloud can be found here: https://docs.appcat.ch/vshn-managed/nextcloud/index.html[Nextcloud by VSHN].
To provision Nextcloud, we need a https://products.vshn.ch/appcat/nextcloud.html[VSHNNextcloud] claim.
The documentation for VSHNNextcloud can be found at https://docs.appcat.ch/vshn-managed/nextcloud/index.html[Nextcloud by VSHN].

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

We start with a very simple setup:

.VSHNNextcloud
[source,yaml]
----
apiVersion: vshn.appcat.vshn.io/v1
kind: VSHNNextcloud
metadata:
name: appcat-demo-nextcloud-appuio-simple # <1>
namespace: vshn2-demo-nextcloud-appuio-simple-prod # <2>
spec:
parameters:
service:
fqdn:
- appuio-nextcloud-demo.apps.cloudscale-lpg-2.appuio.cloud # <3>
version: "32" # <4>
size: # <5>
plan: standard-2
writeConnectionSecretToRef:
name: nextcloud-creds # <6>
----
<1> Instance name
<2> The namespace where the object will be created
<3> Your fully qualified domain name. You should be able to change the DNS record for this domain.
<4> Nextcloud version
<5> Size of the Nextcloud instance. See https://docs.appcat.ch/vshn-managed/nextcloud/plans.html[Plans and Sizing] for more information.
<6> Secret where the connection details are provisioned. No secret with this name should exist in this namespace before creation.

== Put the claim under version control

To keep track of what's deployed, we put this claim into our Git repository.
For that, you need to create a https://github.com/new[new Git repository] on GitHub.
Now, we store the claim from before under `helm/templates/nextcloud.yaml`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does https://docs.appcat.ch/references/argocd.html also apply if the claim is wrapped in a helm chart? Never tested that.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We let helm try to delete the resources in the deployments we did until now.
The helm uninstall fails in this case because of the deletion protection.
If you want to uninstall a helm chart with appcat claims you must disable the deletion protection before.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But then the app remains in an unsynced state? Because it tries to delete the claim but can't? It also sounds a bit dangerous having it hang in limbo the whole time.

You can see the result in the https://github.com/vshn/appcat-demo-nextcloud-appuio-simple/tree/main/helm/templates[example repository].
We also need some boilerplate for Helm; you can also find this in the https://github.com/vshn/appcat-demo-nextcloud-appuio-simple/tree/main/helm[example repository].

== Deploy the claim

If you are a VSHN customer, you can generate the pipeline to deploy Nextcloud in
xref:#appflow-helm[AppFlow].
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please keep the sources at one sentence per line.

Suggested change
If you are a VSHN customer, you can generate the pipeline to deploy Nextcloud in
xref:#appflow-helm[AppFlow].
If you are a VSHN customer, you can generate the pipeline to deploy Nextcloud in xref:#appflow-helm[AppFlow].


Otherwise, you can copy the `.github/workflows` directory from the https://github.com/vshn/appcat-demo-nextcloud-appuio-simple/tree/main/.github[example repository] and
adapt it where needed.
For the pipeline to work, you need to add a kubeconfig to your pipeline.
First, you need to make sure you have the `oc` utility. You can download it from
the https://console.cloudscale-lpg-2.appuio.cloud/command-line-tools[OpenShift console command line tools].
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure it makes sense to link to a particular APPUiO zone here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you have an APPUiO Account you have access to both clusters, not?
What would be your suggestion?

Then you can show the command to create your kubeconfig in the https://oauth-openshift.apps.cloudscale-lpg-2.appuio.cloud/oauth/token/display?code=sha256~xhC3o8qafyrrISMXZhKRt9uhIf-687n7LCHL6jpYl5k&state=[OpenShift console].
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is probably your token :) -- should be expired by now I assume.

You want the following link here: https://oauth-openshift.apps.cloudscale-lpg-2.appuio.cloud/oauth/token/request

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uupsi, thank you.
The token is as get parameter in there and not determined via the authentication.
I rotated the token.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced with web login


.Generate kubeconfig for pipeline
[source,shell]
----
KUBECONFIG=./config-for-pipeline
oc login ...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just oc login --web --server https://api.<zone>.appuio.cloud:6443? That should pop up a login screen or immediately fetch a token via local browser integration.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just as info: Here is another way documented: https://portal.appuio.cloud/kubeconfig

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BacLuc The linked docs are about connecting to the APPUiO control API (which is also just a kubernetes API). Not to an actual APPUiO cluster.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just as info: Here is another way documented: https://portal.appuio.cloud/kubeconfig

That has nothing to do with accessing a zone, that's for accessing the APPUiO Control API directly via kubectl instead of via portal.appuio.cloud

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced with oc login --web

cat $KUBECONFIG
----

Now you need to add this kubeconfig to the GitHub *secrets*. You find them under `Settings → Environments → choose environment → (+) Add secret`. In this case, the environment name is `prod`.

We now have the pipeline and a minimal claim. But there are some steps missing
to make it production ready.

== Make it Production Ready

To make Nextcloud production ready, you need to configure the following settings:

.VSHNNextcloud: encrypted disk
[source,yaml]
----
apiVersion: vshn.appcat.vshn.io/v1
kind: VSHNNextcloud
metadata:
name: appcat-demo-nextcloud-appuio-simple
namespace: vshn2-demo-nextcloud-appuio-simple-prod
spec:
parameters:
backup:
retention:
keepDaily: 6 # <1>
instances: 1 # <2>
maintenance: # <3>
dayOfWeek: wednesday
timeOfDay: '23:42:18'
monitoring:
email: [email protected] # <4>
service:
fqdn:
- appuio-nextcloud-demo.apps.cloudscale-lpg-2.appuio.cloud
version: "32"
postgreSQLParameters:
encryption:
enabled: true
service:
majorVersion: "17" # <5>
monitoring:
email: [email protected] # <6>
instances: 1 # <7>
size:
plan: standard-2
disk: 16Gi # <8>
writeConnectionSecretToRef:
name: nextcloud-creds
----
<1> The number of daily backups to keep.
<2> Set to a value greater than 1 if you want to run Nextcloud with High Availability and update it without downtime.
<3> When the maintenance job should run.
<4> The email address where user alerts for Nextcloud should be sent.
<5> The major version for the PostgreSQL instance. Start with the most recent major version.
<6> The email address where user alerts for the PostgreSQL instance are sent.
<7> Set to a value greater than 1 if you want to run PostgreSQL with High Availability and update it without downtime.
<8> The desired disk space for your Nextcloud instance. This can only be increased later.

After you have configured all these settings, you can deploy your Nextcloud.
You will find the credentials to log in to your Nextcloud in the secret you specified previously.
You can retrieve this secret using the OpenShift console under https://console.cloudscale-lpg-2.appuio.cloud/k8s/all-namespaces/core~v1~Secret[Workloads > Secret] (Here for cloudscale).
If you used the provided link, you will need to choose the correct project in the dropdown menu.

include::partial$appflow-helm-only.adoc[AppFlow]
5 changes: 5 additions & 0 deletions docs/modules/ROOT/pages/tutorials/demo-app/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ image:logos/gitea.svg[alt="Gitea logo",width=100,height=50,link="https://gitea.i
|xref:tutorials/demo-app/gitea.adoc[Gitea]
|https://docs.appcat.ch/exoscale-dbaas/mysql/index.html[ExoscaleMySQL^]

|
image:logos/nextcloud.svg[alt="Nextcloud logo",width=100,height=50,link="https://nextcloud.com/",window=_blank]
|xref:tutorials/demo-app/appcat-nextcloud.adoc[Nextcloud]
|https://docs.appcat.ch/vshn-managed/nextcloud/index.html[Cloudscale Nextcloud^]

|===

Thanks to https://bitnami.com/[Bitnami^] for providing very robust application images, which we're making use of in most of our examples.
14 changes: 14 additions & 0 deletions docs/modules/ROOT/partials/appflow-helm-only.adoc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure whether this is a good fit for the APPUiO end user docs (since APPUiO as a product encourages self-service via K8s API). Currently, users who signed up for APPUiO via social login / self sign-up don't even have access to control.vshn.net.

IMO this would make more sense somewhere in the VSHN AppFlow user documentation.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See other comment. For users with AppFlow it is way more convenient. Customers who don't have access to AppFlow see the feature and might want to buy it. We will keep the AppFlow docs here.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[#appflow-helm]
== Create application and environment with link:++https://www.vshn.ch/en/solutions/appflow/[Appflow]++[AppFlow]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Until we found a sensible location for the AppFlow User documentation I guess it's acceptable to leave this here.


Navigate to https://control.vshn.net/appflow/apps[AppFlow] on the https://control.vshn.net/[VSHN Portal] and click on `Create App with Environment`.

.AppFlow create App
image::how-to/appflow/appflow-create-app.png[AppFlow create App]

Then you should see the created application with its environment, in this case, `prod`.

.AppFlow download pipeline and CI variables
image::how-to/appflow/appflow-download-pipeline-secrets.png[AppFlow setup CI]
<1> Download GitHub workflow
<2> Show CI variables