# HG changeset patch # User Alexander Trost <galexrt@googlemail.com> # Date 1529057001 -7200 # Fri Jun 15 12:03:21 2018 +0200 # Node ID 9587cad79c9b94f94c68c1344207fe28f60d8aed # Parent 033320679f35d7ebb42cf458ad7dfc64fd232bdd Updated blog post URLs diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -6,16 +6,16 @@ **INFO** This isn't the best way to deploy to K8s, this is more of an example how simple it can be. -The presentation can be found here: [Kubernetes - WYNTK - GitLab CI + Kubernetes Presentation](https://edenmal.moe/2017/07/31/Kubernetes-WYNTK-GitLab-CI-Kubernetes-Presentation/). -The blog post these files were specifically used in is here: [GitLab + Kubernetes: Perfect Match for Continuous Delivery with Container](https://edenmal.moe/2017/07/04/GitLab-Kubernetes-Perfect-Match-for-Continuous-Delivery-with-Container/). +The presentation can be found here: [Kubernetes - WYNTK - GitLab CI + Kubernetes Presentation](https://edenmal.moe/post/2017/Kubernetes-WYNTK-GitLab-CI-Kubernetes-Presentation/). +The blog post these files were specifically used in is here: [GitLab + Kubernetes: Perfect Match for Continuous Delivery with Container](https://edenmal.moe/post/2017/GitLab-Kubernetes-Perfect-Match-for-Continuous-Delivery-with-Container/). -An uptodate list of all my blog posts around GitLab and Kubernetes can be found on [this page](https://edenmal.moe/tags/GitLab/). +An uptodate list of all my blog posts around GitLab and Kubernetes can be found on [this page](https://edenmal.moe/tags/gitlab/). This list is just an excerpt: -* [GitLab + Kubernetes: Perfect Match for Continuous Delivery with Container](https://edenmal.moe/2017/07/04/GitLab-Kubernetes-Perfect-Match-for-Continuous-Delivery-with-Container/) -* [Kubernetes - WYNTK - GitLab CI + Kubernetes Presentation](https://edenmal.moe/2017/07/31/Kubernetes-WYNTK-GitLab-CI-Kubernetes-Presentation/) -* [GitLab + Kubernetes: Running CI Runners in Kubernetes](https://edenmal.moe/2017/08/31/GitLab-Kubernetes-Running-CI-Runners-in-Kubernetes/) -* [GitLab + Kubernetes: GitLab on top of Kubernetes](https://edenmal.moe/2017/11/04/GitLab-Kubernetes-GitLab-on-top-of-Kubernetes/) -* [GitLab: Use Keycloak as SAML 2.0 OmniAuth Provider](https://edenmal.moe/2018/01/16/GitLab-Keycloak-SAML-2-0-OmniAuth-Provider/) +* [GitLab + Kubernetes: Perfect Match for Continuous Delivery with Container](https://edenmal.moe/post/2017/GitLab-Kubernetes-Perfect-Match-for-Continuous-Delivery-with-Container/) +* [Kubernetes - WYNTK - GitLab CI + Kubernetes Presentation](https://edenmal.moe/post/2017/Kubernetes-WYNTK-GitLab-CI-Kubernetes-Presentation/) +* [GitLab + Kubernetes: Running CI Runners in Kubernetes](https://edenmal.moe/post/2017/GitLab-Kubernetes-Running-CI-Runners-in-Kubernetes/) +* [GitLab + Kubernetes: GitLab on top of Kubernetes](https://edenmal.moe/post/2017/GitLab-Kubernetes-GitLab-on-top-of-Kubernetes/) +* [GitLab: Use Keycloak as SAML 2.0 OmniAuth Provider](https://edenmal.moe/post/2018/GitLab-Keycloak-SAML-2-0-OmniAuth-Provider/) ## Requirements The following points are required for this repository to work correctly: @@ -30,13 +30,15 @@ ## Using this repository You have to replace the following addresses in all files: -* `gitlab.edenmal.net` with your GitLab address (example `gitlab.example.com`). -* `registry.edenmal.net`/`registry.zerbytes.net` with your Docker Registry address (example `registry.example.com`). -* `edenmal.net` (in the Ingress manifest) with your Domain name. +* `gitlab.zerbytes.net` with your GitLab address (e.g. `gitlab.example.com`). +* `registry.zerbytes.net` with your Docker registry address (e.g. `registry.example.com`). +* `edenmal.net` (in the Ingress manifest) with your domain name. + * You probably also want to change the subdomain name while you are at it. +* `presentatio-gitlab-k8s` with the Namespace name of your choice. You also need to create a "Docker Login" Secret which contains your GitLab Registry access data (e.g. Username and Access token with registry access) named `regsecret` in the Namespace `presentation-gitlab-k8s`. +A guide for that can be found here: [Kubernetes.io - Pull an Image from a Private Registry](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/). The Namespace manifest is in the [`gitlab-ci/`](/gitlab-ci/) directory. -The guide for that can be found here: [Kubernetes.io - Pull an Image from a Private Registry](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/). Then you can just import the repository into your GitLab instance and are ready to go. @@ -48,6 +50,30 @@ * GitLab 10.3 release - Kubernetes integration service: https://about.gitlab.com/2017/12/22/gitlab-10-3-released/#kubernetes-integration-service * GitLab Clusters Feature Docs: https://docs.gitlab.com/ce/user/project/clusters/index.html +## File Structure +### Example Application +* [`main.go`](/main.go) - The Golang example application code. +* [`vendor/`](/vendor/) - Contains the Golang example application dependencies (`dep` is used). + +### Kubernetes Base GitLab CI Manifests +* [`gitlab-ci/`](/gitlab-ci/) + * [`namespace.yaml`](/gitlab-ci/namespace.yaml) - Namespace in which the GitLab CI will deploy the application. + * [`rbac.yaml`](/gitlab-ci/rbac.yaml) - Contains GitLab CI RBAC Role, RoleBinding and ServiceAccount. + * [`secret.yaml`](/gitlab-ci/secret.yaml) - Contains a TLS wildcard certificate for the application Ingress. + +### Build Process +* [`Dockerfile`](/Dockerfile) - Contains the Docker image build instructions. +* [`.gitlab-ci.yml`](/.gitlab-ci.yml) - Contains the GitLab CI instructions. + +### Deployment Manifests +* [`manifests/`](/manifests/) - Kubernetes manifests used to deploy the Docker image built in the CI pipeline. + * [`deployment.yaml`](/manifests/deployment.yaml) - Deployment for the Docker image. + * [`ingress.yaml`](/manifests/ingress.yaml) - Ingress for the application. + * [`service.yaml`](/manifests/service.yaml) - Service for the application. + +### Miscellaneous +* [`media/`](/media/) - Contains media for the [`README.md`](/README.md) in this repository. + ## Thanks! Thanks to [@shadycuz - GitHub](https://github.com/shadycuz) for his comments with improvements for the code in this repository!