{"id":25072477,"url":"https://github.com/upcloudltd/sample-uks-web-app-demo","last_synced_at":"2026-05-02T03:32:48.223Z","repository":{"id":166008443,"uuid":"630907363","full_name":"UpCloudLtd/sample-uks-web-app-demo","owner":"UpCloudLtd","description":"Web app reference architecture for UpCloud Kubernetes Service","archived":false,"fork":false,"pushed_at":"2023-06-16T10:24:19.000Z","size":79,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-25T19:57:42.378Z","etag":null,"topics":["cloud-native","kubernetes","terraform","upcloud"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/UpCloudLtd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-04-21T12:40:11.000Z","updated_at":"2023-06-16T10:27:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"90d69730-a5fb-4d71-86a4-f25eccc35c8a","html_url":"https://github.com/UpCloudLtd/sample-uks-web-app-demo","commit_stats":{"total_commits":11,"total_committers":3,"mean_commits":"3.6666666666666665","dds":"0.18181818181818177","last_synced_commit":"51fbed5d1f761a006b5d13c9fb5ca5998f9d90f6"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UpCloudLtd%2Fsample-uks-web-app-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UpCloudLtd%2Fsample-uks-web-app-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UpCloudLtd%2Fsample-uks-web-app-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UpCloudLtd%2Fsample-uks-web-app-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UpCloudLtd","download_url":"https://codeload.github.com/UpCloudLtd/sample-uks-web-app-demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246512156,"owners_count":20789643,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud-native","kubernetes","terraform","upcloud"],"created_at":"2025-02-06T22:29:30.093Z","updated_at":"2026-05-02T03:32:48.155Z","avatar_url":"https://github.com/UpCloudLtd.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Getting started with UpCloud Kubernetes Service \u0026 Web Apps\n\nPlease note that this is just an example on how you can use Terraform with [UpCloud](https://upcloud.com/) and should not be used in production as is. Please see [LICENSE](LICENSE) for details.\n\nThis is a demo project about how to set up UpCloud Kubernetes Service cluster using\n[Terraform](https://www.terraform.io/) and then deploy WordPress as an example application. Data is\npersisted into a UpCloud Managed Database (MySQL) instance.\n\nThe created server infrastructure is portrayed in the following diagram:\n\n![Service Topology](docs/demo.png)\n\n## Setup up the tooling\n\nBefore testing this project you should have the following tools installed on your machine:\n\n- Terraform\n- kubectl\n- Helm\n\nTo create the resources with Terraform, you'll need your API credentials exported.\n\n```\nexport UPCLOUD_USERNAME=your_username\nexport UPCLOUD_PASSWORD=your_password\n```\n\nYou must also create config.tfvars file with your own settings:\n\n```\nssh_key_public = \"ssh-rsa AAAA_YOUR_SSH_PUBLIC_KEY\"\nzone           = \"de-fra1\"\nworker_count   = 2\nworker_plan    = \"2xCPU-4GB\"\nmysql_plan     = \"1x1xCPU-2GB-25GB\"\nuks_network    = \"172.16.255.0/24\n```\n\n## Deploy cloud resources\n\nInitiate the project and install required Terraform providers.\n\n```\nmake init\n```\n\nThe demo can now be created with Terraform. We will deploy a UKS cluster with the given configuration and\na MySQL database. Creation takes around 10-15 minutes.\n\nFirst, create a plan and see all the resources Terraform is about to create:\n\n```\nmake plan\n```\n\nThen apply the changes:\n\n```\nmake apply\n```\n\nAfter Terraform has completed the operation, you need to export kubeconfig as an environment\nvariable:\n\n```\nexport KUBECONFIG=$(pwd)/terraform/kubeconfig.yml\n```\n\nYou can monitor active worker node status with `kubectl` as follows:\n\n```\nkubectl get nodes --watch=true\n```\n\nWhen all worker nodes are up we will continue by deploying Wordpress into the cluster.\n\n### Deploy WordPress to UKS\n\nAs an example, we'll deploy a [WordPress](https://github.com/WordPress/WordPress) instance.\nWe will use UpCloud's Managed Database for persisting the data. You will first need to create a Kubernetes\nsecret for storing the required MySQL credentials. These will be used by WordPress. Run the following\ncommand:\n\n```\nkubectl create secret generic mysql \\\n--from-file=user=terraform/credentials/mysql-user.txt \\\n--from-file=password=terraform/credentials/mysql-password.txt \\\n--from-file=database=terraform/credentials/mysql-db-name.txt \\\n--from-file=hostname=terraform/credentials/mysql-hostname.txt\n```\n\nThen create a persistent volume with the UpCloud CSI driver:\n\n```\nkubectl create -f manifests/wordpress/upcloud-csi-volume.yaml\n```\n\nNext, deploy Wordpress and use the volume we just created:\n\n```\nkubectl create -f manifests/wordpress/wordpress-deployment.yaml\n```\n\nThe system then prepares you a load balancer, through which Wordpress is exposed.\nYou can run the following command and wait until the `EXTERNAL-IP` field has been updated.\n\n```\n$ kubectl get services --watch=true\nNAME         TYPE           CLUSTER-IP     EXTERNAL-IP   PORT(S)        AGE\nkubernetes   ClusterIP      10.128.0.1     \u003cnone\u003e        443/TCP        23m\nwordpress    LoadBalancer   10.134.19.53   \u003cpending\u003e     80:30591/TCP   12s\n```\n\nAfter a few minutes your load balancer should be up:\n\n```\n$ kubectl get services --watch=true\nNAME         TYPE           CLUSTER-IP      EXTERNAL-IP                                           PORT(S)          AGE\nwordpress    LoadBalancer   10.128.90.14    lb-0a372fcc11e14cb9b9cced602c85c36a-1.upcloudlb.com   80:31033/TCP \n```\n\nFinally, verify that you can access the service through the hostname in `EXTERNAL-IP` with a browser.\nFor quick validation you can also use `curl`:\n\n```\n$ curl -i https://lb-0a372fcc11e14cb9b9cced602c85c36a-1.upcloudlb.com\n```\n\nYou can then finish the WordPress installation process - and you are done!\n\n## Destroy resources\n\n***NOTE: This will destroy all resources and data involved in this test***\n\nAfter testing things it's good to free the resources. Once you are absolutely sure you are ready to cleanup you \ncan run the following commands to do so:\n\n\n```\nkubectl delete -f manifests/wordpress\nmake destroy\n```\n\n## Additional information\n\nFor additional tests, please see the following:\n\n- [Setting up monitoring to your UKS cluster](docs/monitoring.md)\n- [Wordpress with shared NFS volumes](docs/wordpress-with-nfs.md)\n\nIf you want to dig deeper into various other tutorials, please see the\n[uks-instructions](https://github.com/UpCloudLtd/uks-instructions) repository. It has examples of:\n\n- customising the load balancer\n- storage operations for backing up data through snapshots and cloning\n- more Terraform examples\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fupcloudltd%2Fsample-uks-web-app-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fupcloudltd%2Fsample-uks-web-app-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fupcloudltd%2Fsample-uks-web-app-demo/lists"}