├── .github ├── ISSUE_TEMPLATE │ ├── BUG.yml │ └── FEATURE.yml ├── pull_request_template.md └── workflows │ ├── spellcheck.yml │ └── yamllint.yml ├── .gitignore ├── .spellcheck.yaml ├── .wordlist.txt ├── .yamllint ├── LICENSE ├── README.md ├── blog └── 2023-02-28-managing-helm-with-kluctl │ ├── apps │ ├── deployment.yaml │ └── podinfo │ │ ├── helm-chart.yaml │ │ ├── helm-values.yaml │ │ ├── ingress.yaml │ │ ├── kustomization.yaml │ │ └── namespace.yaml │ ├── base │ ├── cert-manager │ │ ├── helm-chart.yaml │ │ └── helm-values.yaml │ ├── cilium │ │ ├── helm-chart.yaml │ │ └── helm-values.yaml │ ├── deployment.yaml │ ├── ingress-nginx │ │ ├── helm-chart.yml │ │ └── helm-values.yaml │ └── namespaces │ │ └── ingress-nginx.yaml │ ├── deployment.yaml │ └── kind-config.yaml ├── gitops-deployment ├── .kluctl.yaml ├── README.md ├── clusters │ ├── all │ │ └── gitops.yaml │ ├── deployment.yaml │ ├── prod.example.com │ │ ├── app1.yaml │ │ └── app2.yaml │ └── test.example.com │ │ ├── app1.yaml │ │ └── app2.yaml ├── deployment.yaml └── namespaces │ └── kluctl-gitops.yaml ├── microservices-demo ├── 1-basic-project │ ├── .kluctl.yml │ ├── adservice │ │ ├── deployment.yml │ │ ├── kustomization.yml │ │ └── service.yml │ ├── cartservice │ │ ├── deployment.yml │ │ ├── kustomization.yml │ │ └── service.yml │ ├── checkoutservice │ │ ├── deployment.yml │ │ ├── kustomization.yml │ │ └── service.yml │ ├── currencyservice │ │ ├── deployment.yml │ │ ├── kustomization.yml │ │ └── service.yml │ ├── deployment.yml │ ├── emailservice │ │ ├── deployment.yml │ │ ├── kustomization.yml │ │ └── service.yml │ ├── frontend │ │ ├── deployment.yml │ │ ├── kustomization.yml │ │ └── service.yml │ ├── loadgenerator │ │ ├── deployment.yml │ │ └── kustomization.yml │ ├── paymentservice │ │ ├── deployment.yml │ │ ├── kustomization.yml │ │ └── service.yml │ ├── productcatalogservice │ │ ├── deployment.yml │ │ ├── kustomization.yml │ │ └── service.yml │ ├── recommendationservice │ │ ├── deployment.yml │ │ ├── kustomization.yml │ │ └── service.yml │ ├── redis │ │ ├── deployment.yml │ │ ├── kustomization.yml │ │ └── service.yml │ └── shippingservice │ │ ├── deployment.yml │ │ ├── kustomization.yml │ │ └── service.yml ├── 2-helm-integration │ ├── .helm-charts │ │ └── https_charts.bitnami.com │ │ │ └── bitnami │ │ │ └── redis │ │ │ └── 17.4.0 │ │ │ ├── .helmignore │ │ │ ├── Chart.lock │ │ │ ├── Chart.yaml │ │ │ ├── README.md │ │ │ ├── charts │ │ │ └── common │ │ │ │ ├── .helmignore │ │ │ │ ├── Chart.yaml │ │ │ │ ├── README.md │ │ │ │ ├── templates │ │ │ │ ├── _affinities.tpl │ │ │ │ ├── _capabilities.tpl │ │ │ │ ├── _errors.tpl │ │ │ │ ├── _images.tpl │ │ │ │ ├── _ingress.tpl │ │ │ │ ├── _labels.tpl │ │ │ │ ├── _names.tpl │ │ │ │ ├── _secrets.tpl │ │ │ │ ├── _storage.tpl │ │ │ │ ├── _tplvalues.tpl │ │ │ │ ├── _utils.tpl │ │ │ │ ├── _warnings.tpl │ │ │ │ └── validations │ │ │ │ │ ├── _cassandra.tpl │ │ │ │ │ ├── _mariadb.tpl │ │ │ │ │ ├── _mongodb.tpl │ │ │ │ │ ├── _mysql.tpl │ │ │ │ │ ├── _postgresql.tpl │ │ │ │ │ ├── _redis.tpl │ │ │ │ │ └── _validations.tpl │ │ │ │ └── values.yaml │ │ │ ├── img │ │ │ ├── redis-cluster-topology.png │ │ │ └── redis-topology.png │ │ │ ├── templates │ │ │ ├── NOTES.txt │ │ │ ├── _helpers.tpl │ │ │ ├── configmap.yaml │ │ │ ├── extra-list.yaml │ │ │ ├── headless-svc.yaml │ │ │ ├── health-configmap.yaml │ │ │ ├── master │ │ │ │ ├── application.yaml │ │ │ │ ├── psp.yaml │ │ │ │ ├── pvc.yaml │ │ │ │ ├── service.yaml │ │ │ │ └── serviceaccount.yaml │ │ │ ├── metrics-svc.yaml │ │ │ ├── networkpolicy.yaml │ │ │ ├── pdb.yaml │ │ │ ├── prometheusrule.yaml │ │ │ ├── replicas │ │ │ │ ├── hpa.yaml │ │ │ │ ├── service.yaml │ │ │ │ ├── serviceaccount.yaml │ │ │ │ └── statefulset.yaml │ │ │ ├── role.yaml │ │ │ ├── rolebinding.yaml │ │ │ ├── scripts-configmap.yaml │ │ │ ├── secret.yaml │ │ │ ├── sentinel │ │ │ │ ├── hpa.yaml │ │ │ │ ├── node-services.yaml │ │ │ │ ├── ports-configmap.yaml │ │ │ │ ├── service.yaml │ │ │ │ └── statefulset.yaml │ │ │ ├── serviceaccount.yaml │ │ │ ├── servicemonitor.yaml │ │ │ └── tls-secret.yaml │ │ │ ├── values.schema.json │ │ │ └── values.yaml │ ├── .kluctl.yml │ ├── deployment.yml │ ├── services │ │ ├── adservice │ │ │ ├── deployment.yml │ │ │ ├── kustomization.yml │ │ │ └── service.yml │ │ ├── cartservice │ │ │ ├── deployment.yml │ │ │ ├── kustomization.yml │ │ │ └── service.yml │ │ ├── checkoutservice │ │ │ ├── deployment.yml │ │ │ ├── kustomization.yml │ │ │ └── service.yml │ │ ├── currencyservice │ │ │ ├── deployment.yml │ │ │ ├── kustomization.yml │ │ │ └── service.yml │ │ ├── deployment.yml │ │ ├── emailservice │ │ │ ├── deployment.yml │ │ │ ├── kustomization.yml │ │ │ └── service.yml │ │ ├── frontend │ │ │ ├── deployment.yml │ │ │ ├── kustomization.yml │ │ │ └── service.yml │ │ ├── loadgenerator │ │ │ ├── deployment.yml │ │ │ └── kustomization.yml │ │ ├── paymentservice │ │ │ ├── deployment.yml │ │ │ ├── kustomization.yml │ │ │ └── service.yml │ │ ├── productcatalogservice │ │ │ ├── deployment.yml │ │ │ ├── kustomization.yml │ │ │ └── service.yml │ │ ├── recommendationservice │ │ │ ├── deployment.yml │ │ │ ├── kustomization.yml │ │ │ └── service.yml │ │ └── shippingservice │ │ │ ├── deployment.yml │ │ │ ├── kustomization.yml │ │ │ └── service.yml │ └── third-party │ │ ├── deployment.yml │ │ └── redis │ │ ├── helm-chart.yml │ │ ├── helm-values.yml │ │ └── kustomization.yml ├── 3-templating-and-multi-env │ ├── .helm-charts │ │ └── https_charts.bitnami.com │ │ │ └── bitnami │ │ │ └── redis │ │ │ └── 17.4.0 │ │ │ ├── .helmignore │ │ │ ├── Chart.lock │ │ │ ├── Chart.yaml │ │ │ ├── README.md │ │ │ ├── charts │ │ │ └── common │ │ │ │ ├── .helmignore │ │ │ │ ├── Chart.yaml │ │ │ │ ├── README.md │ │ │ │ ├── templates │ │ │ │ ├── _affinities.tpl │ │ │ │ ├── _capabilities.tpl │ │ │ │ ├── _errors.tpl │ │ │ │ ├── _images.tpl │ │ │ │ ├── _ingress.tpl │ │ │ │ ├── _labels.tpl │ │ │ │ ├── _names.tpl │ │ │ │ ├── _secrets.tpl │ │ │ │ ├── _storage.tpl │ │ │ │ ├── _tplvalues.tpl │ │ │ │ ├── _utils.tpl │ │ │ │ ├── _warnings.tpl │ │ │ │ └── validations │ │ │ │ │ ├── _cassandra.tpl │ │ │ │ │ ├── _mariadb.tpl │ │ │ │ │ ├── _mongodb.tpl │ │ │ │ │ ├── _mysql.tpl │ │ │ │ │ ├── _postgresql.tpl │ │ │ │ │ ├── _redis.tpl │ │ │ │ │ └── _validations.tpl │ │ │ │ └── values.yaml │ │ │ ├── img │ │ │ ├── redis-cluster-topology.png │ │ │ └── redis-topology.png │ │ │ ├── templates │ │ │ ├── NOTES.txt │ │ │ ├── _helpers.tpl │ │ │ ├── configmap.yaml │ │ │ ├── extra-list.yaml │ │ │ ├── headless-svc.yaml │ │ │ ├── health-configmap.yaml │ │ │ ├── master │ │ │ │ ├── application.yaml │ │ │ │ ├── psp.yaml │ │ │ │ ├── pvc.yaml │ │ │ │ ├── service.yaml │ │ │ │ └── serviceaccount.yaml │ │ │ ├── metrics-svc.yaml │ │ │ ├── networkpolicy.yaml │ │ │ ├── pdb.yaml │ │ │ ├── prometheusrule.yaml │ │ │ ├── replicas │ │ │ │ ├── hpa.yaml │ │ │ │ ├── service.yaml │ │ │ │ ├── serviceaccount.yaml │ │ │ │ └── statefulset.yaml │ │ │ ├── role.yaml │ │ │ ├── rolebinding.yaml │ │ │ ├── scripts-configmap.yaml │ │ │ ├── secret.yaml │ │ │ ├── sentinel │ │ │ │ ├── hpa.yaml │ │ │ │ ├── node-services.yaml │ │ │ │ ├── ports-configmap.yaml │ │ │ │ ├── service.yaml │ │ │ │ └── statefulset.yaml │ │ │ ├── serviceaccount.yaml │ │ │ ├── servicemonitor.yaml │ │ │ └── tls-secret.yaml │ │ │ ├── values.schema.json │ │ │ └── values.yaml │ ├── .kluctl.yml │ ├── deployment.yml │ ├── namespaces │ │ ├── kustomization.yml │ │ └── namespace.yml │ ├── services │ │ ├── adservice │ │ │ ├── deployment.yml │ │ │ ├── kustomization.yml │ │ │ └── service.yml │ │ ├── cartservice │ │ │ ├── deployment.yml │ │ │ ├── kustomization.yml │ │ │ └── service.yml │ │ ├── checkoutservice │ │ │ ├── deployment.yml │ │ │ ├── kustomization.yml │ │ │ └── service.yml │ │ ├── currencyservice │ │ │ ├── deployment.yml │ │ │ ├── kustomization.yml │ │ │ └── service.yml │ │ ├── deployment.yml │ │ ├── emailservice │ │ │ ├── deployment.yml │ │ │ ├── kustomization.yml │ │ │ └── service.yml │ │ ├── frontend │ │ │ ├── deployment.yml │ │ │ ├── kustomization.yml │ │ │ └── service.yml │ │ ├── loadgenerator │ │ │ ├── deployment.yml │ │ │ └── kustomization.yml │ │ ├── paymentservice │ │ │ ├── deployment.yml │ │ │ ├── kustomization.yml │ │ │ └── service.yml │ │ ├── productcatalogservice │ │ │ ├── deployment.yml │ │ │ ├── kustomization.yml │ │ │ └── service.yml │ │ ├── recommendationservice │ │ │ ├── deployment.yml │ │ │ ├── kustomization.yml │ │ │ └── service.yml │ │ └── shippingservice │ │ │ ├── deployment.yml │ │ │ ├── kustomization.yml │ │ │ └── service.yml │ ├── third-party │ │ ├── deployment.yml │ │ └── redis │ │ │ ├── helm-chart.yml │ │ │ ├── helm-values.yml │ │ │ └── kustomization.yml │ └── vars │ │ ├── local.yml │ │ └── real.yml └── README.md ├── preview-envs ├── README.md ├── preview-env1.yaml └── preview-env2.yaml ├── readme-assets └── gitops-diagram.png ├── simple-helm ├── .helm-charts │ └── https_charts.bitnami.com │ │ └── bitnami │ │ └── nginx │ │ └── 17.3.2 │ │ ├── .helmignore │ │ ├── Chart.lock │ │ ├── Chart.yaml │ │ ├── README.md │ │ ├── charts │ │ └── common │ │ │ ├── .helmignore │ │ │ ├── Chart.yaml │ │ │ ├── README.md │ │ │ ├── templates │ │ │ ├── _affinities.tpl │ │ │ ├── _capabilities.tpl │ │ │ ├── _compatibility.tpl │ │ │ ├── _errors.tpl │ │ │ ├── _images.tpl │ │ │ ├── _ingress.tpl │ │ │ ├── _labels.tpl │ │ │ ├── _names.tpl │ │ │ ├── _resources.tpl │ │ │ ├── _secrets.tpl │ │ │ ├── _storage.tpl │ │ │ ├── _tplvalues.tpl │ │ │ ├── _utils.tpl │ │ │ ├── _warnings.tpl │ │ │ └── validations │ │ │ │ ├── _cassandra.tpl │ │ │ │ ├── _mariadb.tpl │ │ │ │ ├── _mongodb.tpl │ │ │ │ ├── _mysql.tpl │ │ │ │ ├── _postgresql.tpl │ │ │ │ ├── _redis.tpl │ │ │ │ └── _validations.tpl │ │ │ └── values.yaml │ │ ├── templates │ │ ├── NOTES.txt │ │ ├── _helpers.tpl │ │ ├── deployment.yaml │ │ ├── extra-list.yaml │ │ ├── health-ingress.yaml │ │ ├── hpa.yaml │ │ ├── ingress-tls-secret.yaml │ │ ├── ingress.yaml │ │ ├── networkpolicy.yaml │ │ ├── pdb.yaml │ │ ├── prometheusrules.yaml │ │ ├── server-block-configmap.yaml │ │ ├── serviceaccount.yaml │ │ ├── servicemonitor.yaml │ │ ├── svc.yaml │ │ └── tls-secret.yaml │ │ ├── values.schema.json │ │ └── values.yaml ├── .kluctl.yml ├── deployment.yml └── deployment │ ├── deployment.yml │ └── nginx │ ├── helm-chart.yml │ ├── helm-values.yml │ ├── kustomization.yml │ └── namespace.yml └── simple ├── .kluctl.yml ├── deployment.yml └── deployment ├── deployment.yml └── nginx ├── deploy.yml ├── kustomization.yml ├── namespace.yml └── service.yml /.github/ISSUE_TEMPLATE/BUG.yml: -------------------------------------------------------------------------------- 1 | name: Bug 2 | description: File a bug report 3 | body: 4 | - type: markdown 5 | attributes: 6 | value: | 7 | Before opening a bug report, please take a look if your finding is already reported in the issues. 8 | 9 | --- 10 | 11 | Thank you for taking the time to file a bug report. To address this bug as fast as possible, we need some information. 12 | - type: input 13 | id: os 14 | attributes: 15 | label: Operating system 16 | description: "Which operating system do you use? Please provide the version as well." 17 | placeholder: "Ubuntu 20.04, macOS Big Sur 11.5.2" 18 | validations: 19 | required: true 20 | - type: input 21 | id: kluctl 22 | attributes: 23 | label: Kluctl Version 24 | description: "Please provide the full kluctl version. (Output of `kluctl version`)" 25 | placeholder: "2.4.2" 26 | validations: 27 | required: true 28 | - type: input 29 | id: kubernetes 30 | attributes: 31 | label: Kubernetes Version 32 | description: "Please provide the full kubernetes version. (Output of `kubectl version`-> Server Version)" 33 | placeholder: "v1.22.0" 34 | validations: 35 | required: true 36 | - type: input 37 | id: kubectl 38 | attributes: 39 | label: kubectl Version 40 | description: "Please provide the full kubectl version. (Output of `kubectl version` -> Client Version)" 41 | placeholder: "v1.22.0" 42 | validations: 43 | required: true 44 | - type: input 45 | id: helm 46 | attributes: 47 | label: Helm Version 48 | description: "Please provide the full Helm version. (Output of `helm version`)" 49 | placeholder: "v3.6.3" 50 | validations: 51 | required: true 52 | - type: textarea 53 | id: bug-description 54 | attributes: 55 | label: Bug description 56 | description: What happened? 57 | validations: 58 | required: true 59 | - type: textarea 60 | id: steps 61 | attributes: 62 | label: Steps to reproduce 63 | description: Which steps do we need to take to reproduce this error? 64 | - type: textarea 65 | id: logs 66 | attributes: 67 | label: Relevant log output 68 | description: If applicable, provide relevant log output. No need for backticks here (`kluctl -v debug`). 69 | render: shell 70 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/FEATURE.yml: -------------------------------------------------------------------------------- 1 | name: Feature 2 | description: Create a feature request 3 | body: 4 | - type: markdown 5 | attributes: 6 | value: | 7 | Before opening a feature request, please take a look if your feature is already requested in the issues. 8 | 9 | --- 10 | 11 | Thank you for taking the time to create a feature request. We try to divide the work that needs to be done with the help of [user stories](https://www.agilealliance.org/glossary/user-stories/). 12 | In order to help us with this, we kindly ask you to answer the questions below. 13 | - type: input 14 | id: persona 15 | attributes: 16 | label: Who are you? 17 | description: In order to help us understand for whom we are implementing the feature, please tell us a little bit about you. For example, "Max, 25, Platform Engineer at Company" 18 | validations: 19 | required: false 20 | - type: textarea 21 | id: what 22 | attributes: 23 | label: What do you want to do? 24 | description: Now tell us what your intent is. What would you like to do? 25 | validations: 26 | required: true 27 | - type: textarea 28 | id: why 29 | attributes: 30 | label: Why do you need that? 31 | description: Now tell us why do you need that feature? What is the overall benefit of the feature? 32 | validations: 33 | required: true 34 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | # Description 2 | 3 | Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change. 4 | 5 | Fixes # (issue) 6 | Related # (pr in [kluctl.io repository](https://github.com/kluctl/www-kluctl.io)) 7 | 8 | ## Type of change 9 | 10 | Please delete options that are not relevant. 11 | 12 | - [ ] Bug fix (non-breaking change which fixes an issue) 13 | - [ ] New example (change which adds a new example) 14 | 15 | All Submissions: 16 | 17 | * [ ] A corresponding issue exists 18 | * [ ] Have you added a related PR to the [kluctl.io repository](https://github.com/kluctl/www-kluctl.io) 19 | * [ ] Have you added an explanation of what your changes do and why you'd like us to include them? 20 | * [ ] Have you followed the guidelines in our Contributing document? 21 | * [ ] Have you checked to ensure there aren't other open Pull Requests for the same update/change? 22 | * [ ] I have performed a self-review of my code 23 | * [ ] I have commented my code, particularly in hard-to-understand areas 24 | * [ ] Have you lint your code locally before submission? 25 | * [ ] I have added tests that prove my fix is effective or that my feature works 26 | * [ ] New and existing unit tests pass locally with my changes 27 | * [ ] Any dependent changes have been merged and published in downstream modules 28 | * [ ] All commits are signed off which certify that you created the patch and that you agree to the [Developer Certificate of Origin](https://developercertificate.org/) 29 | -------------------------------------------------------------------------------- /.github/workflows/spellcheck.yml: -------------------------------------------------------------------------------- 1 | name: Spellcheck 2 | on: 3 | push: 4 | branches: [main] 5 | pull_request: 6 | branches: [main] 7 | workflow_dispatch: 8 | jobs: 9 | check: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v2 13 | - uses: igsekor/pyspelling-any@v1.0.4 14 | name: Spellcheck 15 | -------------------------------------------------------------------------------- /.github/workflows/yamllint.yml: -------------------------------------------------------------------------------- 1 | name: YAMLLint 2 | on: 3 | - pull_request 4 | jobs: 5 | lint: 6 | runs-on: ubuntu-latest 7 | steps: 8 | - name: 'Checkout' 9 | uses: actions/checkout@master 10 | - name: 'Lint' 11 | uses: karancode/yamllint-github-action@master 12 | with: 13 | yamllint_file_or_dir: '.' 14 | yamllint_strict: false 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea -------------------------------------------------------------------------------- /.spellcheck.yaml: -------------------------------------------------------------------------------- 1 | matrix: 2 | - name: README 3 | sources: 4 | - README.md 5 | aspell: 6 | lang: en 7 | dictionary: 8 | wordlists: 9 | - .wordlist.txt 10 | output: build/dictionary/readme.dic 11 | pipeline: 12 | - pyspelling.filters.url: 13 | - pyspelling.filters.html: 14 | comments: true 15 | ignores: 16 | - code 17 | - pre 18 | -------------------------------------------------------------------------------- /.wordlist.txt: -------------------------------------------------------------------------------- 1 | Kubernetes 2 | arg 3 | github 4 | https 5 | io 6 | kluctl 7 | microservices 8 | namespace 9 | nginx 10 | png 11 | repos 12 | yml -------------------------------------------------------------------------------- /.yamllint: -------------------------------------------------------------------------------- 1 | --- 2 | yaml-files: 3 | - '*.yaml' 4 | - '*.yml' 5 | - '.yamllint' 6 | ignore: | 7 | **/charts/** 8 | rules: 9 | braces: 10 | max-spaces-inside: 1 11 | brackets: enable 12 | colons: enable 13 | commas: enable 14 | comments: 15 | level: warning 16 | comments-indentation: 17 | level: warning 18 | document-end: disable 19 | document-start: disable 20 | empty-lines: enable 21 | empty-values: disable 22 | hyphens: enable 23 | indentation: enable 24 | key-duplicates: enable 25 | key-ordering: disable 26 | line-length: disable 27 | new-line-at-end-of-file: enable 28 | new-lines: enable 29 | octal-values: disable 30 | quoted-strings: disable 31 | trailing-spaces: enable 32 | truthy: 33 | level: warning 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # kluctl-examples 2 | 3 | kluctl 4 | 5 | kluctl is the missing glue that puts together your (and any third-party) deployments into one large declarative 6 | Kubernetes deployment, while making it fully manageable (deploy, diff, prune, delete, ...) via one unified command 7 | line interface. 8 | 9 | This repository contains example configurations that show how you can use kluctl to simplify deployments and make your 10 | platform teams happy. For a complete description of the examples and a getting started guide take a look at 11 | [kluctl.io](https://kluctl.io). 12 | 13 | # List of examples 14 | 1. [simple](simple): This example is a very simple one that shows how to define a target cluster, context, create a 15 | namespace and deploy a nginx. You can configure the name of the namespace by changing the arg `environment` in 16 | [.kluctl.yml](simple/.kluctl.yml). 17 | 2. [simple-helm](simple-helm/.kluctl.yml): This example is very similar to `simple` but it deploys a Helm-based nginx to 18 | give a first impression how kluctl and Helm work together. 19 | 3. [microservices-demo](microservices-demo): This example is a more complex one and contains the files for the 20 | [microservices tutorial](https://kluctl.io/docs/guides/tutorials/microservices-demo/) inspired by the 21 | [Google Online Boutique Demo](https://github.com/GoogleCloudPlatform/microservices-demo). 22 | 4. [preview-envs](preview-envs): Not a Kluctl deployment, but a set of configuration files used by the 23 | [GitProjector](https://github.com/kluctl/template-controller/blob/main/docs/spec/v1alpha1/gitprojector.md) examples. -------------------------------------------------------------------------------- /blog/2023-02-28-managing-helm-with-kluctl/apps/deployment.yaml: -------------------------------------------------------------------------------- 1 | deployments: 2 | - path: podinfo -------------------------------------------------------------------------------- /blog/2023-02-28-managing-helm-with-kluctl/apps/podinfo/helm-chart.yaml: -------------------------------------------------------------------------------- 1 | helmChart: 2 | repo: oci://ghcr.io/stefanprodan/charts/podinfo 3 | chartVersion: 6.3.4 4 | releaseName: podinfo 5 | namespace: "podinfo" 6 | skipPrePull: true 7 | -------------------------------------------------------------------------------- /blog/2023-02-28-managing-helm-with-kluctl/apps/podinfo/helm-values.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kluctl/kluctl-examples/8dcccb8453e89e895916f98af5b0ca89ca458cc6/blog/2023-02-28-managing-helm-with-kluctl/apps/podinfo/helm-values.yaml -------------------------------------------------------------------------------- /blog/2023-02-28-managing-helm-with-kluctl/apps/podinfo/ingress.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.k8s.io/v1 2 | kind: Ingress 3 | metadata: 4 | name: podinfo 5 | namespace: podinfo 6 | spec: 7 | ingressClassName: nginx 8 | rules: 9 | - host: podinfo.127.0.0.1.nip.io 10 | http: 11 | paths: 12 | - path: / 13 | pathType: Prefix 14 | backend: 15 | service: 16 | name: podinfo 17 | port: 18 | number: 9898 19 | -------------------------------------------------------------------------------- /blog/2023-02-28-managing-helm-with-kluctl/apps/podinfo/kustomization.yaml: -------------------------------------------------------------------------------- 1 | resources: 2 | - namespace.yaml 3 | - helm-rendered.yaml 4 | - ingress.yaml -------------------------------------------------------------------------------- /blog/2023-02-28-managing-helm-with-kluctl/apps/podinfo/namespace.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: podinfo 5 | -------------------------------------------------------------------------------- /blog/2023-02-28-managing-helm-with-kluctl/base/cert-manager/helm-chart.yaml: -------------------------------------------------------------------------------- 1 | helmChart: 2 | repo: https://charts.jetstack.io 3 | chartName: cert-manager 4 | chartVersion: v1.11.0 5 | releaseName: cert-manager 6 | namespace: "kube-system" 7 | skipPrePull: true 8 | -------------------------------------------------------------------------------- /blog/2023-02-28-managing-helm-with-kluctl/base/cert-manager/helm-values.yaml: -------------------------------------------------------------------------------- 1 | installCRDs: true -------------------------------------------------------------------------------- /blog/2023-02-28-managing-helm-with-kluctl/base/cilium/helm-chart.yaml: -------------------------------------------------------------------------------- 1 | helmChart: 2 | repo: https://helm.cilium.io/ 3 | chartName: cilium 4 | chartVersion: 1.13.0 5 | skipPrePull: true 6 | releaseName: cilium 7 | namespace: "kube-system" 8 | -------------------------------------------------------------------------------- /blog/2023-02-28-managing-helm-with-kluctl/base/cilium/helm-values.yaml: -------------------------------------------------------------------------------- 1 | nodeinit: 2 | enabled: true 3 | kubeProxyReplacement: strict 4 | hostServices: 5 | enabled: false 6 | externalIPs: 7 | enabled: true 8 | nodePort: 9 | enabled: true 10 | hostPort: 11 | enabled: true 12 | bpf: 13 | masquerade: false 14 | image: 15 | pullPolicy: IfNotPresent 16 | ipam: 17 | mode: kubernetes 18 | 19 | hubble: 20 | tls: 21 | auto: 22 | method: cronJob 23 | 24 | # See https://medium.com/@charled.breteche/kind-cluster-with-cilium-and-no-kube-proxy-c6f4d84b5a9d for details 25 | k8sServiceHost: kluctl-tutorial-control-plane 26 | k8sServicePort: 6443 27 | -------------------------------------------------------------------------------- /blog/2023-02-28-managing-helm-with-kluctl/base/deployment.yaml: -------------------------------------------------------------------------------- 1 | deployments: 2 | - path: cilium 3 | - path: namespaces 4 | - barrier: true 5 | - path: cert-manager 6 | - path: ingress-nginx 7 | waitReadiness: true 8 | -------------------------------------------------------------------------------- /blog/2023-02-28-managing-helm-with-kluctl/base/ingress-nginx/helm-chart.yml: -------------------------------------------------------------------------------- 1 | helmChart: 2 | repo: https://kubernetes.github.io/ingress-nginx 3 | chartName: ingress-nginx 4 | chartVersion: 4.5.2 5 | skipPrePull: true 6 | releaseName: ingress-nginx 7 | namespace: ingress-nginx 8 | -------------------------------------------------------------------------------- /blog/2023-02-28-managing-helm-with-kluctl/base/ingress-nginx/helm-values.yaml: -------------------------------------------------------------------------------- 1 | controller: 2 | hostNetwork: true 3 | service: 4 | type: ClusterIP 5 | nodeSelector: 6 | ingress-ready: "true" 7 | tolerations: 8 | - key: "node-role.kubernetes.io/control-plane" 9 | effect: "NoSchedule" 10 | updateStrategy: 11 | rollingUpdate: 12 | maxUnavailable: 1 13 | type: RollingUpdate 14 | -------------------------------------------------------------------------------- /blog/2023-02-28-managing-helm-with-kluctl/base/namespaces/ingress-nginx.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: ingress-nginx -------------------------------------------------------------------------------- /blog/2023-02-28-managing-helm-with-kluctl/deployment.yaml: -------------------------------------------------------------------------------- 1 | deployments: 2 | - include: base 3 | - barrier: true 4 | - include: apps -------------------------------------------------------------------------------- /blog/2023-02-28-managing-helm-with-kluctl/kind-config.yaml: -------------------------------------------------------------------------------- 1 | # three node (two workers) cluster config 2 | kind: Cluster 3 | apiVersion: kind.x-k8s.io/v1alpha4 4 | nodes: 5 | - role: control-plane 6 | # this is required for ingress-nginx to work 7 | kubeadmConfigPatches: 8 | - | 9 | kind: InitConfiguration 10 | nodeRegistration: 11 | kubeletExtraArgs: 12 | node-labels: "ingress-ready=true" 13 | extraPortMappings: 14 | - containerPort: 80 15 | hostPort: 8080 16 | listenAddress: 127.0.0.1 17 | protocol: TCP 18 | - containerPort: 443 19 | hostPort: 4443 20 | listenAddress: 127.0.0.1 21 | protocol: TCP 22 | - role: worker 23 | - role: worker 24 | networking: 25 | # we use Cilium, so let's disable the default CNI 26 | disableDefaultCNI: true 27 | kubeProxyMode: none 28 | -------------------------------------------------------------------------------- /gitops-deployment/.kluctl.yaml: -------------------------------------------------------------------------------- 1 | # .kluctl.yaml 2 | args: 3 | # This allows us to deploy the GitOps deployment to different clusters. It is used to include dedicated deployment 4 | # items for the selected cluster. 5 | - name: cluster_name 6 | 7 | targets: 8 | - name: gitops 9 | 10 | # Without a discriminator, pruning won't work. Make sure the rendered result is unique on the target cluster 11 | discriminator: gitops-{{ args.cluster_name | slugify }} 12 | -------------------------------------------------------------------------------- /gitops-deployment/README.md: -------------------------------------------------------------------------------- 1 | # Kluctl GitOps Deployment 2 | 3 | The following diagram shows how the `KluctlDeployment` resources defined here manage the corresponding resources: 4 | 5 | ![](../readme-assets/gitops-diagram.png) 6 | -------------------------------------------------------------------------------- /gitops-deployment/clusters/all/gitops.yaml: -------------------------------------------------------------------------------- 1 | # clusters/all/gitops.yaml 2 | apiVersion: gitops.kluctl.io/v1beta1 3 | kind: KluctlDeployment 4 | metadata: 5 | name: gitops 6 | namespace: kluctl-gitops 7 | spec: 8 | interval: 5m 9 | source: 10 | git: 11 | url: https://github.com/kluctl/kluctl-examples.git 12 | path: gitops-deployment # You could also use a dedicated repository without a sub-directory 13 | target: gitops 14 | args: 15 | # this passes the cluster_name initially passed via `kluctl deploy -a cluster_name=xxx.example.com` into the KluctlDeployment 16 | cluster_name: {{ args.cluster_name }} 17 | context: default 18 | # let it automatically clean up orphan KluctlDeployment resources 19 | prune: true 20 | delete: true 21 | -------------------------------------------------------------------------------- /gitops-deployment/clusters/deployment.yaml: -------------------------------------------------------------------------------- 1 | # clusters/deployment.yaml 2 | deployments: 3 | # Include things that are required on all clusters (e.g., the KluctlDeployment for the GitOps deployment itself) 4 | - path: all 5 | # We use simple templating to change a dedicated deployment item per cluster 6 | - path: {{ args.cluster_name }} 7 | -------------------------------------------------------------------------------- /gitops-deployment/clusters/prod.example.com/app1.yaml: -------------------------------------------------------------------------------- 1 | # clusters/test.example.com/app1.yaml 2 | apiVersion: gitops.kluctl.io/v1beta1 3 | kind: KluctlDeployment 4 | metadata: 5 | name: app1 6 | namespace: kluctl-gitops 7 | spec: 8 | interval: 5m 9 | source: 10 | git: 11 | url: https://github.com/kluctl/kluctl-examples.git 12 | path: simple 13 | target: simple 14 | args: 15 | environment: prod 16 | context: default 17 | # Let it automatically clean up orphan resources and delete all resources when the KluctlDeployment itself gets 18 | # deleted. You might consider setting these to false for prod and instead do manual pruning and deletion when the 19 | # need arises. 20 | prune: true 21 | delete: true 22 | -------------------------------------------------------------------------------- /gitops-deployment/clusters/prod.example.com/app2.yaml: -------------------------------------------------------------------------------- 1 | # clusters/test.example.com/app2.yaml 2 | apiVersion: gitops.kluctl.io/v1beta1 3 | kind: KluctlDeployment 4 | metadata: 5 | name: app2 6 | namespace: kluctl-gitops 7 | spec: 8 | interval: 5m 9 | source: 10 | git: 11 | url: https://github.com/kluctl/kluctl-examples.git 12 | path: simple-helm 13 | target: simple-helm 14 | args: 15 | environment: prod 16 | context: default 17 | # Let it automatically clean up orphan resources and delete all resources when the KluctlDeployment itself gets 18 | # deleted. You might consider setting these to false for prod and instead do manual pruning and deletion when the 19 | # need arises. 20 | prune: true 21 | delete: true 22 | -------------------------------------------------------------------------------- /gitops-deployment/clusters/test.example.com/app1.yaml: -------------------------------------------------------------------------------- 1 | # clusters/test.example.com/app1.yaml 2 | apiVersion: gitops.kluctl.io/v1beta1 3 | kind: KluctlDeployment 4 | metadata: 5 | name: app1 6 | namespace: kluctl-gitops 7 | spec: 8 | interval: 5m 9 | source: 10 | git: 11 | url: https://github.com/kluctl/kluctl-examples.git 12 | path: simple 13 | target: simple 14 | args: 15 | environment: test 16 | context: default 17 | # Let it automatically clean up orphan resources and delete all resources when the KluctlDeployment itself gets 18 | # deleted. You might consider setting these to false for prod and instead do manual pruning and deletion when the 19 | # need arises. 20 | prune: true 21 | delete: true 22 | -------------------------------------------------------------------------------- /gitops-deployment/clusters/test.example.com/app2.yaml: -------------------------------------------------------------------------------- 1 | # clusters/test.example.com/app1.yaml 2 | apiVersion: gitops.kluctl.io/v1beta1 3 | kind: KluctlDeployment 4 | metadata: 5 | name: app2 6 | namespace: kluctl-gitops 7 | spec: 8 | interval: 5m 9 | source: 10 | git: 11 | url: https://github.com/kluctl/kluctl-examples.git 12 | path: simple-helm 13 | target: simple-helm 14 | args: 15 | environment: test 16 | context: default 17 | # Let it automatically clean up orphan resources and delete all resources when the KluctlDeployment itself gets 18 | # deleted. You might consider setting these to false for prod and instead do manual pruning and deletion when the 19 | # need arises. 20 | prune: true 21 | delete: true 22 | -------------------------------------------------------------------------------- /gitops-deployment/deployment.yaml: -------------------------------------------------------------------------------- 1 | # deployment.yaml 2 | deployments: 3 | - path: namespaces 4 | - barrier: true 5 | - include: clusters 6 | -------------------------------------------------------------------------------- /gitops-deployment/namespaces/kluctl-gitops.yaml: -------------------------------------------------------------------------------- 1 | # namespaces/kluctl-gitops.yaml 2 | apiVersion: v1 3 | kind: Namespace 4 | metadata: 5 | name: kluctl-gitops 6 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/.kluctl.yml: -------------------------------------------------------------------------------- 1 | discriminator: kluctl-examples-microservices-demo-{{ target.name }} 2 | 3 | targets: 4 | - name: local 5 | context: kind-kind 6 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/adservice/deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: adservice 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: adservice 9 | template: 10 | metadata: 11 | labels: 12 | app: adservice 13 | spec: 14 | serviceAccountName: default 15 | terminationGracePeriodSeconds: 5 16 | containers: 17 | - name: server 18 | image: gcr.io/google-samples/microservices-demo/adservice:v0.3.6 19 | ports: 20 | - containerPort: 9555 21 | env: 22 | - name: PORT 23 | value: "9555" 24 | - name: DISABLE_STATS 25 | value: "1" 26 | - name: DISABLE_TRACING 27 | value: "1" 28 | # - name: JAEGER_SERVICE_ADDR 29 | # value: "jaeger-collector:14268" 30 | resources: 31 | requests: 32 | cpu: 50m 33 | memory: 180Mi 34 | limits: 35 | cpu: 300m 36 | memory: 300Mi 37 | readinessProbe: 38 | initialDelaySeconds: 20 39 | periodSeconds: 15 40 | exec: 41 | command: ["/bin/grpc_health_probe", "-addr=:9555"] 42 | livenessProbe: 43 | initialDelaySeconds: 20 44 | periodSeconds: 15 45 | exec: 46 | command: ["/bin/grpc_health_probe", "-addr=:9555"] 47 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/adservice/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yml 3 | - service.yml 4 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/adservice/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: adservice 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: adservice 9 | ports: 10 | - name: grpc 11 | port: 9555 12 | targetPort: 9555 13 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/cartservice/deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: cartservice 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: cartservice 9 | template: 10 | metadata: 11 | labels: 12 | app: cartservice 13 | spec: 14 | serviceAccountName: default 15 | terminationGracePeriodSeconds: 5 16 | containers: 17 | - name: server 18 | image: gcr.io/google-samples/microservices-demo/cartservice:v0.3.6 19 | ports: 20 | - containerPort: 7070 21 | env: 22 | - name: REDIS_ADDR 23 | value: "redis-cart:6379" 24 | resources: 25 | requests: 26 | cpu: 50m 27 | memory: 64Mi 28 | limits: 29 | cpu: 300m 30 | memory: 128Mi 31 | readinessProbe: 32 | initialDelaySeconds: 15 33 | exec: 34 | command: ["/bin/grpc_health_probe", "-addr=:7070", "-rpc-timeout=5s"] 35 | livenessProbe: 36 | initialDelaySeconds: 15 37 | periodSeconds: 10 38 | exec: 39 | command: ["/bin/grpc_health_probe", "-addr=:7070", "-rpc-timeout=5s"] 40 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/cartservice/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yml 3 | - service.yml 4 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/cartservice/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: cartservice 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: cartservice 9 | ports: 10 | - name: grpc 11 | port: 7070 12 | targetPort: 7070 13 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/checkoutservice/deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: checkoutservice 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: checkoutservice 9 | template: 10 | metadata: 11 | labels: 12 | app: checkoutservice 13 | spec: 14 | serviceAccountName: default 15 | containers: 16 | - name: server 17 | image: gcr.io/google-samples/microservices-demo/checkoutservice:v0.3.6 18 | ports: 19 | - containerPort: 5050 20 | readinessProbe: 21 | exec: 22 | command: ["/bin/grpc_health_probe", "-addr=:5050"] 23 | livenessProbe: 24 | exec: 25 | command: ["/bin/grpc_health_probe", "-addr=:5050"] 26 | env: 27 | - name: PORT 28 | value: "5050" 29 | - name: PRODUCT_CATALOG_SERVICE_ADDR 30 | value: "productcatalogservice:3550" 31 | - name: SHIPPING_SERVICE_ADDR 32 | value: "shippingservice:50051" 33 | - name: PAYMENT_SERVICE_ADDR 34 | value: "paymentservice:50051" 35 | - name: EMAIL_SERVICE_ADDR 36 | value: "emailservice:5000" 37 | - name: CURRENCY_SERVICE_ADDR 38 | value: "currencyservice:7000" 39 | - name: CART_SERVICE_ADDR 40 | value: "cartservice:7070" 41 | - name: DISABLE_STATS 42 | value: "1" 43 | - name: DISABLE_TRACING 44 | value: "1" 45 | - name: DISABLE_PROFILER 46 | value: "1" 47 | # - name: JAEGER_SERVICE_ADDR 48 | # value: "jaeger-collector:14268" 49 | resources: 50 | requests: 51 | cpu: 50m 52 | memory: 64Mi 53 | limits: 54 | cpu: 200m 55 | memory: 128Mi 56 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/checkoutservice/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yml 3 | - service.yml 4 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/checkoutservice/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: checkoutservice 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: checkoutservice 9 | ports: 10 | - name: grpc 11 | port: 5050 12 | targetPort: 5050 13 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/currencyservice/deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: currencyservice 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: currencyservice 9 | template: 10 | metadata: 11 | labels: 12 | app: currencyservice 13 | spec: 14 | serviceAccountName: default 15 | terminationGracePeriodSeconds: 5 16 | containers: 17 | - name: server 18 | image: gcr.io/google-samples/microservices-demo/currencyservice:v0.3.6 19 | ports: 20 | - name: grpc 21 | containerPort: 7000 22 | env: 23 | - name: PORT 24 | value: "7000" 25 | - name: DISABLE_TRACING 26 | value: "1" 27 | - name: DISABLE_PROFILER 28 | value: "1" 29 | - name: DISABLE_DEBUGGER 30 | value: "1" 31 | readinessProbe: 32 | exec: 33 | command: ["/bin/grpc_health_probe", "-addr=:7000"] 34 | livenessProbe: 35 | exec: 36 | command: ["/bin/grpc_health_probe", "-addr=:7000"] 37 | resources: 38 | requests: 39 | cpu: 50m 40 | memory: 64Mi 41 | limits: 42 | cpu: 200m 43 | memory: 128Mi 44 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/currencyservice/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yml 3 | - service.yml 4 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/currencyservice/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: currencyservice 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: currencyservice 9 | ports: 10 | - name: grpc 11 | port: 7000 12 | targetPort: 7000 13 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/deployment.yml: -------------------------------------------------------------------------------- 1 | deployments: 2 | - path: redis 3 | - path: adservice 4 | - path: cartservice 5 | - path: checkoutservice 6 | - path: currencyservice 7 | - path: emailservice 8 | - path: frontend 9 | - path: loadgenerator 10 | - path: paymentservice 11 | - path: productcatalogservice 12 | - path: recommendationservice 13 | - path: shippingservice 14 | 15 | commonLabels: 16 | examples.kluctl.io/deployment-project: "microservices-demo" 17 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/emailservice/deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: emailservice 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: emailservice 9 | template: 10 | metadata: 11 | labels: 12 | app: emailservice 13 | spec: 14 | serviceAccountName: default 15 | terminationGracePeriodSeconds: 5 16 | containers: 17 | - name: server 18 | image: gcr.io/google-samples/microservices-demo/emailservice:v0.3.6 19 | ports: 20 | - containerPort: 8080 21 | env: 22 | - name: PORT 23 | value: "8080" 24 | - name: DISABLE_TRACING 25 | value: "1" 26 | - name: DISABLE_PROFILER 27 | value: "1" 28 | readinessProbe: 29 | periodSeconds: 5 30 | exec: 31 | command: ["/bin/grpc_health_probe", "-addr=:8080"] 32 | livenessProbe: 33 | periodSeconds: 5 34 | exec: 35 | command: ["/bin/grpc_health_probe", "-addr=:8080"] 36 | resources: 37 | requests: 38 | cpu: 50m 39 | memory: 64Mi 40 | limits: 41 | cpu: 200m 42 | memory: 128Mi 43 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/emailservice/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yml 3 | - service.yml 4 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/emailservice/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: emailservice 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: emailservice 9 | ports: 10 | - name: grpc 11 | port: 5000 12 | targetPort: 8080 13 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/frontend/deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: frontend 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: frontend 9 | template: 10 | metadata: 11 | labels: 12 | app: frontend 13 | annotations: 14 | sidecar.istio.io/rewriteAppHTTPProbers: "true" 15 | spec: 16 | serviceAccountName: default 17 | containers: 18 | - name: server 19 | image: gcr.io/google-samples/microservices-demo/frontend:v0.3.6 20 | ports: 21 | - containerPort: 8080 22 | readinessProbe: 23 | initialDelaySeconds: 10 24 | httpGet: 25 | path: "/_healthz" 26 | port: 8080 27 | httpHeaders: 28 | - name: "Cookie" 29 | value: "shop_session-id=x-readiness-probe" 30 | livenessProbe: 31 | initialDelaySeconds: 10 32 | httpGet: 33 | path: "/_healthz" 34 | port: 8080 35 | httpHeaders: 36 | - name: "Cookie" 37 | value: "shop_session-id=x-liveness-probe" 38 | env: 39 | - name: PORT 40 | value: "8080" 41 | - name: PRODUCT_CATALOG_SERVICE_ADDR 42 | value: "productcatalogservice:3550" 43 | - name: CURRENCY_SERVICE_ADDR 44 | value: "currencyservice:7000" 45 | - name: CART_SERVICE_ADDR 46 | value: "cartservice:7070" 47 | - name: RECOMMENDATION_SERVICE_ADDR 48 | value: "recommendationservice:8080" 49 | - name: SHIPPING_SERVICE_ADDR 50 | value: "shippingservice:50051" 51 | - name: CHECKOUT_SERVICE_ADDR 52 | value: "checkoutservice:5050" 53 | - name: AD_SERVICE_ADDR 54 | value: "adservice:9555" 55 | # # ENV_PLATFORM: One of: local, gcp, aws, azure, onprem, alibaba 56 | # # When not set, defaults to "local" unless running in GKE, otherwies auto-sets to gcp 57 | # - name: ENV_PLATFORM 58 | # value: "aws" 59 | - name: DISABLE_TRACING 60 | value: "1" 61 | - name: DISABLE_PROFILER 62 | value: "1" 63 | # - name: JAEGER_SERVICE_ADDR 64 | # value: "jaeger-collector:14268" 65 | # - name: CYMBAL_BRANDING 66 | # value: "true" 67 | resources: 68 | requests: 69 | cpu: 50m 70 | memory: 64Mi 71 | limits: 72 | cpu: 200m 73 | memory: 128Mi 74 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/frontend/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yml 3 | - service.yml 4 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/frontend/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: frontend 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: frontend 9 | ports: 10 | - name: http 11 | port: 80 12 | targetPort: 8080 13 | --- 14 | apiVersion: v1 15 | kind: Service 16 | metadata: 17 | name: frontend-external 18 | spec: 19 | type: LoadBalancer 20 | selector: 21 | app: frontend 22 | ports: 23 | - name: http 24 | port: 80 25 | targetPort: 8080 26 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/loadgenerator/deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: loadgenerator 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: loadgenerator 9 | replicas: 1 10 | template: 11 | metadata: 12 | labels: 13 | app: loadgenerator 14 | annotations: 15 | sidecar.istio.io/rewriteAppHTTPProbers: "true" 16 | spec: 17 | serviceAccountName: default 18 | terminationGracePeriodSeconds: 5 19 | restartPolicy: Always 20 | initContainers: 21 | - command: 22 | - /bin/sh 23 | - -exc 24 | - | 25 | echo "Init container pinging frontend: ${FRONTEND_ADDR}..." 26 | STATUSCODE=$(wget --server-response http://${FRONTEND_ADDR} 2>&1 | awk '/^ HTTP/{print $2}') 27 | if test $STATUSCODE -ne 200; then 28 | echo "Error: Could not reach frontend - Status code: ${STATUSCODE}" 29 | exit 1 30 | fi 31 | name: frontend-check 32 | image: busybox:latest 33 | env: 34 | - name: FRONTEND_ADDR 35 | value: "frontend:80" 36 | containers: 37 | - name: main 38 | image: gcr.io/google-samples/microservices-demo/loadgenerator:v0.3.6 39 | env: 40 | - name: FRONTEND_ADDR 41 | value: "frontend:80" 42 | - name: USERS 43 | value: "10" 44 | resources: 45 | requests: 46 | cpu: 50m 47 | memory: 256Mi 48 | limits: 49 | cpu: 500m 50 | memory: 512Mi 51 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/loadgenerator/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yml 3 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/paymentservice/deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: paymentservice 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: paymentservice 9 | template: 10 | metadata: 11 | labels: 12 | app: paymentservice 13 | spec: 14 | serviceAccountName: default 15 | terminationGracePeriodSeconds: 5 16 | containers: 17 | - name: server 18 | image: gcr.io/google-samples/microservices-demo/paymentservice:v0.3.6 19 | ports: 20 | - containerPort: 50051 21 | env: 22 | - name: PORT 23 | value: "50051" 24 | - name: DISABLE_TRACING 25 | value: "1" 26 | - name: DISABLE_PROFILER 27 | value: "1" 28 | - name: DISABLE_DEBUGGER 29 | value: "1" 30 | readinessProbe: 31 | exec: 32 | command: ["/bin/grpc_health_probe", "-addr=:50051"] 33 | livenessProbe: 34 | exec: 35 | command: ["/bin/grpc_health_probe", "-addr=:50051"] 36 | resources: 37 | requests: 38 | cpu: 50m 39 | memory: 64Mi 40 | limits: 41 | cpu: 200m 42 | memory: 128Mi 43 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/paymentservice/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yml 3 | - service.yml 4 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/paymentservice/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: paymentservice 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: paymentservice 9 | ports: 10 | - name: grpc 11 | port: 50051 12 | targetPort: 50051 13 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/productcatalogservice/deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: productcatalogservice 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: productcatalogservice 9 | template: 10 | metadata: 11 | labels: 12 | app: productcatalogservice 13 | spec: 14 | serviceAccountName: default 15 | terminationGracePeriodSeconds: 5 16 | containers: 17 | - name: server 18 | image: gcr.io/google-samples/microservices-demo/productcatalogservice:v0.3.6 19 | ports: 20 | - containerPort: 3550 21 | env: 22 | - name: PORT 23 | value: "3550" 24 | - name: DISABLE_STATS 25 | value: "1" 26 | - name: DISABLE_TRACING 27 | value: "1" 28 | - name: DISABLE_PROFILER 29 | value: "1" 30 | # - name: JAEGER_SERVICE_ADDR 31 | # value: "jaeger-collector:14268" 32 | readinessProbe: 33 | exec: 34 | command: ["/bin/grpc_health_probe", "-addr=:3550"] 35 | livenessProbe: 36 | exec: 37 | command: ["/bin/grpc_health_probe", "-addr=:3550"] 38 | resources: 39 | requests: 40 | cpu: 50m 41 | memory: 64Mi 42 | limits: 43 | cpu: 200m 44 | memory: 128Mi 45 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/productcatalogservice/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yml 3 | - service.yml 4 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/productcatalogservice/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: productcatalogservice 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: productcatalogservice 9 | ports: 10 | - name: grpc 11 | port: 3550 12 | targetPort: 3550 13 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/recommendationservice/deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: recommendationservice 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: recommendationservice 9 | template: 10 | metadata: 11 | labels: 12 | app: recommendationservice 13 | spec: 14 | serviceAccountName: default 15 | terminationGracePeriodSeconds: 5 16 | containers: 17 | - name: server 18 | image: gcr.io/google-samples/microservices-demo/recommendationservice:v0.3.6 19 | ports: 20 | - containerPort: 8080 21 | readinessProbe: 22 | periodSeconds: 5 23 | exec: 24 | command: ["/bin/grpc_health_probe", "-addr=:8080"] 25 | livenessProbe: 26 | periodSeconds: 5 27 | exec: 28 | command: ["/bin/grpc_health_probe", "-addr=:8080"] 29 | env: 30 | - name: PORT 31 | value: "8080" 32 | - name: PRODUCT_CATALOG_SERVICE_ADDR 33 | value: "productcatalogservice:3550" 34 | - name: DISABLE_TRACING 35 | value: "1" 36 | - name: DISABLE_PROFILER 37 | value: "1" 38 | - name: DISABLE_DEBUGGER 39 | value: "1" 40 | resources: 41 | requests: 42 | cpu: 50m 43 | memory: 220Mi 44 | limits: 45 | cpu: 200m 46 | memory: 450Mi 47 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/recommendationservice/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yml 3 | - service.yml 4 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/recommendationservice/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: recommendationservice 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: recommendationservice 9 | ports: 10 | - name: grpc 11 | port: 8080 12 | targetPort: 8080 13 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/redis/deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: redis-cart 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: redis-cart 9 | template: 10 | metadata: 11 | labels: 12 | app: redis-cart 13 | spec: 14 | containers: 15 | - name: redis 16 | image: redis:alpine 17 | ports: 18 | - containerPort: 6379 19 | readinessProbe: 20 | periodSeconds: 5 21 | tcpSocket: 22 | port: 6379 23 | livenessProbe: 24 | periodSeconds: 5 25 | tcpSocket: 26 | port: 6379 27 | volumeMounts: 28 | - mountPath: /data 29 | name: redis-data 30 | resources: 31 | limits: 32 | memory: 256Mi 33 | cpu: 125m 34 | requests: 35 | cpu: 70m 36 | memory: 200Mi 37 | volumes: 38 | - name: redis-data 39 | emptyDir: {} 40 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/redis/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yml 3 | - service.yml 4 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/redis/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: redis-cart 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: redis-cart 9 | ports: 10 | - name: redis 11 | port: 6379 12 | targetPort: 6379 13 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/shippingservice/deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: shippingservice 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: shippingservice 9 | template: 10 | metadata: 11 | labels: 12 | app: shippingservice 13 | spec: 14 | serviceAccountName: default 15 | containers: 16 | - name: server 17 | image: gcr.io/google-samples/microservices-demo/shippingservice:v0.3.6 18 | ports: 19 | - containerPort: 50051 20 | env: 21 | - name: PORT 22 | value: "50051" 23 | - name: DISABLE_STATS 24 | value: "1" 25 | - name: DISABLE_TRACING 26 | value: "1" 27 | - name: DISABLE_PROFILER 28 | value: "1" 29 | # - name: JAEGER_SERVICE_ADDR 30 | # value: "jaeger-collector:14268" 31 | readinessProbe: 32 | periodSeconds: 5 33 | exec: 34 | command: ["/bin/grpc_health_probe", "-addr=:50051"] 35 | livenessProbe: 36 | exec: 37 | command: ["/bin/grpc_health_probe", "-addr=:50051"] 38 | resources: 39 | requests: 40 | cpu: 50m 41 | memory: 64Mi 42 | limits: 43 | cpu: 200m 44 | memory: 128Mi 45 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/shippingservice/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yml 3 | - service.yml 4 | -------------------------------------------------------------------------------- /microservices-demo/1-basic-project/shippingservice/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: shippingservice 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: shippingservice 9 | ports: 10 | - name: grpc 11 | port: 50051 12 | targetPort: 50051 13 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/Chart.lock: -------------------------------------------------------------------------------- 1 | dependencies: 2 | - name: common 3 | repository: https://charts.bitnami.com/bitnami 4 | version: 2.2.2 5 | digest: sha256:49ca75cf23ba5eb7df4becef52580f98c8bd8194eb80368b9d7b875f6eefa8e5 6 | generated: "2022-12-12T19:34:26.826289322Z" 7 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/Chart.yaml: -------------------------------------------------------------------------------- 1 | annotations: 2 | category: Database 3 | apiVersion: v2 4 | appVersion: 7.0.7 5 | dependencies: 6 | - name: common 7 | repository: https://charts.bitnami.com/bitnami 8 | tags: 9 | - bitnami-common 10 | version: 2.x.x 11 | description: Redis(R) is an open source, advanced key-value store. It is often referred 12 | to as a data structure server since keys can contain strings, hashes, lists, sets 13 | and sorted sets. 14 | home: https://github.com/bitnami/charts/tree/main/bitnami/redis 15 | icon: https://bitnami.com/assets/stacks/redis/img/redis-stack-220x234.png 16 | keywords: 17 | - redis 18 | - keyvalue 19 | - database 20 | maintainers: 21 | - name: Bitnami 22 | url: https://github.com/bitnami/charts 23 | name: redis 24 | sources: 25 | - https://github.com/bitnami/containers/tree/main/bitnami/redis 26 | version: 17.4.0 27 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/charts/common/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | .vscode/ 23 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/charts/common/Chart.yaml: -------------------------------------------------------------------------------- 1 | annotations: 2 | category: Infrastructure 3 | apiVersion: v2 4 | appVersion: 2.2.2 5 | description: A Library Helm Chart for grouping common logic between bitnami charts. 6 | This chart is not deployable by itself. 7 | home: https://github.com/bitnami/charts/tree/main/bitnami/common 8 | icon: https://bitnami.com/downloads/logos/bitnami-mark.png 9 | keywords: 10 | - common 11 | - helper 12 | - template 13 | - function 14 | - bitnami 15 | maintainers: 16 | - name: Bitnami 17 | url: https://github.com/bitnami/charts 18 | name: common 19 | sources: 20 | - https://github.com/bitnami/charts 21 | - https://www.bitnami.com/ 22 | type: library 23 | version: 2.2.2 24 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/charts/common/templates/_errors.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Through error when upgrading using empty passwords values that must not be empty. 4 | 5 | Usage: 6 | {{- $validationError00 := include "common.validations.values.single.empty" (dict "valueKey" "path.to.password00" "secret" "secretName" "field" "password-00") -}} 7 | {{- $validationError01 := include "common.validations.values.single.empty" (dict "valueKey" "path.to.password01" "secret" "secretName" "field" "password-01") -}} 8 | {{ include "common.errors.upgrade.passwords.empty" (dict "validationErrors" (list $validationError00 $validationError01) "context" $) }} 9 | 10 | Required password params: 11 | - validationErrors - String - Required. List of validation strings to be return, if it is empty it won't throw error. 12 | - context - Context - Required. Parent context. 13 | */}} 14 | {{- define "common.errors.upgrade.passwords.empty" -}} 15 | {{- $validationErrors := join "" .validationErrors -}} 16 | {{- if and $validationErrors .context.Release.IsUpgrade -}} 17 | {{- $errorString := "\nPASSWORDS ERROR: You must provide your current passwords when upgrading the release." -}} 18 | {{- $errorString = print $errorString "\n Note that even after reinstallation, old credentials may be needed as they may be kept in persistent volume claims." -}} 19 | {{- $errorString = print $errorString "\n Further information can be obtained at https://docs.bitnami.com/general/how-to/troubleshoot-helm-chart-issues/#credential-errors-while-upgrading-chart-releases" -}} 20 | {{- $errorString = print $errorString "\n%s" -}} 21 | {{- printf $errorString $validationErrors | fail -}} 22 | {{- end -}} 23 | {{- end -}} 24 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/charts/common/templates/_labels.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Kubernetes standard labels 4 | */}} 5 | {{- define "common.labels.standard" -}} 6 | app.kubernetes.io/name: {{ include "common.names.name" . }} 7 | helm.sh/chart: {{ include "common.names.chart" . }} 8 | app.kubernetes.io/instance: {{ .Release.Name }} 9 | app.kubernetes.io/managed-by: {{ .Release.Service }} 10 | {{- end -}} 11 | 12 | {{/* 13 | Labels to use on deploy.spec.selector.matchLabels and svc.spec.selector 14 | */}} 15 | {{- define "common.labels.matchLabels" -}} 16 | app.kubernetes.io/name: {{ include "common.names.name" . }} 17 | app.kubernetes.io/instance: {{ .Release.Name }} 18 | {{- end -}} 19 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/charts/common/templates/_storage.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Return the proper Storage Class 4 | {{ include "common.storage.class" ( dict "persistence" .Values.path.to.the.persistence "global" $) }} 5 | */}} 6 | {{- define "common.storage.class" -}} 7 | 8 | {{- $storageClass := .persistence.storageClass -}} 9 | {{- if .global -}} 10 | {{- if .global.storageClass -}} 11 | {{- $storageClass = .global.storageClass -}} 12 | {{- end -}} 13 | {{- end -}} 14 | 15 | {{- if $storageClass -}} 16 | {{- if (eq "-" $storageClass) -}} 17 | {{- printf "storageClassName: \"\"" -}} 18 | {{- else }} 19 | {{- printf "storageClassName: %s" $storageClass -}} 20 | {{- end -}} 21 | {{- end -}} 22 | 23 | {{- end -}} 24 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/charts/common/templates/_tplvalues.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Renders a value that contains template. 4 | Usage: 5 | {{ include "common.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $) }} 6 | */}} 7 | {{- define "common.tplvalues.render" -}} 8 | {{- if typeIs "string" .value }} 9 | {{- tpl .value .context }} 10 | {{- else }} 11 | {{- tpl (.value | toYaml) .context }} 12 | {{- end }} 13 | {{- end -}} 14 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/charts/common/templates/_utils.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Print instructions to get a secret value. 4 | Usage: 5 | {{ include "common.utils.secret.getvalue" (dict "secret" "secret-name" "field" "secret-value-field" "context" $) }} 6 | */}} 7 | {{- define "common.utils.secret.getvalue" -}} 8 | {{- $varname := include "common.utils.fieldToEnvVar" . -}} 9 | export {{ $varname }}=$(kubectl get secret --namespace {{ include "common.names.namespace" .context | quote }} {{ .secret }} -o jsonpath="{.data.{{ .field }}}" | base64 -d) 10 | {{- end -}} 11 | 12 | {{/* 13 | Build env var name given a field 14 | Usage: 15 | {{ include "common.utils.fieldToEnvVar" dict "field" "my-password" }} 16 | */}} 17 | {{- define "common.utils.fieldToEnvVar" -}} 18 | {{- $fieldNameSplit := splitList "-" .field -}} 19 | {{- $upperCaseFieldNameSplit := list -}} 20 | 21 | {{- range $fieldNameSplit -}} 22 | {{- $upperCaseFieldNameSplit = append $upperCaseFieldNameSplit ( upper . ) -}} 23 | {{- end -}} 24 | 25 | {{ join "_" $upperCaseFieldNameSplit }} 26 | {{- end -}} 27 | 28 | {{/* 29 | Gets a value from .Values given 30 | Usage: 31 | {{ include "common.utils.getValueFromKey" (dict "key" "path.to.key" "context" $) }} 32 | */}} 33 | {{- define "common.utils.getValueFromKey" -}} 34 | {{- $splitKey := splitList "." .key -}} 35 | {{- $value := "" -}} 36 | {{- $latestObj := $.context.Values -}} 37 | {{- range $splitKey -}} 38 | {{- if not $latestObj -}} 39 | {{- printf "please review the entire path of '%s' exists in values" $.key | fail -}} 40 | {{- end -}} 41 | {{- $value = ( index $latestObj . ) -}} 42 | {{- $latestObj = $value -}} 43 | {{- end -}} 44 | {{- printf "%v" (default "" $value) -}} 45 | {{- end -}} 46 | 47 | {{/* 48 | Returns first .Values key with a defined value or first of the list if all non-defined 49 | Usage: 50 | {{ include "common.utils.getKeyFromList" (dict "keys" (list "path.to.key1" "path.to.key2") "context" $) }} 51 | */}} 52 | {{- define "common.utils.getKeyFromList" -}} 53 | {{- $key := first .keys -}} 54 | {{- $reverseKeys := reverse .keys }} 55 | {{- range $reverseKeys }} 56 | {{- $value := include "common.utils.getValueFromKey" (dict "key" . "context" $.context ) }} 57 | {{- if $value -}} 58 | {{- $key = . }} 59 | {{- end -}} 60 | {{- end -}} 61 | {{- printf "%s" $key -}} 62 | {{- end -}} 63 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/charts/common/templates/_warnings.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Warning about using rolling tag. 4 | Usage: 5 | {{ include "common.warnings.rollingTag" .Values.path.to.the.imageRoot }} 6 | */}} 7 | {{- define "common.warnings.rollingTag" -}} 8 | 9 | {{- if and (contains "bitnami/" .repository) (not (.tag | toString | regexFind "-r\\d+$|sha256:")) }} 10 | WARNING: Rolling tag detected ({{ .repository }}:{{ .tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment. 11 | +info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/ 12 | {{- end }} 13 | 14 | {{- end -}} 15 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/charts/common/values.yaml: -------------------------------------------------------------------------------- 1 | ## bitnami/common 2 | ## It is required by CI/CD tools and processes. 3 | ## @skip exampleValue 4 | ## 5 | exampleValue: common-chart 6 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/img/redis-cluster-topology.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kluctl/kluctl-examples/8dcccb8453e89e895916f98af5b0ca89ca458cc6/microservices-demo/2-helm-integration/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/img/redis-cluster-topology.png -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/img/redis-topology.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kluctl/kluctl-examples/8dcccb8453e89e895916f98af5b0ca89ca458cc6/microservices-demo/2-helm-integration/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/img/redis-topology.png -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/templates/extra-list.yaml: -------------------------------------------------------------------------------- 1 | {{- range .Values.extraDeploy }} 2 | --- 3 | {{ include "common.tplvalues.render" (dict "value" . "context" $) }} 4 | {{- end }} 5 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/templates/headless-svc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ printf "%s-headless" (include "common.names.fullname" .) }} 5 | namespace: {{ .Release.Namespace | quote }} 6 | labels: {{- include "common.labels.standard" . | nindent 4 }} 7 | {{- if .Values.commonLabels }} 8 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} 9 | {{- end }} 10 | annotations: 11 | {{- if .Values.commonAnnotations }} 12 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 13 | {{- end }} 14 | {{- include "redis.externalDNS.annotations" . | nindent 4 }} 15 | spec: 16 | type: ClusterIP 17 | clusterIP: None 18 | {{- if .Values.sentinel.enabled }} 19 | publishNotReadyAddresses: true 20 | {{- end }} 21 | ports: 22 | - name: tcp-redis 23 | port: {{ if .Values.sentinel.enabled }}{{ .Values.sentinel.service.ports.redis }}{{ else }}{{ .Values.master.service.ports.redis }}{{ end }} 24 | targetPort: redis 25 | {{- if .Values.sentinel.enabled }} 26 | - name: tcp-sentinel 27 | port: {{ .Values.sentinel.service.ports.sentinel }} 28 | targetPort: redis-sentinel 29 | {{- end }} 30 | selector: {{- include "common.labels.matchLabels" . | nindent 4 }} 31 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/templates/master/psp.yaml: -------------------------------------------------------------------------------- 1 | {{- $pspAvailable := (semverCompare "<1.25-0" (include "common.capabilities.kubeVersion" .)) -}} 2 | {{- if and $pspAvailable .Values.podSecurityPolicy.create }} 3 | apiVersion: policy/v1beta1 4 | kind: PodSecurityPolicy 5 | metadata: 6 | name: {{ printf "%s-master" (include "common.names.fullname" .) }} 7 | namespace: {{ .Release.Namespace | quote }} 8 | labels: {{- include "common.labels.standard" . | nindent 4 }} 9 | {{- if .Values.commonLabels }} 10 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} 11 | {{- end }} 12 | {{- if .Values.commonAnnotations }} 13 | annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 14 | {{- end }} 15 | spec: 16 | allowPrivilegeEscalation: false 17 | fsGroup: 18 | rule: 'MustRunAs' 19 | ranges: 20 | - min: {{ .Values.master.podSecurityContext.fsGroup }} 21 | max: {{ .Values.master.podSecurityContext.fsGroup }} 22 | hostIPC: false 23 | hostNetwork: false 24 | hostPID: false 25 | privileged: false 26 | readOnlyRootFilesystem: false 27 | requiredDropCapabilities: 28 | - ALL 29 | runAsUser: 30 | rule: 'MustRunAs' 31 | ranges: 32 | - min: {{ .Values.master.containerSecurityContext.runAsUser }} 33 | max: {{ .Values.master.containerSecurityContext.runAsUser }} 34 | seLinux: 35 | rule: 'RunAsAny' 36 | supplementalGroups: 37 | rule: 'MustRunAs' 38 | ranges: 39 | - min: {{ .Values.master.containerSecurityContext.runAsUser }} 40 | max: {{ .Values.master.containerSecurityContext.runAsUser }} 41 | volumes: 42 | - 'configMap' 43 | - 'secret' 44 | - 'emptyDir' 45 | - 'persistentVolumeClaim' 46 | {{- end }} 47 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/templates/master/pvc.yaml: -------------------------------------------------------------------------------- 1 | {{- if and (eq .Values.architecture "standalone") (eq .Values.master.kind "Deployment") (.Values.master.persistence.enabled) (not .Values.master.persistence.existingClaim) }} 2 | kind: PersistentVolumeClaim 3 | apiVersion: v1 4 | metadata: 5 | name: {{ printf "redis-data-%s-master" (include "common.names.fullname" .) }} 6 | namespace: {{ .Release.Namespace | quote }} 7 | labels: {{- include "common.labels.matchLabels" . | nindent 4 }} 8 | app.kubernetes.io/component: master 9 | {{- if .Values.master.persistence.annotations }} 10 | annotations: {{- toYaml .Values.master.persistence.annotations | nindent 4 }} 11 | {{- end }} 12 | spec: 13 | accessModes: 14 | {{- range .Values.master.persistence.accessModes }} 15 | - {{ . | quote }} 16 | {{- end }} 17 | resources: 18 | requests: 19 | storage: {{ .Values.master.persistence.size | quote }} 20 | {{- if .Values.master.persistence.selector }} 21 | selector: {{- include "common.tplvalues.render" (dict "value" .Values.master.persistence.selector "context" $) | nindent 4 }} 22 | {{- end }} 23 | {{- if .Values.master.persistence.dataSource }} 24 | dataSource: {{- include "common.tplvalues.render" (dict "value" .Values.master.persistence.dataSource "context" $) | nindent 4 }} 25 | {{- end }} 26 | {{- include "common.storage.class" (dict "persistence" .Values.master.persistence "global" .Values.global) | nindent 2 }} 27 | {{- end }} 28 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/templates/master/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.master.serviceAccount.create }} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | automountServiceAccountToken: {{ .Values.master.serviceAccount.automountServiceAccountToken }} 5 | metadata: 6 | name: {{ template "redis.masterServiceAccountName" . }} 7 | namespace: {{ .Release.Namespace | quote }} 8 | labels: {{- include "common.labels.standard" . | nindent 4 }} 9 | {{- if .Values.commonLabels }} 10 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} 11 | {{- end }} 12 | {{- if or .Values.commonAnnotations .Values.master.serviceAccount.annotations }} 13 | annotations: 14 | {{- if or .Values.commonAnnotations }} 15 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 16 | {{- end }} 17 | {{- if .Values.master.serviceAccount.annotations }} 18 | {{- include "common.tplvalues.render" ( dict "value" .Values.master.serviceAccount.annotations "context" $ ) | nindent 4 }} 19 | {{- end }} 20 | {{- end }} 21 | {{- end }} 22 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/templates/metrics-svc.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.metrics.enabled }} 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: {{ printf "%s-metrics" (include "common.names.fullname" .) }} 6 | namespace: {{ .Release.Namespace | quote }} 7 | labels: {{- include "common.labels.standard" . | nindent 4 }} 8 | app.kubernetes.io/component: metrics 9 | {{- if .Values.commonLabels }} 10 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} 11 | {{- end }} 12 | {{- if or .Values.metrics.service.annotations .Values.commonAnnotations }} 13 | annotations: 14 | {{- if .Values.metrics.service.annotations }} 15 | {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.service.annotations "context" $ ) | nindent 4 }} 16 | {{- end }} 17 | {{- if .Values.commonAnnotations }} 18 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 19 | {{- end }} 20 | {{- end }} 21 | spec: 22 | type: {{ .Values.metrics.service.type }} 23 | {{- if eq .Values.metrics.service.type "LoadBalancer" }} 24 | externalTrafficPolicy: {{ .Values.metrics.service.externalTrafficPolicy }} 25 | {{- end }} 26 | {{- if and (eq .Values.metrics.service.type "LoadBalancer") .Values.metrics.service.loadBalancerIP }} 27 | loadBalancerIP: {{ .Values.metrics.service.loadBalancerIP }} 28 | {{- end }} 29 | {{- if and (eq .Values.metrics.service.type "LoadBalancer") .Values.metrics.service.loadBalancerSourceRanges }} 30 | loadBalancerSourceRanges: {{- toYaml .Values.metrics.service.loadBalancerSourceRanges | nindent 4 }} 31 | {{- end }} 32 | ports: 33 | - name: http-metrics 34 | port: {{ .Values.metrics.service.port }} 35 | protocol: TCP 36 | targetPort: metrics 37 | {{- if .Values.metrics.service.extraPorts }} 38 | {{- include "common.tplvalues.render" (dict "value" .Values.metrics.service.extraPorts "context" $) | nindent 4 }} 39 | {{- end }} 40 | selector: {{- include "common.labels.matchLabels" . | nindent 4 }} 41 | {{- end }} 42 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/templates/pdb.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.pdb.create }} 2 | apiVersion: {{ include "common.capabilities.policy.apiVersion" . }} 3 | kind: PodDisruptionBudget 4 | metadata: 5 | name: {{ template "common.names.fullname" . }} 6 | namespace: {{ .Release.Namespace | quote }} 7 | labels: {{- include "common.labels.standard" . | nindent 4 }} 8 | {{- if .Values.commonLabels }} 9 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} 10 | {{- end }} 11 | {{- if .Values.commonAnnotations }} 12 | annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 13 | {{- end }} 14 | spec: 15 | {{- if .Values.pdb.minAvailable }} 16 | minAvailable: {{ .Values.pdb.minAvailable }} 17 | {{- end }} 18 | {{- if .Values.pdb.maxUnavailable }} 19 | maxUnavailable: {{ .Values.pdb.maxUnavailable }} 20 | {{- end }} 21 | selector: 22 | matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} 23 | {{- end }} 24 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/templates/prometheusrule.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.metrics.enabled .Values.metrics.prometheusRule.enabled }} 2 | apiVersion: monitoring.coreos.com/v1 3 | kind: PrometheusRule 4 | metadata: 5 | name: {{ template "common.names.fullname" . }} 6 | namespace: {{ default .Release.Namespace .Values.metrics.prometheusRule.namespace | quote }} 7 | labels: {{- include "common.labels.standard" . | nindent 4 }} 8 | {{- if .Values.metrics.prometheusRule.additionalLabels }} 9 | {{- include "common.tplvalues.render" (dict "value" .Values.metrics.prometheusRule.additionalLabels "context" $) | nindent 4 }} 10 | {{- end }} 11 | {{- if .Values.commonLabels }} 12 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} 13 | {{- end }} 14 | {{- if .Values.commonAnnotations }} 15 | annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 16 | {{- end }} 17 | spec: 18 | groups: 19 | - name: {{ include "common.names.fullname" . }} 20 | rules: {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.prometheusRule.rules "context" $ ) | nindent 8 }} 21 | {{- end }} 22 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/templates/replicas/hpa.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.replica.autoscaling.enabled (not .Values.sentinel.enabled) }} 2 | apiVersion: {{ include "common.capabilities.hpa.apiVersion" ( dict "context" $ ) }} 3 | kind: HorizontalPodAutoscaler 4 | metadata: 5 | name: {{ printf "%s-replicas" (include "common.names.fullname" .) }} 6 | namespace: {{ .Release.Namespace | quote }} 7 | labels: {{- include "common.labels.standard" . | nindent 4 }} 8 | app.kubernetes.io/component: replica 9 | {{- if .Values.commonLabels }} 10 | {{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }} 11 | {{- end }} 12 | {{- if .Values.commonAnnotations }} 13 | annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 14 | {{- end }} 15 | spec: 16 | scaleTargetRef: 17 | apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }} 18 | kind: StatefulSet 19 | name: {{ printf "%s-replicas" (include "common.names.fullname" .) }} 20 | minReplicas: {{ .Values.replica.autoscaling.minReplicas }} 21 | maxReplicas: {{ .Values.replica.autoscaling.maxReplicas }} 22 | metrics: 23 | {{- if .Values.replica.autoscaling.targetMemory }} 24 | - type: Resource 25 | resource: 26 | name: memory 27 | {{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }} 28 | targetAverageUtilization: {{ .Values.replica.autoscaling.targetMemory }} 29 | {{- else }} 30 | target: 31 | type: Utilization 32 | averageUtilization: {{ .Values.replica.autoscaling.targetMemory }} 33 | {{- end }} 34 | {{- end }} 35 | {{- if .Values.replica.autoscaling.targetCPU }} 36 | - type: Resource 37 | resource: 38 | name: cpu 39 | {{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }} 40 | targetAverageUtilization: {{ .Values.replica.autoscaling.targetCPU }} 41 | {{- else }} 42 | target: 43 | type: Utilization 44 | averageUtilization: {{ .Values.replica.autoscaling.targetCPU }} 45 | {{- end }} 46 | {{- end }} 47 | {{- end }} 48 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/templates/replicas/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.replica.serviceAccount.create }} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | automountServiceAccountToken: {{ .Values.replica.serviceAccount.automountServiceAccountToken }} 5 | metadata: 6 | name: {{ template "redis.replicaServiceAccountName" . }} 7 | namespace: {{ .Release.Namespace | quote }} 8 | labels: {{- include "common.labels.standard" . | nindent 4 }} 9 | {{- if .Values.commonLabels }} 10 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} 11 | {{- end }} 12 | {{- if or .Values.commonAnnotations .Values.replica.serviceAccount.annotations }} 13 | annotations: 14 | {{- if or .Values.commonAnnotations }} 15 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 16 | {{- end }} 17 | {{- if .Values.replica.serviceAccount.annotations }} 18 | {{- include "common.tplvalues.render" ( dict "value" .Values.replica.serviceAccount.annotations "context" $ ) | nindent 4 }} 19 | {{- end }} 20 | {{- end }} 21 | {{- end }} 22 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/templates/role.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.rbac.create }} 2 | apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }} 3 | kind: Role 4 | metadata: 5 | name: {{ template "common.names.fullname" . }} 6 | namespace: {{ .Release.Namespace | quote }} 7 | labels: {{- include "common.labels.standard" . | nindent 4 }} 8 | {{- if .Values.commonLabels }} 9 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} 10 | {{- end }} 11 | {{- if .Values.commonAnnotations }} 12 | annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 13 | {{- end }} 14 | rules: 15 | {{- $pspAvailable := (semverCompare "<1.25-0" (include "common.capabilities.kubeVersion" .)) -}} 16 | {{- if and $pspAvailable .Values.podSecurityPolicy.enabled }} 17 | - apiGroups: 18 | - '{{ template "podSecurityPolicy.apiGroup" . }}' 19 | resources: 20 | - 'podsecuritypolicies' 21 | verbs: 22 | - 'use' 23 | resourceNames: [{{ printf "%s-master" (include "common.names.fullname" .) }}] 24 | {{- end }} 25 | {{- if .Values.rbac.rules }} 26 | {{- include "common.tplvalues.render" ( dict "value" .Values.rbac.rules "context" $ ) | nindent 2 }} 27 | {{- end }} 28 | {{- end }} 29 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/templates/rolebinding.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.rbac.create }} 2 | apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }} 3 | kind: RoleBinding 4 | metadata: 5 | name: {{ template "common.names.fullname" . }} 6 | namespace: {{ .Release.Namespace | quote }} 7 | labels: {{- include "common.labels.standard" . | nindent 4 }} 8 | {{- if .Values.commonLabels }} 9 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} 10 | {{- end }} 11 | {{- if .Values.commonAnnotations }} 12 | annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 13 | {{- end }} 14 | roleRef: 15 | apiGroup: rbac.authorization.k8s.io 16 | kind: Role 17 | name: {{ template "common.names.fullname" . }} 18 | subjects: 19 | - kind: ServiceAccount 20 | name: {{ template "redis.serviceAccountName" . }} 21 | {{- end }} 22 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/templates/secret.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.auth.enabled (not .Values.auth.existingSecret) -}} 2 | apiVersion: v1 3 | kind: Secret 4 | metadata: 5 | name: {{ template "common.names.fullname" . }} 6 | namespace: {{ .Release.Namespace | quote }} 7 | labels: {{- include "common.labels.standard" . | nindent 4 }} 8 | {{- if .Values.commonLabels }} 9 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} 10 | {{- end }} 11 | {{- if or .Values.secretAnnotations .Values.commonAnnotations }} 12 | annotations: 13 | {{- if .Values.secretAnnotations }} 14 | {{- include "common.tplvalues.render" ( dict "value" .Values.secretAnnotations "context" $ ) | nindent 4 }} 15 | {{- end }} 16 | {{- if .Values.commonAnnotations }} 17 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 18 | {{- end }} 19 | {{- end }} 20 | type: Opaque 21 | data: 22 | redis-password: {{ include "redis.password" . | b64enc | quote }} 23 | {{- end -}} 24 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/templates/sentinel/hpa.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.replica.autoscaling.enabled .Values.sentinel.enabled }} 2 | apiVersion: {{ include "common.capabilities.hpa.apiVersion" ( dict "context" $ ) }} 3 | kind: HorizontalPodAutoscaler 4 | metadata: 5 | name: {{ printf "%s-node" (include "common.names.fullname" .) }} 6 | namespace: {{ .Release.Namespace | quote }} 7 | labels: {{- include "common.labels.standard" . | nindent 4 }} 8 | app.kubernetes.io/component: replica 9 | {{- if .Values.commonLabels }} 10 | {{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }} 11 | {{- end }} 12 | {{- if .Values.commonAnnotations }} 13 | annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 14 | {{- end }} 15 | spec: 16 | scaleTargetRef: 17 | apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }} 18 | kind: StatefulSet 19 | name: {{ printf "%s-node" (include "common.names.fullname" .) }} 20 | minReplicas: {{ .Values.replica.autoscaling.minReplicas }} 21 | maxReplicas: {{ .Values.replica.autoscaling.maxReplicas }} 22 | metrics: 23 | {{- if .Values.replica.autoscaling.targetMemory }} 24 | - type: Resource 25 | resource: 26 | name: memory 27 | {{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }} 28 | targetAverageUtilization: {{ .Values.replica.autoscaling.targetMemory }} 29 | {{- else }} 30 | target: 31 | type: Utilization 32 | averageUtilization: {{ .Values.replica.autoscaling.targetMemory }} 33 | {{- end }} 34 | {{- end }} 35 | {{- if .Values.replica.autoscaling.targetCPU }} 36 | - type: Resource 37 | resource: 38 | name: cpu 39 | {{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }} 40 | targetAverageUtilization: {{ .Values.replica.autoscaling.targetCPU }} 41 | {{- else }} 42 | target: 43 | type: Utilization 44 | averageUtilization: {{ .Values.replica.autoscaling.targetCPU }} 45 | {{- end }} 46 | {{- end }} 47 | {{- end }} 48 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.serviceAccount.create (and (not .Values.master.serviceAccount.create) (not .Values.replica.serviceAccount.create)) }} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }} 5 | metadata: 6 | name: {{ template "redis.serviceAccountName" . }} 7 | namespace: {{ .Release.Namespace | quote }} 8 | labels: {{- include "common.labels.standard" . | nindent 4 }} 9 | {{- if .Values.commonLabels }} 10 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} 11 | {{- end }} 12 | {{- if or .Values.commonAnnotations .Values.serviceAccount.annotations }} 13 | annotations: 14 | {{- if or .Values.commonAnnotations }} 15 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 16 | {{- end }} 17 | {{- if .Values.serviceAccount.annotations }} 18 | {{- include "common.tplvalues.render" ( dict "value" .Values.serviceAccount.annotations "context" $ ) | nindent 4 }} 19 | {{- end }} 20 | {{- end }} 21 | {{- end }} -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/templates/servicemonitor.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled }} 2 | apiVersion: monitoring.coreos.com/v1 3 | kind: ServiceMonitor 4 | metadata: 5 | name: {{ template "common.names.fullname" . }} 6 | namespace: {{ default .Release.Namespace .Values.metrics.serviceMonitor.namespace | quote }} 7 | labels: {{- include "common.labels.standard" . | nindent 4 }} 8 | {{- if .Values.metrics.serviceMonitor.additionalLabels }} 9 | {{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.additionalLabels "context" $) | nindent 4 }} 10 | {{- end }} 11 | {{- if .Values.commonLabels }} 12 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} 13 | {{- end }} 14 | {{- if .Values.commonAnnotations }} 15 | annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 16 | {{- end }} 17 | spec: 18 | endpoints: 19 | - port: http-metrics 20 | {{- if .Values.metrics.serviceMonitor.interval }} 21 | interval: {{ .Values.metrics.serviceMonitor.interval }} 22 | {{- end }} 23 | {{- if .Values.metrics.serviceMonitor.scrapeTimeout }} 24 | scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }} 25 | {{- end }} 26 | {{- if .Values.metrics.serviceMonitor.honorLabels }} 27 | honorLabels: {{ .Values.metrics.serviceMonitor.honorLabels }} 28 | {{- end }} 29 | {{- if .Values.metrics.serviceMonitor.relabellings }} 30 | relabelings: {{- toYaml .Values.metrics.serviceMonitor.relabellings | nindent 6 }} 31 | {{- end }} 32 | {{- if .Values.metrics.serviceMonitor.metricRelabelings }} 33 | metricRelabelings: {{- toYaml .Values.metrics.serviceMonitor.metricRelabelings | nindent 6 }} 34 | {{- end }} 35 | {{- if .Values.metrics.serviceMonitor.podTargetLabels }} 36 | podTargetLabels: {{- toYaml .Values.metrics.serviceMonitor.podTargetLabels | nindent 4 }} 37 | {{- end }} 38 | namespaceSelector: 39 | matchNames: 40 | - {{ .Release.Namespace }} 41 | selector: 42 | matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} 43 | app.kubernetes.io/component: metrics 44 | {{- end }} 45 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/templates/tls-secret.yaml: -------------------------------------------------------------------------------- 1 | {{- if (include "redis.createTlsSecret" .) }} 2 | {{- $secretName := printf "%s-crt" (include "common.names.fullname" .) }} 3 | {{- $existingCerts := (lookup "v1" "Secret" .Release.Namespace $secretName).data | default dict }} 4 | {{- $ca := genCA "redis-ca" 365 }} 5 | {{- $releaseNamespace := .Release.Namespace }} 6 | {{- $clusterDomain := .Values.clusterDomain }} 7 | {{- $fullname := include "common.names.fullname" . }} 8 | {{- $serviceName := include "common.names.fullname" . }} 9 | {{- $headlessServiceName := printf "%s-headless" (include "common.names.fullname" .) }} 10 | {{- $masterServiceName := printf "%s-master" (include "common.names.fullname" .) }} 11 | {{- $altNames := list (printf "*.%s.%s.svc.%s" $serviceName $releaseNamespace $clusterDomain) (printf "%s.%s.svc.%s" $masterServiceName $releaseNamespace $clusterDomain) (printf "*.%s.%s.svc.%s" $masterServiceName $releaseNamespace $clusterDomain) (printf "*.%s.%s.svc.%s" $headlessServiceName $releaseNamespace $clusterDomain) (printf "%s.%s.svc.%s" $headlessServiceName $releaseNamespace $clusterDomain) "127.0.0.1" "localhost" $fullname }} 12 | {{- $crt := genSignedCert $fullname nil $altNames 365 $ca }} 13 | apiVersion: v1 14 | kind: Secret 15 | metadata: 16 | name: {{ $secretName }} 17 | namespace: {{ .Release.Namespace | quote }} 18 | labels: {{- include "common.labels.standard" . | nindent 4 }} 19 | {{- if .Values.commonLabels }} 20 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} 21 | {{- end }} 22 | {{- if .Values.commonAnnotations }} 23 | annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 24 | {{- end }} 25 | type: kubernetes.io/tls 26 | data: 27 | ca.crt: {{ (get $existingCerts "ca.crt") | default ($ca.Cert | b64enc | quote ) }} 28 | tls.crt: {{ (get $existingCerts "tls.crt") | default ($crt.Cert | b64enc | quote) }} 29 | tls.key: {{ (get $existingCerts "tls.key") | default ($crt.Key | b64enc | quote) }} 30 | {{- end }} 31 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/.kluctl.yml: -------------------------------------------------------------------------------- 1 | discriminator: kluctl-examples-microservices-demo-{{ target.name }} 2 | 3 | targets: 4 | - name: local 5 | context: kind-kind 6 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/deployment.yml: -------------------------------------------------------------------------------- 1 | deployments: 2 | - include: third-party 3 | - include: services 4 | 5 | commonLabels: 6 | examples.kluctl.io/deployment-project: "microservices-demo" 7 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/services/adservice/deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: adservice 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: adservice 9 | template: 10 | metadata: 11 | labels: 12 | app: adservice 13 | spec: 14 | serviceAccountName: default 15 | terminationGracePeriodSeconds: 5 16 | containers: 17 | - name: server 18 | image: gcr.io/google-samples/microservices-demo/adservice:v0.3.6 19 | ports: 20 | - containerPort: 9555 21 | env: 22 | - name: PORT 23 | value: "9555" 24 | - name: DISABLE_STATS 25 | value: "1" 26 | - name: DISABLE_TRACING 27 | value: "1" 28 | # - name: JAEGER_SERVICE_ADDR 29 | # value: "jaeger-collector:14268" 30 | resources: 31 | requests: 32 | cpu: 50m 33 | memory: 180Mi 34 | limits: 35 | cpu: 300m 36 | memory: 300Mi 37 | readinessProbe: 38 | initialDelaySeconds: 20 39 | periodSeconds: 15 40 | exec: 41 | command: ["/bin/grpc_health_probe", "-addr=:9555"] 42 | livenessProbe: 43 | initialDelaySeconds: 20 44 | periodSeconds: 15 45 | exec: 46 | command: ["/bin/grpc_health_probe", "-addr=:9555"] 47 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/services/adservice/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yml 3 | - service.yml 4 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/services/adservice/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: adservice 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: adservice 9 | ports: 10 | - name: grpc 11 | port: 9555 12 | targetPort: 9555 13 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/services/cartservice/deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: cartservice 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: cartservice 9 | template: 10 | metadata: 11 | labels: 12 | app: cartservice 13 | spec: 14 | serviceAccountName: default 15 | terminationGracePeriodSeconds: 5 16 | containers: 17 | - name: server 18 | image: gcr.io/google-samples/microservices-demo/cartservice:v0.3.6 19 | ports: 20 | - containerPort: 7070 21 | env: 22 | - name: REDIS_ADDR 23 | value: "cart-redis:6379" 24 | resources: 25 | requests: 26 | cpu: 50m 27 | memory: 64Mi 28 | limits: 29 | cpu: 300m 30 | memory: 128Mi 31 | readinessProbe: 32 | initialDelaySeconds: 15 33 | exec: 34 | command: ["/bin/grpc_health_probe", "-addr=:7070", "-rpc-timeout=5s"] 35 | livenessProbe: 36 | initialDelaySeconds: 15 37 | periodSeconds: 10 38 | exec: 39 | command: ["/bin/grpc_health_probe", "-addr=:7070", "-rpc-timeout=5s"] 40 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/services/cartservice/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yml 3 | - service.yml 4 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/services/cartservice/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: cartservice 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: cartservice 9 | ports: 10 | - name: grpc 11 | port: 7070 12 | targetPort: 7070 13 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/services/checkoutservice/deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: checkoutservice 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: checkoutservice 9 | template: 10 | metadata: 11 | labels: 12 | app: checkoutservice 13 | spec: 14 | serviceAccountName: default 15 | containers: 16 | - name: server 17 | image: gcr.io/google-samples/microservices-demo/checkoutservice:v0.3.6 18 | ports: 19 | - containerPort: 5050 20 | readinessProbe: 21 | exec: 22 | command: ["/bin/grpc_health_probe", "-addr=:5050"] 23 | livenessProbe: 24 | exec: 25 | command: ["/bin/grpc_health_probe", "-addr=:5050"] 26 | env: 27 | - name: PORT 28 | value: "5050" 29 | - name: PRODUCT_CATALOG_SERVICE_ADDR 30 | value: "productcatalogservice:3550" 31 | - name: SHIPPING_SERVICE_ADDR 32 | value: "shippingservice:50051" 33 | - name: PAYMENT_SERVICE_ADDR 34 | value: "paymentservice:50051" 35 | - name: EMAIL_SERVICE_ADDR 36 | value: "emailservice:5000" 37 | - name: CURRENCY_SERVICE_ADDR 38 | value: "currencyservice:7000" 39 | - name: CART_SERVICE_ADDR 40 | value: "cartservice:7070" 41 | - name: DISABLE_STATS 42 | value: "1" 43 | - name: DISABLE_TRACING 44 | value: "1" 45 | - name: DISABLE_PROFILER 46 | value: "1" 47 | # - name: JAEGER_SERVICE_ADDR 48 | # value: "jaeger-collector:14268" 49 | resources: 50 | requests: 51 | cpu: 50m 52 | memory: 64Mi 53 | limits: 54 | cpu: 200m 55 | memory: 128Mi 56 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/services/checkoutservice/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yml 3 | - service.yml 4 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/services/checkoutservice/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: checkoutservice 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: checkoutservice 9 | ports: 10 | - name: grpc 11 | port: 5050 12 | targetPort: 5050 13 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/services/currencyservice/deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: currencyservice 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: currencyservice 9 | template: 10 | metadata: 11 | labels: 12 | app: currencyservice 13 | spec: 14 | serviceAccountName: default 15 | terminationGracePeriodSeconds: 5 16 | containers: 17 | - name: server 18 | image: gcr.io/google-samples/microservices-demo/currencyservice:v0.3.6 19 | ports: 20 | - name: grpc 21 | containerPort: 7000 22 | env: 23 | - name: PORT 24 | value: "7000" 25 | - name: DISABLE_TRACING 26 | value: "1" 27 | - name: DISABLE_PROFILER 28 | value: "1" 29 | - name: DISABLE_DEBUGGER 30 | value: "1" 31 | readinessProbe: 32 | exec: 33 | command: ["/bin/grpc_health_probe", "-addr=:7000"] 34 | livenessProbe: 35 | exec: 36 | command: ["/bin/grpc_health_probe", "-addr=:7000"] 37 | resources: 38 | requests: 39 | cpu: 50m 40 | memory: 64Mi 41 | limits: 42 | cpu: 200m 43 | memory: 128Mi 44 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/services/currencyservice/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yml 3 | - service.yml 4 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/services/currencyservice/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: currencyservice 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: currencyservice 9 | ports: 10 | - name: grpc 11 | port: 7000 12 | targetPort: 7000 13 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/services/deployment.yml: -------------------------------------------------------------------------------- 1 | deployments: 2 | - path: adservice 3 | - path: cartservice 4 | - path: checkoutservice 5 | - path: currencyservice 6 | - path: emailservice 7 | - path: frontend 8 | - path: loadgenerator 9 | - path: paymentservice 10 | - path: productcatalogservice 11 | - path: recommendationservice 12 | - path: shippingservice 13 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/services/emailservice/deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: emailservice 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: emailservice 9 | template: 10 | metadata: 11 | labels: 12 | app: emailservice 13 | spec: 14 | serviceAccountName: default 15 | terminationGracePeriodSeconds: 5 16 | containers: 17 | - name: server 18 | image: gcr.io/google-samples/microservices-demo/emailservice:v0.3.6 19 | ports: 20 | - containerPort: 8080 21 | env: 22 | - name: PORT 23 | value: "8080" 24 | - name: DISABLE_TRACING 25 | value: "1" 26 | - name: DISABLE_PROFILER 27 | value: "1" 28 | readinessProbe: 29 | periodSeconds: 5 30 | exec: 31 | command: ["/bin/grpc_health_probe", "-addr=:8080"] 32 | livenessProbe: 33 | periodSeconds: 5 34 | exec: 35 | command: ["/bin/grpc_health_probe", "-addr=:8080"] 36 | resources: 37 | requests: 38 | cpu: 50m 39 | memory: 64Mi 40 | limits: 41 | cpu: 200m 42 | memory: 128Mi 43 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/services/emailservice/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yml 3 | - service.yml 4 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/services/emailservice/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: emailservice 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: emailservice 9 | ports: 10 | - name: grpc 11 | port: 5000 12 | targetPort: 8080 13 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/services/frontend/deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: frontend 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: frontend 9 | template: 10 | metadata: 11 | labels: 12 | app: frontend 13 | annotations: 14 | sidecar.istio.io/rewriteAppHTTPProbers: "true" 15 | spec: 16 | serviceAccountName: default 17 | containers: 18 | - name: server 19 | image: gcr.io/google-samples/microservices-demo/frontend:v0.3.6 20 | ports: 21 | - containerPort: 8080 22 | readinessProbe: 23 | initialDelaySeconds: 10 24 | httpGet: 25 | path: "/_healthz" 26 | port: 8080 27 | httpHeaders: 28 | - name: "Cookie" 29 | value: "shop_session-id=x-readiness-probe" 30 | livenessProbe: 31 | initialDelaySeconds: 10 32 | httpGet: 33 | path: "/_healthz" 34 | port: 8080 35 | httpHeaders: 36 | - name: "Cookie" 37 | value: "shop_session-id=x-liveness-probe" 38 | env: 39 | - name: PORT 40 | value: "8080" 41 | - name: PRODUCT_CATALOG_SERVICE_ADDR 42 | value: "productcatalogservice:3550" 43 | - name: CURRENCY_SERVICE_ADDR 44 | value: "currencyservice:7000" 45 | - name: CART_SERVICE_ADDR 46 | value: "cartservice:7070" 47 | - name: RECOMMENDATION_SERVICE_ADDR 48 | value: "recommendationservice:8080" 49 | - name: SHIPPING_SERVICE_ADDR 50 | value: "shippingservice:50051" 51 | - name: CHECKOUT_SERVICE_ADDR 52 | value: "checkoutservice:5050" 53 | - name: AD_SERVICE_ADDR 54 | value: "adservice:9555" 55 | # # ENV_PLATFORM: One of: local, gcp, aws, azure, onprem, alibaba 56 | # # When not set, defaults to "local" unless running in GKE, otherwies auto-sets to gcp 57 | # - name: ENV_PLATFORM 58 | # value: "aws" 59 | - name: DISABLE_TRACING 60 | value: "1" 61 | - name: DISABLE_PROFILER 62 | value: "1" 63 | # - name: JAEGER_SERVICE_ADDR 64 | # value: "jaeger-collector:14268" 65 | # - name: CYMBAL_BRANDING 66 | # value: "true" 67 | resources: 68 | requests: 69 | cpu: 50m 70 | memory: 64Mi 71 | limits: 72 | cpu: 200m 73 | memory: 128Mi 74 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/services/frontend/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yml 3 | - service.yml 4 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/services/frontend/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: frontend 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: frontend 9 | ports: 10 | - name: http 11 | port: 80 12 | targetPort: 8080 13 | --- 14 | apiVersion: v1 15 | kind: Service 16 | metadata: 17 | name: frontend-external 18 | spec: 19 | type: LoadBalancer 20 | selector: 21 | app: frontend 22 | ports: 23 | - name: http 24 | port: 80 25 | targetPort: 8080 26 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/services/loadgenerator/deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: loadgenerator 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: loadgenerator 9 | replicas: 1 10 | template: 11 | metadata: 12 | labels: 13 | app: loadgenerator 14 | annotations: 15 | sidecar.istio.io/rewriteAppHTTPProbers: "true" 16 | spec: 17 | serviceAccountName: default 18 | terminationGracePeriodSeconds: 5 19 | restartPolicy: Always 20 | initContainers: 21 | - command: 22 | - /bin/sh 23 | - -exc 24 | - | 25 | echo "Init container pinging frontend: ${FRONTEND_ADDR}..." 26 | STATUSCODE=$(wget --server-response http://${FRONTEND_ADDR} 2>&1 | awk '/^ HTTP/{print $2}') 27 | if test $STATUSCODE -ne 200; then 28 | echo "Error: Could not reach frontend - Status code: ${STATUSCODE}" 29 | exit 1 30 | fi 31 | name: frontend-check 32 | image: busybox:latest 33 | env: 34 | - name: FRONTEND_ADDR 35 | value: "frontend:80" 36 | containers: 37 | - name: main 38 | image: gcr.io/google-samples/microservices-demo/loadgenerator:v0.3.6 39 | env: 40 | - name: FRONTEND_ADDR 41 | value: "frontend:80" 42 | - name: USERS 43 | value: "10" 44 | resources: 45 | requests: 46 | cpu: 50m 47 | memory: 256Mi 48 | limits: 49 | cpu: 500m 50 | memory: 512Mi 51 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/services/loadgenerator/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yml 3 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/services/paymentservice/deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: paymentservice 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: paymentservice 9 | template: 10 | metadata: 11 | labels: 12 | app: paymentservice 13 | spec: 14 | serviceAccountName: default 15 | terminationGracePeriodSeconds: 5 16 | containers: 17 | - name: server 18 | image: gcr.io/google-samples/microservices-demo/paymentservice:v0.3.6 19 | ports: 20 | - containerPort: 50051 21 | env: 22 | - name: PORT 23 | value: "50051" 24 | - name: DISABLE_TRACING 25 | value: "1" 26 | - name: DISABLE_PROFILER 27 | value: "1" 28 | - name: DISABLE_DEBUGGER 29 | value: "1" 30 | readinessProbe: 31 | exec: 32 | command: ["/bin/grpc_health_probe", "-addr=:50051"] 33 | livenessProbe: 34 | exec: 35 | command: ["/bin/grpc_health_probe", "-addr=:50051"] 36 | resources: 37 | requests: 38 | cpu: 50m 39 | memory: 64Mi 40 | limits: 41 | cpu: 200m 42 | memory: 128Mi 43 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/services/paymentservice/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yml 3 | - service.yml 4 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/services/paymentservice/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: paymentservice 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: paymentservice 9 | ports: 10 | - name: grpc 11 | port: 50051 12 | targetPort: 50051 13 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/services/productcatalogservice/deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: productcatalogservice 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: productcatalogservice 9 | template: 10 | metadata: 11 | labels: 12 | app: productcatalogservice 13 | spec: 14 | serviceAccountName: default 15 | terminationGracePeriodSeconds: 5 16 | containers: 17 | - name: server 18 | image: gcr.io/google-samples/microservices-demo/productcatalogservice:v0.3.6 19 | ports: 20 | - containerPort: 3550 21 | env: 22 | - name: PORT 23 | value: "3550" 24 | - name: DISABLE_STATS 25 | value: "1" 26 | - name: DISABLE_TRACING 27 | value: "1" 28 | - name: DISABLE_PROFILER 29 | value: "1" 30 | # - name: JAEGER_SERVICE_ADDR 31 | # value: "jaeger-collector:14268" 32 | readinessProbe: 33 | exec: 34 | command: ["/bin/grpc_health_probe", "-addr=:3550"] 35 | livenessProbe: 36 | exec: 37 | command: ["/bin/grpc_health_probe", "-addr=:3550"] 38 | resources: 39 | requests: 40 | cpu: 50m 41 | memory: 64Mi 42 | limits: 43 | cpu: 200m 44 | memory: 128Mi 45 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/services/productcatalogservice/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yml 3 | - service.yml 4 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/services/productcatalogservice/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: productcatalogservice 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: productcatalogservice 9 | ports: 10 | - name: grpc 11 | port: 3550 12 | targetPort: 3550 13 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/services/recommendationservice/deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: recommendationservice 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: recommendationservice 9 | template: 10 | metadata: 11 | labels: 12 | app: recommendationservice 13 | spec: 14 | serviceAccountName: default 15 | terminationGracePeriodSeconds: 5 16 | containers: 17 | - name: server 18 | image: gcr.io/google-samples/microservices-demo/recommendationservice:v0.3.6 19 | ports: 20 | - containerPort: 8080 21 | readinessProbe: 22 | periodSeconds: 5 23 | exec: 24 | command: ["/bin/grpc_health_probe", "-addr=:8080"] 25 | livenessProbe: 26 | periodSeconds: 5 27 | exec: 28 | command: ["/bin/grpc_health_probe", "-addr=:8080"] 29 | env: 30 | - name: PORT 31 | value: "8080" 32 | - name: PRODUCT_CATALOG_SERVICE_ADDR 33 | value: "productcatalogservice:3550" 34 | - name: DISABLE_TRACING 35 | value: "1" 36 | - name: DISABLE_PROFILER 37 | value: "1" 38 | - name: DISABLE_DEBUGGER 39 | value: "1" 40 | resources: 41 | requests: 42 | cpu: 50m 43 | memory: 220Mi 44 | limits: 45 | cpu: 200m 46 | memory: 450Mi 47 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/services/recommendationservice/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yml 3 | - service.yml 4 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/services/recommendationservice/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: recommendationservice 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: recommendationservice 9 | ports: 10 | - name: grpc 11 | port: 8080 12 | targetPort: 8080 13 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/services/shippingservice/deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: shippingservice 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: shippingservice 9 | template: 10 | metadata: 11 | labels: 12 | app: shippingservice 13 | spec: 14 | serviceAccountName: default 15 | containers: 16 | - name: server 17 | image: gcr.io/google-samples/microservices-demo/shippingservice:v0.3.6 18 | ports: 19 | - containerPort: 50051 20 | env: 21 | - name: PORT 22 | value: "50051" 23 | - name: DISABLE_STATS 24 | value: "1" 25 | - name: DISABLE_TRACING 26 | value: "1" 27 | - name: DISABLE_PROFILER 28 | value: "1" 29 | # - name: JAEGER_SERVICE_ADDR 30 | # value: "jaeger-collector:14268" 31 | readinessProbe: 32 | periodSeconds: 5 33 | exec: 34 | command: ["/bin/grpc_health_probe", "-addr=:50051"] 35 | livenessProbe: 36 | exec: 37 | command: ["/bin/grpc_health_probe", "-addr=:50051"] 38 | resources: 39 | requests: 40 | cpu: 50m 41 | memory: 64Mi 42 | limits: 43 | cpu: 200m 44 | memory: 128Mi 45 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/services/shippingservice/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yml 3 | - service.yml 4 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/services/shippingservice/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: shippingservice 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: shippingservice 9 | ports: 10 | - name: grpc 11 | port: 50051 12 | targetPort: 50051 13 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/third-party/deployment.yml: -------------------------------------------------------------------------------- 1 | deployments: 2 | - path: redis 3 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/third-party/redis/helm-chart.yml: -------------------------------------------------------------------------------- 1 | helmChart: 2 | repo: https://charts.bitnami.com/bitnami 3 | chartName: redis 4 | chartVersion: 17.4.0 5 | releaseName: cart 6 | namespace: default 7 | output: deploy.yml 8 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/third-party/redis/helm-values.yml: -------------------------------------------------------------------------------- 1 | architecture: replication 2 | 3 | auth: 4 | enabled: false 5 | 6 | sentinel: 7 | enabled: true 8 | quorum: 2 9 | 10 | replica: 11 | replicaCount: 3 12 | persistence: 13 | enabled: true 14 | 15 | master: 16 | persistence: 17 | enabled: true 18 | -------------------------------------------------------------------------------- /microservices-demo/2-helm-integration/third-party/redis/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deploy.yml 3 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/Chart.lock: -------------------------------------------------------------------------------- 1 | dependencies: 2 | - name: common 3 | repository: https://charts.bitnami.com/bitnami 4 | version: 2.2.2 5 | digest: sha256:49ca75cf23ba5eb7df4becef52580f98c8bd8194eb80368b9d7b875f6eefa8e5 6 | generated: "2022-12-12T19:34:26.826289322Z" 7 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/Chart.yaml: -------------------------------------------------------------------------------- 1 | annotations: 2 | category: Database 3 | apiVersion: v2 4 | appVersion: 7.0.7 5 | dependencies: 6 | - name: common 7 | repository: https://charts.bitnami.com/bitnami 8 | tags: 9 | - bitnami-common 10 | version: 2.x.x 11 | description: Redis(R) is an open source, advanced key-value store. It is often referred 12 | to as a data structure server since keys can contain strings, hashes, lists, sets 13 | and sorted sets. 14 | home: https://github.com/bitnami/charts/tree/main/bitnami/redis 15 | icon: https://bitnami.com/assets/stacks/redis/img/redis-stack-220x234.png 16 | keywords: 17 | - redis 18 | - keyvalue 19 | - database 20 | maintainers: 21 | - name: Bitnami 22 | url: https://github.com/bitnami/charts 23 | name: redis 24 | sources: 25 | - https://github.com/bitnami/containers/tree/main/bitnami/redis 26 | version: 17.4.0 27 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/charts/common/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | .vscode/ 23 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/charts/common/Chart.yaml: -------------------------------------------------------------------------------- 1 | annotations: 2 | category: Infrastructure 3 | apiVersion: v2 4 | appVersion: 2.2.2 5 | description: A Library Helm Chart for grouping common logic between bitnami charts. 6 | This chart is not deployable by itself. 7 | home: https://github.com/bitnami/charts/tree/main/bitnami/common 8 | icon: https://bitnami.com/downloads/logos/bitnami-mark.png 9 | keywords: 10 | - common 11 | - helper 12 | - template 13 | - function 14 | - bitnami 15 | maintainers: 16 | - name: Bitnami 17 | url: https://github.com/bitnami/charts 18 | name: common 19 | sources: 20 | - https://github.com/bitnami/charts 21 | - https://www.bitnami.com/ 22 | type: library 23 | version: 2.2.2 24 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/charts/common/templates/_errors.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Through error when upgrading using empty passwords values that must not be empty. 4 | 5 | Usage: 6 | {{- $validationError00 := include "common.validations.values.single.empty" (dict "valueKey" "path.to.password00" "secret" "secretName" "field" "password-00") -}} 7 | {{- $validationError01 := include "common.validations.values.single.empty" (dict "valueKey" "path.to.password01" "secret" "secretName" "field" "password-01") -}} 8 | {{ include "common.errors.upgrade.passwords.empty" (dict "validationErrors" (list $validationError00 $validationError01) "context" $) }} 9 | 10 | Required password params: 11 | - validationErrors - String - Required. List of validation strings to be return, if it is empty it won't throw error. 12 | - context - Context - Required. Parent context. 13 | */}} 14 | {{- define "common.errors.upgrade.passwords.empty" -}} 15 | {{- $validationErrors := join "" .validationErrors -}} 16 | {{- if and $validationErrors .context.Release.IsUpgrade -}} 17 | {{- $errorString := "\nPASSWORDS ERROR: You must provide your current passwords when upgrading the release." -}} 18 | {{- $errorString = print $errorString "\n Note that even after reinstallation, old credentials may be needed as they may be kept in persistent volume claims." -}} 19 | {{- $errorString = print $errorString "\n Further information can be obtained at https://docs.bitnami.com/general/how-to/troubleshoot-helm-chart-issues/#credential-errors-while-upgrading-chart-releases" -}} 20 | {{- $errorString = print $errorString "\n%s" -}} 21 | {{- printf $errorString $validationErrors | fail -}} 22 | {{- end -}} 23 | {{- end -}} 24 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/charts/common/templates/_labels.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Kubernetes standard labels 4 | */}} 5 | {{- define "common.labels.standard" -}} 6 | app.kubernetes.io/name: {{ include "common.names.name" . }} 7 | helm.sh/chart: {{ include "common.names.chart" . }} 8 | app.kubernetes.io/instance: {{ .Release.Name }} 9 | app.kubernetes.io/managed-by: {{ .Release.Service }} 10 | {{- end -}} 11 | 12 | {{/* 13 | Labels to use on deploy.spec.selector.matchLabels and svc.spec.selector 14 | */}} 15 | {{- define "common.labels.matchLabels" -}} 16 | app.kubernetes.io/name: {{ include "common.names.name" . }} 17 | app.kubernetes.io/instance: {{ .Release.Name }} 18 | {{- end -}} 19 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/charts/common/templates/_storage.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Return the proper Storage Class 4 | {{ include "common.storage.class" ( dict "persistence" .Values.path.to.the.persistence "global" $) }} 5 | */}} 6 | {{- define "common.storage.class" -}} 7 | 8 | {{- $storageClass := .persistence.storageClass -}} 9 | {{- if .global -}} 10 | {{- if .global.storageClass -}} 11 | {{- $storageClass = .global.storageClass -}} 12 | {{- end -}} 13 | {{- end -}} 14 | 15 | {{- if $storageClass -}} 16 | {{- if (eq "-" $storageClass) -}} 17 | {{- printf "storageClassName: \"\"" -}} 18 | {{- else }} 19 | {{- printf "storageClassName: %s" $storageClass -}} 20 | {{- end -}} 21 | {{- end -}} 22 | 23 | {{- end -}} 24 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/charts/common/templates/_tplvalues.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Renders a value that contains template. 4 | Usage: 5 | {{ include "common.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $) }} 6 | */}} 7 | {{- define "common.tplvalues.render" -}} 8 | {{- if typeIs "string" .value }} 9 | {{- tpl .value .context }} 10 | {{- else }} 11 | {{- tpl (.value | toYaml) .context }} 12 | {{- end }} 13 | {{- end -}} 14 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/charts/common/templates/_utils.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Print instructions to get a secret value. 4 | Usage: 5 | {{ include "common.utils.secret.getvalue" (dict "secret" "secret-name" "field" "secret-value-field" "context" $) }} 6 | */}} 7 | {{- define "common.utils.secret.getvalue" -}} 8 | {{- $varname := include "common.utils.fieldToEnvVar" . -}} 9 | export {{ $varname }}=$(kubectl get secret --namespace {{ include "common.names.namespace" .context | quote }} {{ .secret }} -o jsonpath="{.data.{{ .field }}}" | base64 -d) 10 | {{- end -}} 11 | 12 | {{/* 13 | Build env var name given a field 14 | Usage: 15 | {{ include "common.utils.fieldToEnvVar" dict "field" "my-password" }} 16 | */}} 17 | {{- define "common.utils.fieldToEnvVar" -}} 18 | {{- $fieldNameSplit := splitList "-" .field -}} 19 | {{- $upperCaseFieldNameSplit := list -}} 20 | 21 | {{- range $fieldNameSplit -}} 22 | {{- $upperCaseFieldNameSplit = append $upperCaseFieldNameSplit ( upper . ) -}} 23 | {{- end -}} 24 | 25 | {{ join "_" $upperCaseFieldNameSplit }} 26 | {{- end -}} 27 | 28 | {{/* 29 | Gets a value from .Values given 30 | Usage: 31 | {{ include "common.utils.getValueFromKey" (dict "key" "path.to.key" "context" $) }} 32 | */}} 33 | {{- define "common.utils.getValueFromKey" -}} 34 | {{- $splitKey := splitList "." .key -}} 35 | {{- $value := "" -}} 36 | {{- $latestObj := $.context.Values -}} 37 | {{- range $splitKey -}} 38 | {{- if not $latestObj -}} 39 | {{- printf "please review the entire path of '%s' exists in values" $.key | fail -}} 40 | {{- end -}} 41 | {{- $value = ( index $latestObj . ) -}} 42 | {{- $latestObj = $value -}} 43 | {{- end -}} 44 | {{- printf "%v" (default "" $value) -}} 45 | {{- end -}} 46 | 47 | {{/* 48 | Returns first .Values key with a defined value or first of the list if all non-defined 49 | Usage: 50 | {{ include "common.utils.getKeyFromList" (dict "keys" (list "path.to.key1" "path.to.key2") "context" $) }} 51 | */}} 52 | {{- define "common.utils.getKeyFromList" -}} 53 | {{- $key := first .keys -}} 54 | {{- $reverseKeys := reverse .keys }} 55 | {{- range $reverseKeys }} 56 | {{- $value := include "common.utils.getValueFromKey" (dict "key" . "context" $.context ) }} 57 | {{- if $value -}} 58 | {{- $key = . }} 59 | {{- end -}} 60 | {{- end -}} 61 | {{- printf "%s" $key -}} 62 | {{- end -}} 63 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/charts/common/templates/_warnings.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Warning about using rolling tag. 4 | Usage: 5 | {{ include "common.warnings.rollingTag" .Values.path.to.the.imageRoot }} 6 | */}} 7 | {{- define "common.warnings.rollingTag" -}} 8 | 9 | {{- if and (contains "bitnami/" .repository) (not (.tag | toString | regexFind "-r\\d+$|sha256:")) }} 10 | WARNING: Rolling tag detected ({{ .repository }}:{{ .tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment. 11 | +info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/ 12 | {{- end }} 13 | 14 | {{- end -}} 15 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/charts/common/values.yaml: -------------------------------------------------------------------------------- 1 | ## bitnami/common 2 | ## It is required by CI/CD tools and processes. 3 | ## @skip exampleValue 4 | ## 5 | exampleValue: common-chart 6 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/img/redis-cluster-topology.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kluctl/kluctl-examples/8dcccb8453e89e895916f98af5b0ca89ca458cc6/microservices-demo/3-templating-and-multi-env/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/img/redis-cluster-topology.png -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/img/redis-topology.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kluctl/kluctl-examples/8dcccb8453e89e895916f98af5b0ca89ca458cc6/microservices-demo/3-templating-and-multi-env/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/img/redis-topology.png -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/templates/extra-list.yaml: -------------------------------------------------------------------------------- 1 | {{- range .Values.extraDeploy }} 2 | --- 3 | {{ include "common.tplvalues.render" (dict "value" . "context" $) }} 4 | {{- end }} 5 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/templates/headless-svc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ printf "%s-headless" (include "common.names.fullname" .) }} 5 | namespace: {{ .Release.Namespace | quote }} 6 | labels: {{- include "common.labels.standard" . | nindent 4 }} 7 | {{- if .Values.commonLabels }} 8 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} 9 | {{- end }} 10 | annotations: 11 | {{- if .Values.commonAnnotations }} 12 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 13 | {{- end }} 14 | {{- include "redis.externalDNS.annotations" . | nindent 4 }} 15 | spec: 16 | type: ClusterIP 17 | clusterIP: None 18 | {{- if .Values.sentinel.enabled }} 19 | publishNotReadyAddresses: true 20 | {{- end }} 21 | ports: 22 | - name: tcp-redis 23 | port: {{ if .Values.sentinel.enabled }}{{ .Values.sentinel.service.ports.redis }}{{ else }}{{ .Values.master.service.ports.redis }}{{ end }} 24 | targetPort: redis 25 | {{- if .Values.sentinel.enabled }} 26 | - name: tcp-sentinel 27 | port: {{ .Values.sentinel.service.ports.sentinel }} 28 | targetPort: redis-sentinel 29 | {{- end }} 30 | selector: {{- include "common.labels.matchLabels" . | nindent 4 }} 31 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/templates/master/psp.yaml: -------------------------------------------------------------------------------- 1 | {{- $pspAvailable := (semverCompare "<1.25-0" (include "common.capabilities.kubeVersion" .)) -}} 2 | {{- if and $pspAvailable .Values.podSecurityPolicy.create }} 3 | apiVersion: policy/v1beta1 4 | kind: PodSecurityPolicy 5 | metadata: 6 | name: {{ printf "%s-master" (include "common.names.fullname" .) }} 7 | namespace: {{ .Release.Namespace | quote }} 8 | labels: {{- include "common.labels.standard" . | nindent 4 }} 9 | {{- if .Values.commonLabels }} 10 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} 11 | {{- end }} 12 | {{- if .Values.commonAnnotations }} 13 | annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 14 | {{- end }} 15 | spec: 16 | allowPrivilegeEscalation: false 17 | fsGroup: 18 | rule: 'MustRunAs' 19 | ranges: 20 | - min: {{ .Values.master.podSecurityContext.fsGroup }} 21 | max: {{ .Values.master.podSecurityContext.fsGroup }} 22 | hostIPC: false 23 | hostNetwork: false 24 | hostPID: false 25 | privileged: false 26 | readOnlyRootFilesystem: false 27 | requiredDropCapabilities: 28 | - ALL 29 | runAsUser: 30 | rule: 'MustRunAs' 31 | ranges: 32 | - min: {{ .Values.master.containerSecurityContext.runAsUser }} 33 | max: {{ .Values.master.containerSecurityContext.runAsUser }} 34 | seLinux: 35 | rule: 'RunAsAny' 36 | supplementalGroups: 37 | rule: 'MustRunAs' 38 | ranges: 39 | - min: {{ .Values.master.containerSecurityContext.runAsUser }} 40 | max: {{ .Values.master.containerSecurityContext.runAsUser }} 41 | volumes: 42 | - 'configMap' 43 | - 'secret' 44 | - 'emptyDir' 45 | - 'persistentVolumeClaim' 46 | {{- end }} 47 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/templates/master/pvc.yaml: -------------------------------------------------------------------------------- 1 | {{- if and (eq .Values.architecture "standalone") (eq .Values.master.kind "Deployment") (.Values.master.persistence.enabled) (not .Values.master.persistence.existingClaim) }} 2 | kind: PersistentVolumeClaim 3 | apiVersion: v1 4 | metadata: 5 | name: {{ printf "redis-data-%s-master" (include "common.names.fullname" .) }} 6 | namespace: {{ .Release.Namespace | quote }} 7 | labels: {{- include "common.labels.matchLabels" . | nindent 4 }} 8 | app.kubernetes.io/component: master 9 | {{- if .Values.master.persistence.annotations }} 10 | annotations: {{- toYaml .Values.master.persistence.annotations | nindent 4 }} 11 | {{- end }} 12 | spec: 13 | accessModes: 14 | {{- range .Values.master.persistence.accessModes }} 15 | - {{ . | quote }} 16 | {{- end }} 17 | resources: 18 | requests: 19 | storage: {{ .Values.master.persistence.size | quote }} 20 | {{- if .Values.master.persistence.selector }} 21 | selector: {{- include "common.tplvalues.render" (dict "value" .Values.master.persistence.selector "context" $) | nindent 4 }} 22 | {{- end }} 23 | {{- if .Values.master.persistence.dataSource }} 24 | dataSource: {{- include "common.tplvalues.render" (dict "value" .Values.master.persistence.dataSource "context" $) | nindent 4 }} 25 | {{- end }} 26 | {{- include "common.storage.class" (dict "persistence" .Values.master.persistence "global" .Values.global) | nindent 2 }} 27 | {{- end }} 28 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/templates/master/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.master.serviceAccount.create }} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | automountServiceAccountToken: {{ .Values.master.serviceAccount.automountServiceAccountToken }} 5 | metadata: 6 | name: {{ template "redis.masterServiceAccountName" . }} 7 | namespace: {{ .Release.Namespace | quote }} 8 | labels: {{- include "common.labels.standard" . | nindent 4 }} 9 | {{- if .Values.commonLabels }} 10 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} 11 | {{- end }} 12 | {{- if or .Values.commonAnnotations .Values.master.serviceAccount.annotations }} 13 | annotations: 14 | {{- if or .Values.commonAnnotations }} 15 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 16 | {{- end }} 17 | {{- if .Values.master.serviceAccount.annotations }} 18 | {{- include "common.tplvalues.render" ( dict "value" .Values.master.serviceAccount.annotations "context" $ ) | nindent 4 }} 19 | {{- end }} 20 | {{- end }} 21 | {{- end }} 22 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/templates/metrics-svc.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.metrics.enabled }} 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: {{ printf "%s-metrics" (include "common.names.fullname" .) }} 6 | namespace: {{ .Release.Namespace | quote }} 7 | labels: {{- include "common.labels.standard" . | nindent 4 }} 8 | app.kubernetes.io/component: metrics 9 | {{- if .Values.commonLabels }} 10 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} 11 | {{- end }} 12 | {{- if or .Values.metrics.service.annotations .Values.commonAnnotations }} 13 | annotations: 14 | {{- if .Values.metrics.service.annotations }} 15 | {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.service.annotations "context" $ ) | nindent 4 }} 16 | {{- end }} 17 | {{- if .Values.commonAnnotations }} 18 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 19 | {{- end }} 20 | {{- end }} 21 | spec: 22 | type: {{ .Values.metrics.service.type }} 23 | {{- if eq .Values.metrics.service.type "LoadBalancer" }} 24 | externalTrafficPolicy: {{ .Values.metrics.service.externalTrafficPolicy }} 25 | {{- end }} 26 | {{- if and (eq .Values.metrics.service.type "LoadBalancer") .Values.metrics.service.loadBalancerIP }} 27 | loadBalancerIP: {{ .Values.metrics.service.loadBalancerIP }} 28 | {{- end }} 29 | {{- if and (eq .Values.metrics.service.type "LoadBalancer") .Values.metrics.service.loadBalancerSourceRanges }} 30 | loadBalancerSourceRanges: {{- toYaml .Values.metrics.service.loadBalancerSourceRanges | nindent 4 }} 31 | {{- end }} 32 | ports: 33 | - name: http-metrics 34 | port: {{ .Values.metrics.service.port }} 35 | protocol: TCP 36 | targetPort: metrics 37 | {{- if .Values.metrics.service.extraPorts }} 38 | {{- include "common.tplvalues.render" (dict "value" .Values.metrics.service.extraPorts "context" $) | nindent 4 }} 39 | {{- end }} 40 | selector: {{- include "common.labels.matchLabels" . | nindent 4 }} 41 | {{- end }} 42 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/templates/pdb.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.pdb.create }} 2 | apiVersion: {{ include "common.capabilities.policy.apiVersion" . }} 3 | kind: PodDisruptionBudget 4 | metadata: 5 | name: {{ template "common.names.fullname" . }} 6 | namespace: {{ .Release.Namespace | quote }} 7 | labels: {{- include "common.labels.standard" . | nindent 4 }} 8 | {{- if .Values.commonLabels }} 9 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} 10 | {{- end }} 11 | {{- if .Values.commonAnnotations }} 12 | annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 13 | {{- end }} 14 | spec: 15 | {{- if .Values.pdb.minAvailable }} 16 | minAvailable: {{ .Values.pdb.minAvailable }} 17 | {{- end }} 18 | {{- if .Values.pdb.maxUnavailable }} 19 | maxUnavailable: {{ .Values.pdb.maxUnavailable }} 20 | {{- end }} 21 | selector: 22 | matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} 23 | {{- end }} 24 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/templates/prometheusrule.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.metrics.enabled .Values.metrics.prometheusRule.enabled }} 2 | apiVersion: monitoring.coreos.com/v1 3 | kind: PrometheusRule 4 | metadata: 5 | name: {{ template "common.names.fullname" . }} 6 | namespace: {{ default .Release.Namespace .Values.metrics.prometheusRule.namespace | quote }} 7 | labels: {{- include "common.labels.standard" . | nindent 4 }} 8 | {{- if .Values.metrics.prometheusRule.additionalLabels }} 9 | {{- include "common.tplvalues.render" (dict "value" .Values.metrics.prometheusRule.additionalLabels "context" $) | nindent 4 }} 10 | {{- end }} 11 | {{- if .Values.commonLabels }} 12 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} 13 | {{- end }} 14 | {{- if .Values.commonAnnotations }} 15 | annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 16 | {{- end }} 17 | spec: 18 | groups: 19 | - name: {{ include "common.names.fullname" . }} 20 | rules: {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.prometheusRule.rules "context" $ ) | nindent 8 }} 21 | {{- end }} 22 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/templates/replicas/hpa.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.replica.autoscaling.enabled (not .Values.sentinel.enabled) }} 2 | apiVersion: {{ include "common.capabilities.hpa.apiVersion" ( dict "context" $ ) }} 3 | kind: HorizontalPodAutoscaler 4 | metadata: 5 | name: {{ printf "%s-replicas" (include "common.names.fullname" .) }} 6 | namespace: {{ .Release.Namespace | quote }} 7 | labels: {{- include "common.labels.standard" . | nindent 4 }} 8 | app.kubernetes.io/component: replica 9 | {{- if .Values.commonLabels }} 10 | {{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }} 11 | {{- end }} 12 | {{- if .Values.commonAnnotations }} 13 | annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 14 | {{- end }} 15 | spec: 16 | scaleTargetRef: 17 | apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }} 18 | kind: StatefulSet 19 | name: {{ printf "%s-replicas" (include "common.names.fullname" .) }} 20 | minReplicas: {{ .Values.replica.autoscaling.minReplicas }} 21 | maxReplicas: {{ .Values.replica.autoscaling.maxReplicas }} 22 | metrics: 23 | {{- if .Values.replica.autoscaling.targetMemory }} 24 | - type: Resource 25 | resource: 26 | name: memory 27 | {{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }} 28 | targetAverageUtilization: {{ .Values.replica.autoscaling.targetMemory }} 29 | {{- else }} 30 | target: 31 | type: Utilization 32 | averageUtilization: {{ .Values.replica.autoscaling.targetMemory }} 33 | {{- end }} 34 | {{- end }} 35 | {{- if .Values.replica.autoscaling.targetCPU }} 36 | - type: Resource 37 | resource: 38 | name: cpu 39 | {{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }} 40 | targetAverageUtilization: {{ .Values.replica.autoscaling.targetCPU }} 41 | {{- else }} 42 | target: 43 | type: Utilization 44 | averageUtilization: {{ .Values.replica.autoscaling.targetCPU }} 45 | {{- end }} 46 | {{- end }} 47 | {{- end }} 48 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/templates/replicas/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.replica.serviceAccount.create }} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | automountServiceAccountToken: {{ .Values.replica.serviceAccount.automountServiceAccountToken }} 5 | metadata: 6 | name: {{ template "redis.replicaServiceAccountName" . }} 7 | namespace: {{ .Release.Namespace | quote }} 8 | labels: {{- include "common.labels.standard" . | nindent 4 }} 9 | {{- if .Values.commonLabels }} 10 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} 11 | {{- end }} 12 | {{- if or .Values.commonAnnotations .Values.replica.serviceAccount.annotations }} 13 | annotations: 14 | {{- if or .Values.commonAnnotations }} 15 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 16 | {{- end }} 17 | {{- if .Values.replica.serviceAccount.annotations }} 18 | {{- include "common.tplvalues.render" ( dict "value" .Values.replica.serviceAccount.annotations "context" $ ) | nindent 4 }} 19 | {{- end }} 20 | {{- end }} 21 | {{- end }} 22 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/templates/role.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.rbac.create }} 2 | apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }} 3 | kind: Role 4 | metadata: 5 | name: {{ template "common.names.fullname" . }} 6 | namespace: {{ .Release.Namespace | quote }} 7 | labels: {{- include "common.labels.standard" . | nindent 4 }} 8 | {{- if .Values.commonLabels }} 9 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} 10 | {{- end }} 11 | {{- if .Values.commonAnnotations }} 12 | annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 13 | {{- end }} 14 | rules: 15 | {{- $pspAvailable := (semverCompare "<1.25-0" (include "common.capabilities.kubeVersion" .)) -}} 16 | {{- if and $pspAvailable .Values.podSecurityPolicy.enabled }} 17 | - apiGroups: 18 | - '{{ template "podSecurityPolicy.apiGroup" . }}' 19 | resources: 20 | - 'podsecuritypolicies' 21 | verbs: 22 | - 'use' 23 | resourceNames: [{{ printf "%s-master" (include "common.names.fullname" .) }}] 24 | {{- end }} 25 | {{- if .Values.rbac.rules }} 26 | {{- include "common.tplvalues.render" ( dict "value" .Values.rbac.rules "context" $ ) | nindent 2 }} 27 | {{- end }} 28 | {{- end }} 29 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/templates/rolebinding.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.rbac.create }} 2 | apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }} 3 | kind: RoleBinding 4 | metadata: 5 | name: {{ template "common.names.fullname" . }} 6 | namespace: {{ .Release.Namespace | quote }} 7 | labels: {{- include "common.labels.standard" . | nindent 4 }} 8 | {{- if .Values.commonLabels }} 9 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} 10 | {{- end }} 11 | {{- if .Values.commonAnnotations }} 12 | annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 13 | {{- end }} 14 | roleRef: 15 | apiGroup: rbac.authorization.k8s.io 16 | kind: Role 17 | name: {{ template "common.names.fullname" . }} 18 | subjects: 19 | - kind: ServiceAccount 20 | name: {{ template "redis.serviceAccountName" . }} 21 | {{- end }} 22 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/templates/secret.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.auth.enabled (not .Values.auth.existingSecret) -}} 2 | apiVersion: v1 3 | kind: Secret 4 | metadata: 5 | name: {{ template "common.names.fullname" . }} 6 | namespace: {{ .Release.Namespace | quote }} 7 | labels: {{- include "common.labels.standard" . | nindent 4 }} 8 | {{- if .Values.commonLabels }} 9 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} 10 | {{- end }} 11 | {{- if or .Values.secretAnnotations .Values.commonAnnotations }} 12 | annotations: 13 | {{- if .Values.secretAnnotations }} 14 | {{- include "common.tplvalues.render" ( dict "value" .Values.secretAnnotations "context" $ ) | nindent 4 }} 15 | {{- end }} 16 | {{- if .Values.commonAnnotations }} 17 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 18 | {{- end }} 19 | {{- end }} 20 | type: Opaque 21 | data: 22 | redis-password: {{ include "redis.password" . | b64enc | quote }} 23 | {{- end -}} 24 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/templates/sentinel/hpa.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.replica.autoscaling.enabled .Values.sentinel.enabled }} 2 | apiVersion: {{ include "common.capabilities.hpa.apiVersion" ( dict "context" $ ) }} 3 | kind: HorizontalPodAutoscaler 4 | metadata: 5 | name: {{ printf "%s-node" (include "common.names.fullname" .) }} 6 | namespace: {{ .Release.Namespace | quote }} 7 | labels: {{- include "common.labels.standard" . | nindent 4 }} 8 | app.kubernetes.io/component: replica 9 | {{- if .Values.commonLabels }} 10 | {{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }} 11 | {{- end }} 12 | {{- if .Values.commonAnnotations }} 13 | annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 14 | {{- end }} 15 | spec: 16 | scaleTargetRef: 17 | apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }} 18 | kind: StatefulSet 19 | name: {{ printf "%s-node" (include "common.names.fullname" .) }} 20 | minReplicas: {{ .Values.replica.autoscaling.minReplicas }} 21 | maxReplicas: {{ .Values.replica.autoscaling.maxReplicas }} 22 | metrics: 23 | {{- if .Values.replica.autoscaling.targetMemory }} 24 | - type: Resource 25 | resource: 26 | name: memory 27 | {{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }} 28 | targetAverageUtilization: {{ .Values.replica.autoscaling.targetMemory }} 29 | {{- else }} 30 | target: 31 | type: Utilization 32 | averageUtilization: {{ .Values.replica.autoscaling.targetMemory }} 33 | {{- end }} 34 | {{- end }} 35 | {{- if .Values.replica.autoscaling.targetCPU }} 36 | - type: Resource 37 | resource: 38 | name: cpu 39 | {{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }} 40 | targetAverageUtilization: {{ .Values.replica.autoscaling.targetCPU }} 41 | {{- else }} 42 | target: 43 | type: Utilization 44 | averageUtilization: {{ .Values.replica.autoscaling.targetCPU }} 45 | {{- end }} 46 | {{- end }} 47 | {{- end }} 48 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.serviceAccount.create (and (not .Values.master.serviceAccount.create) (not .Values.replica.serviceAccount.create)) }} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }} 5 | metadata: 6 | name: {{ template "redis.serviceAccountName" . }} 7 | namespace: {{ .Release.Namespace | quote }} 8 | labels: {{- include "common.labels.standard" . | nindent 4 }} 9 | {{- if .Values.commonLabels }} 10 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} 11 | {{- end }} 12 | {{- if or .Values.commonAnnotations .Values.serviceAccount.annotations }} 13 | annotations: 14 | {{- if or .Values.commonAnnotations }} 15 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 16 | {{- end }} 17 | {{- if .Values.serviceAccount.annotations }} 18 | {{- include "common.tplvalues.render" ( dict "value" .Values.serviceAccount.annotations "context" $ ) | nindent 4 }} 19 | {{- end }} 20 | {{- end }} 21 | {{- end }} -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/templates/servicemonitor.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled }} 2 | apiVersion: monitoring.coreos.com/v1 3 | kind: ServiceMonitor 4 | metadata: 5 | name: {{ template "common.names.fullname" . }} 6 | namespace: {{ default .Release.Namespace .Values.metrics.serviceMonitor.namespace | quote }} 7 | labels: {{- include "common.labels.standard" . | nindent 4 }} 8 | {{- if .Values.metrics.serviceMonitor.additionalLabels }} 9 | {{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.additionalLabels "context" $) | nindent 4 }} 10 | {{- end }} 11 | {{- if .Values.commonLabels }} 12 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} 13 | {{- end }} 14 | {{- if .Values.commonAnnotations }} 15 | annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 16 | {{- end }} 17 | spec: 18 | endpoints: 19 | - port: http-metrics 20 | {{- if .Values.metrics.serviceMonitor.interval }} 21 | interval: {{ .Values.metrics.serviceMonitor.interval }} 22 | {{- end }} 23 | {{- if .Values.metrics.serviceMonitor.scrapeTimeout }} 24 | scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }} 25 | {{- end }} 26 | {{- if .Values.metrics.serviceMonitor.honorLabels }} 27 | honorLabels: {{ .Values.metrics.serviceMonitor.honorLabels }} 28 | {{- end }} 29 | {{- if .Values.metrics.serviceMonitor.relabellings }} 30 | relabelings: {{- toYaml .Values.metrics.serviceMonitor.relabellings | nindent 6 }} 31 | {{- end }} 32 | {{- if .Values.metrics.serviceMonitor.metricRelabelings }} 33 | metricRelabelings: {{- toYaml .Values.metrics.serviceMonitor.metricRelabelings | nindent 6 }} 34 | {{- end }} 35 | {{- if .Values.metrics.serviceMonitor.podTargetLabels }} 36 | podTargetLabels: {{- toYaml .Values.metrics.serviceMonitor.podTargetLabels | nindent 4 }} 37 | {{- end }} 38 | namespaceSelector: 39 | matchNames: 40 | - {{ .Release.Namespace }} 41 | selector: 42 | matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} 43 | app.kubernetes.io/component: metrics 44 | {{- end }} 45 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/.helm-charts/https_charts.bitnami.com/bitnami/redis/17.4.0/templates/tls-secret.yaml: -------------------------------------------------------------------------------- 1 | {{- if (include "redis.createTlsSecret" .) }} 2 | {{- $secretName := printf "%s-crt" (include "common.names.fullname" .) }} 3 | {{- $existingCerts := (lookup "v1" "Secret" .Release.Namespace $secretName).data | default dict }} 4 | {{- $ca := genCA "redis-ca" 365 }} 5 | {{- $releaseNamespace := .Release.Namespace }} 6 | {{- $clusterDomain := .Values.clusterDomain }} 7 | {{- $fullname := include "common.names.fullname" . }} 8 | {{- $serviceName := include "common.names.fullname" . }} 9 | {{- $headlessServiceName := printf "%s-headless" (include "common.names.fullname" .) }} 10 | {{- $masterServiceName := printf "%s-master" (include "common.names.fullname" .) }} 11 | {{- $altNames := list (printf "*.%s.%s.svc.%s" $serviceName $releaseNamespace $clusterDomain) (printf "%s.%s.svc.%s" $masterServiceName $releaseNamespace $clusterDomain) (printf "*.%s.%s.svc.%s" $masterServiceName $releaseNamespace $clusterDomain) (printf "*.%s.%s.svc.%s" $headlessServiceName $releaseNamespace $clusterDomain) (printf "%s.%s.svc.%s" $headlessServiceName $releaseNamespace $clusterDomain) "127.0.0.1" "localhost" $fullname }} 12 | {{- $crt := genSignedCert $fullname nil $altNames 365 $ca }} 13 | apiVersion: v1 14 | kind: Secret 15 | metadata: 16 | name: {{ $secretName }} 17 | namespace: {{ .Release.Namespace | quote }} 18 | labels: {{- include "common.labels.standard" . | nindent 4 }} 19 | {{- if .Values.commonLabels }} 20 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} 21 | {{- end }} 22 | {{- if .Values.commonAnnotations }} 23 | annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 24 | {{- end }} 25 | type: kubernetes.io/tls 26 | data: 27 | ca.crt: {{ (get $existingCerts "ca.crt") | default ($ca.Cert | b64enc | quote ) }} 28 | tls.crt: {{ (get $existingCerts "tls.crt") | default ($crt.Cert | b64enc | quote) }} 29 | tls.key: {{ (get $existingCerts "tls.key") | default ($crt.Key | b64enc | quote) }} 30 | {{- end }} 31 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/.kluctl.yml: -------------------------------------------------------------------------------- 1 | discriminator: kluctl-examples-microservices-demo-{{ target.name }} 2 | 3 | targets: 4 | - name: local 5 | context: kind-kind 6 | args: 7 | env_type: local 8 | - name: test 9 | context: kind-kind 10 | args: 11 | env_type: real 12 | - name: prod 13 | context: kind-kind 14 | args: 15 | env_type: real 16 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/deployment.yml: -------------------------------------------------------------------------------- 1 | vars: 2 | - file: ./vars/{{ args.env_type }}.yml 3 | 4 | deployments: 5 | - path: namespaces 6 | - barrier: true 7 | - include: third-party 8 | - include: services 9 | 10 | commonLabels: 11 | examples.kluctl.io/deployment-project: "microservices-demo" 12 | examples.kluctl.io/deployment-target: "{{ target.name }}" 13 | 14 | overrideNamespace: ms-demo-{{ target.name }} 15 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/namespaces/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - namespace.yml 3 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/namespaces/namespace.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: ms-demo-{{ target.name }} 5 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/services/adservice/deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: adservice 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: adservice 9 | template: 10 | metadata: 11 | labels: 12 | app: adservice 13 | spec: 14 | serviceAccountName: default 15 | terminationGracePeriodSeconds: 5 16 | containers: 17 | - name: server 18 | image: gcr.io/google-samples/microservices-demo/adservice:v0.3.6 19 | ports: 20 | - containerPort: 9555 21 | env: 22 | - name: PORT 23 | value: "9555" 24 | - name: DISABLE_STATS 25 | value: "1" 26 | - name: DISABLE_TRACING 27 | value: "1" 28 | # - name: JAEGER_SERVICE_ADDR 29 | # value: "jaeger-collector:14268" 30 | resources: 31 | requests: 32 | cpu: 50m 33 | memory: 180Mi 34 | limits: 35 | cpu: 300m 36 | memory: 300Mi 37 | readinessProbe: 38 | initialDelaySeconds: 20 39 | periodSeconds: 15 40 | exec: 41 | command: ["/bin/grpc_health_probe", "-addr=:9555"] 42 | livenessProbe: 43 | initialDelaySeconds: 20 44 | periodSeconds: 15 45 | exec: 46 | command: ["/bin/grpc_health_probe", "-addr=:9555"] 47 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/services/adservice/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yml 3 | - service.yml 4 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/services/adservice/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: adservice 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: adservice 9 | ports: 10 | - name: grpc 11 | port: 9555 12 | targetPort: 9555 13 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/services/cartservice/deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: cartservice 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: cartservice 9 | template: 10 | metadata: 11 | labels: 12 | app: cartservice 13 | spec: 14 | serviceAccountName: default 15 | terminationGracePeriodSeconds: 5 16 | containers: 17 | - name: server 18 | image: gcr.io/google-samples/microservices-demo/cartservice:v0.3.6 19 | ports: 20 | - containerPort: 7070 21 | env: 22 | - name: REDIS_ADDR 23 | value: "{{ redis.svcName }}:6379" 24 | resources: 25 | requests: 26 | cpu: 50m 27 | memory: 64Mi 28 | limits: 29 | cpu: 300m 30 | memory: 128Mi 31 | readinessProbe: 32 | initialDelaySeconds: 15 33 | exec: 34 | command: ["/bin/grpc_health_probe", "-addr=:7070", "-rpc-timeout=5s"] 35 | livenessProbe: 36 | initialDelaySeconds: 15 37 | periodSeconds: 10 38 | exec: 39 | command: ["/bin/grpc_health_probe", "-addr=:7070", "-rpc-timeout=5s"] 40 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/services/cartservice/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yml 3 | - service.yml 4 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/services/cartservice/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: cartservice 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: cartservice 9 | ports: 10 | - name: grpc 11 | port: 7070 12 | targetPort: 7070 13 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/services/checkoutservice/deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: checkoutservice 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: checkoutservice 9 | template: 10 | metadata: 11 | labels: 12 | app: checkoutservice 13 | spec: 14 | serviceAccountName: default 15 | containers: 16 | - name: server 17 | image: gcr.io/google-samples/microservices-demo/checkoutservice:v0.3.6 18 | ports: 19 | - containerPort: 5050 20 | readinessProbe: 21 | exec: 22 | command: ["/bin/grpc_health_probe", "-addr=:5050"] 23 | livenessProbe: 24 | exec: 25 | command: ["/bin/grpc_health_probe", "-addr=:5050"] 26 | env: 27 | - name: PORT 28 | value: "5050" 29 | - name: PRODUCT_CATALOG_SERVICE_ADDR 30 | value: "productcatalogservice:3550" 31 | - name: SHIPPING_SERVICE_ADDR 32 | value: "shippingservice:50051" 33 | - name: PAYMENT_SERVICE_ADDR 34 | value: "paymentservice:50051" 35 | - name: EMAIL_SERVICE_ADDR 36 | value: "emailservice:5000" 37 | - name: CURRENCY_SERVICE_ADDR 38 | value: "currencyservice:7000" 39 | - name: CART_SERVICE_ADDR 40 | value: "cartservice:7070" 41 | - name: DISABLE_STATS 42 | value: "1" 43 | - name: DISABLE_TRACING 44 | value: "1" 45 | - name: DISABLE_PROFILER 46 | value: "1" 47 | # - name: JAEGER_SERVICE_ADDR 48 | # value: "jaeger-collector:14268" 49 | resources: 50 | requests: 51 | cpu: 50m 52 | memory: 64Mi 53 | limits: 54 | cpu: 200m 55 | memory: 128Mi 56 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/services/checkoutservice/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yml 3 | - service.yml 4 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/services/checkoutservice/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: checkoutservice 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: checkoutservice 9 | ports: 10 | - name: grpc 11 | port: 5050 12 | targetPort: 5050 13 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/services/currencyservice/deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: currencyservice 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: currencyservice 9 | template: 10 | metadata: 11 | labels: 12 | app: currencyservice 13 | spec: 14 | serviceAccountName: default 15 | terminationGracePeriodSeconds: 5 16 | containers: 17 | - name: server 18 | image: gcr.io/google-samples/microservices-demo/currencyservice:v0.3.6 19 | ports: 20 | - name: grpc 21 | containerPort: 7000 22 | env: 23 | - name: PORT 24 | value: "7000" 25 | - name: DISABLE_TRACING 26 | value: "1" 27 | - name: DISABLE_PROFILER 28 | value: "1" 29 | - name: DISABLE_DEBUGGER 30 | value: "1" 31 | readinessProbe: 32 | exec: 33 | command: ["/bin/grpc_health_probe", "-addr=:7000"] 34 | livenessProbe: 35 | exec: 36 | command: ["/bin/grpc_health_probe", "-addr=:7000"] 37 | resources: 38 | requests: 39 | cpu: 50m 40 | memory: 64Mi 41 | limits: 42 | cpu: 200m 43 | memory: 128Mi 44 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/services/currencyservice/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yml 3 | - service.yml 4 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/services/currencyservice/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: currencyservice 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: currencyservice 9 | ports: 10 | - name: grpc 11 | port: 7000 12 | targetPort: 7000 13 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/services/deployment.yml: -------------------------------------------------------------------------------- 1 | # yamllint disable-file 2 | 3 | deployments: 4 | - path: adservice 5 | - path: cartservice 6 | - path: checkoutservice 7 | - path: currencyservice 8 | {% if services.emailservice.enabled %} 9 | - path: emailservice 10 | {% endif %} 11 | - path: frontend 12 | {% if services.loadgenerator.enabled %} 13 | - path: loadgenerator 14 | {% endif %} 15 | - path: paymentservice 16 | - path: productcatalogservice 17 | - path: recommendationservice 18 | - path: shippingservice 19 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/services/emailservice/deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: emailservice 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: emailservice 9 | template: 10 | metadata: 11 | labels: 12 | app: emailservice 13 | spec: 14 | serviceAccountName: default 15 | terminationGracePeriodSeconds: 5 16 | containers: 17 | - name: server 18 | image: gcr.io/google-samples/microservices-demo/emailservice:v0.3.6 19 | ports: 20 | - containerPort: 8080 21 | env: 22 | - name: PORT 23 | value: "8080" 24 | - name: DISABLE_TRACING 25 | value: "1" 26 | - name: DISABLE_PROFILER 27 | value: "1" 28 | readinessProbe: 29 | periodSeconds: 5 30 | exec: 31 | command: ["/bin/grpc_health_probe", "-addr=:8080"] 32 | livenessProbe: 33 | periodSeconds: 5 34 | exec: 35 | command: ["/bin/grpc_health_probe", "-addr=:8080"] 36 | resources: 37 | requests: 38 | cpu: 50m 39 | memory: 64Mi 40 | limits: 41 | cpu: 200m 42 | memory: 128Mi 43 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/services/emailservice/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yml 3 | - service.yml 4 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/services/emailservice/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: emailservice 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: emailservice 9 | ports: 10 | - name: grpc 11 | port: 5000 12 | targetPort: 8080 13 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/services/frontend/deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: frontend 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: frontend 9 | template: 10 | metadata: 11 | labels: 12 | app: frontend 13 | annotations: 14 | sidecar.istio.io/rewriteAppHTTPProbers: "true" 15 | spec: 16 | serviceAccountName: default 17 | containers: 18 | - name: server 19 | image: gcr.io/google-samples/microservices-demo/frontend:v0.3.6 20 | ports: 21 | - containerPort: 8080 22 | readinessProbe: 23 | initialDelaySeconds: 10 24 | httpGet: 25 | path: "/_healthz" 26 | port: 8080 27 | httpHeaders: 28 | - name: "Cookie" 29 | value: "shop_session-id=x-readiness-probe" 30 | livenessProbe: 31 | initialDelaySeconds: 10 32 | httpGet: 33 | path: "/_healthz" 34 | port: 8080 35 | httpHeaders: 36 | - name: "Cookie" 37 | value: "shop_session-id=x-liveness-probe" 38 | env: 39 | - name: PORT 40 | value: "8080" 41 | - name: PRODUCT_CATALOG_SERVICE_ADDR 42 | value: "productcatalogservice:3550" 43 | - name: CURRENCY_SERVICE_ADDR 44 | value: "currencyservice:7000" 45 | - name: CART_SERVICE_ADDR 46 | value: "cartservice:7070" 47 | - name: RECOMMENDATION_SERVICE_ADDR 48 | value: "recommendationservice:8080" 49 | - name: SHIPPING_SERVICE_ADDR 50 | value: "shippingservice:50051" 51 | - name: CHECKOUT_SERVICE_ADDR 52 | value: "checkoutservice:5050" 53 | - name: AD_SERVICE_ADDR 54 | value: "adservice:9555" 55 | # # ENV_PLATFORM: One of: local, gcp, aws, azure, onprem, alibaba 56 | # # When not set, defaults to "local" unless running in GKE, otherwies auto-sets to gcp 57 | # - name: ENV_PLATFORM 58 | # value: "aws" 59 | - name: DISABLE_TRACING 60 | value: "1" 61 | - name: DISABLE_PROFILER 62 | value: "1" 63 | # - name: JAEGER_SERVICE_ADDR 64 | # value: "jaeger-collector:14268" 65 | # - name: CYMBAL_BRANDING 66 | # value: "true" 67 | resources: 68 | requests: 69 | cpu: 50m 70 | memory: 64Mi 71 | limits: 72 | cpu: 200m 73 | memory: 128Mi 74 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/services/frontend/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yml 3 | - service.yml 4 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/services/frontend/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: frontend 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: frontend 9 | ports: 10 | - name: http 11 | port: 80 12 | targetPort: 8080 13 | --- 14 | apiVersion: v1 15 | kind: Service 16 | metadata: 17 | name: frontend-external 18 | spec: 19 | type: LoadBalancer 20 | selector: 21 | app: frontend 22 | ports: 23 | - name: http 24 | port: 80 25 | targetPort: 8080 26 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/services/loadgenerator/deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: loadgenerator 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: loadgenerator 9 | replicas: 1 10 | template: 11 | metadata: 12 | labels: 13 | app: loadgenerator 14 | annotations: 15 | sidecar.istio.io/rewriteAppHTTPProbers: "true" 16 | spec: 17 | serviceAccountName: default 18 | terminationGracePeriodSeconds: 5 19 | restartPolicy: Always 20 | initContainers: 21 | - command: 22 | - /bin/sh 23 | - -exc 24 | - | 25 | echo "Init container pinging frontend: ${FRONTEND_ADDR}..." 26 | STATUSCODE=$(wget --server-response http://${FRONTEND_ADDR} 2>&1 | awk '/^ HTTP/{print $2}') 27 | if test $STATUSCODE -ne 200; then 28 | echo "Error: Could not reach frontend - Status code: ${STATUSCODE}" 29 | exit 1 30 | fi 31 | name: frontend-check 32 | image: busybox:latest 33 | env: 34 | - name: FRONTEND_ADDR 35 | value: "frontend:80" 36 | containers: 37 | - name: main 38 | image: gcr.io/google-samples/microservices-demo/loadgenerator:v0.3.6 39 | env: 40 | - name: FRONTEND_ADDR 41 | value: "frontend:80" 42 | - name: USERS 43 | value: "10" 44 | resources: 45 | requests: 46 | cpu: 50m 47 | memory: 256Mi 48 | limits: 49 | cpu: 500m 50 | memory: 512Mi 51 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/services/loadgenerator/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yml 3 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/services/paymentservice/deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: paymentservice 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: paymentservice 9 | template: 10 | metadata: 11 | labels: 12 | app: paymentservice 13 | spec: 14 | serviceAccountName: default 15 | terminationGracePeriodSeconds: 5 16 | containers: 17 | - name: server 18 | image: gcr.io/google-samples/microservices-demo/paymentservice:v0.3.6 19 | ports: 20 | - containerPort: 50051 21 | env: 22 | - name: PORT 23 | value: "50051" 24 | - name: DISABLE_TRACING 25 | value: "1" 26 | - name: DISABLE_PROFILER 27 | value: "1" 28 | - name: DISABLE_DEBUGGER 29 | value: "1" 30 | readinessProbe: 31 | exec: 32 | command: ["/bin/grpc_health_probe", "-addr=:50051"] 33 | livenessProbe: 34 | exec: 35 | command: ["/bin/grpc_health_probe", "-addr=:50051"] 36 | resources: 37 | requests: 38 | cpu: 50m 39 | memory: 64Mi 40 | limits: 41 | cpu: 200m 42 | memory: 128Mi 43 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/services/paymentservice/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yml 3 | - service.yml 4 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/services/paymentservice/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: paymentservice 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: paymentservice 9 | ports: 10 | - name: grpc 11 | port: 50051 12 | targetPort: 50051 13 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/services/productcatalogservice/deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: productcatalogservice 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: productcatalogservice 9 | template: 10 | metadata: 11 | labels: 12 | app: productcatalogservice 13 | spec: 14 | serviceAccountName: default 15 | terminationGracePeriodSeconds: 5 16 | containers: 17 | - name: server 18 | image: gcr.io/google-samples/microservices-demo/productcatalogservice:v0.3.6 19 | ports: 20 | - containerPort: 3550 21 | env: 22 | - name: PORT 23 | value: "3550" 24 | - name: DISABLE_STATS 25 | value: "1" 26 | - name: DISABLE_TRACING 27 | value: "1" 28 | - name: DISABLE_PROFILER 29 | value: "1" 30 | # - name: JAEGER_SERVICE_ADDR 31 | # value: "jaeger-collector:14268" 32 | readinessProbe: 33 | exec: 34 | command: ["/bin/grpc_health_probe", "-addr=:3550"] 35 | livenessProbe: 36 | exec: 37 | command: ["/bin/grpc_health_probe", "-addr=:3550"] 38 | resources: 39 | requests: 40 | cpu: 50m 41 | memory: 64Mi 42 | limits: 43 | cpu: 200m 44 | memory: 128Mi 45 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/services/productcatalogservice/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yml 3 | - service.yml 4 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/services/productcatalogservice/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: productcatalogservice 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: productcatalogservice 9 | ports: 10 | - name: grpc 11 | port: 3550 12 | targetPort: 3550 13 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/services/recommendationservice/deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: recommendationservice 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: recommendationservice 9 | template: 10 | metadata: 11 | labels: 12 | app: recommendationservice 13 | spec: 14 | serviceAccountName: default 15 | terminationGracePeriodSeconds: 5 16 | containers: 17 | - name: server 18 | image: gcr.io/google-samples/microservices-demo/recommendationservice:v0.3.6 19 | ports: 20 | - containerPort: 8080 21 | readinessProbe: 22 | periodSeconds: 5 23 | exec: 24 | command: ["/bin/grpc_health_probe", "-addr=:8080"] 25 | livenessProbe: 26 | periodSeconds: 5 27 | exec: 28 | command: ["/bin/grpc_health_probe", "-addr=:8080"] 29 | env: 30 | - name: PORT 31 | value: "8080" 32 | - name: PRODUCT_CATALOG_SERVICE_ADDR 33 | value: "productcatalogservice:3550" 34 | - name: DISABLE_TRACING 35 | value: "1" 36 | - name: DISABLE_PROFILER 37 | value: "1" 38 | - name: DISABLE_DEBUGGER 39 | value: "1" 40 | resources: 41 | requests: 42 | cpu: 50m 43 | memory: 220Mi 44 | limits: 45 | cpu: 200m 46 | memory: 450Mi 47 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/services/recommendationservice/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yml 3 | - service.yml 4 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/services/recommendationservice/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: recommendationservice 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: recommendationservice 9 | ports: 10 | - name: grpc 11 | port: 8080 12 | targetPort: 8080 13 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/services/shippingservice/deployment.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: shippingservice 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: shippingservice 9 | template: 10 | metadata: 11 | labels: 12 | app: shippingservice 13 | spec: 14 | serviceAccountName: default 15 | containers: 16 | - name: server 17 | image: gcr.io/google-samples/microservices-demo/shippingservice:v0.3.6 18 | ports: 19 | - containerPort: 50051 20 | env: 21 | - name: PORT 22 | value: "50051" 23 | - name: DISABLE_STATS 24 | value: "1" 25 | - name: DISABLE_TRACING 26 | value: "1" 27 | - name: DISABLE_PROFILER 28 | value: "1" 29 | # - name: JAEGER_SERVICE_ADDR 30 | # value: "jaeger-collector:14268" 31 | readinessProbe: 32 | periodSeconds: 5 33 | exec: 34 | command: ["/bin/grpc_health_probe", "-addr=:50051"] 35 | livenessProbe: 36 | exec: 37 | command: ["/bin/grpc_health_probe", "-addr=:50051"] 38 | resources: 39 | requests: 40 | cpu: 50m 41 | memory: 64Mi 42 | limits: 43 | cpu: 200m 44 | memory: 128Mi 45 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/services/shippingservice/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deployment.yml 3 | - service.yml 4 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/services/shippingservice/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: shippingservice 5 | spec: 6 | type: ClusterIP 7 | selector: 8 | app: shippingservice 9 | ports: 10 | - name: grpc 11 | port: 50051 12 | targetPort: 50051 13 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/third-party/deployment.yml: -------------------------------------------------------------------------------- 1 | deployments: 2 | - path: redis 3 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/third-party/redis/helm-chart.yml: -------------------------------------------------------------------------------- 1 | helmChart: 2 | repo: https://charts.bitnami.com/bitnami 3 | chartName: redis 4 | chartVersion: 17.4.0 5 | releaseName: cart 6 | namespace: ms-demo-{{ target.name }} 7 | output: deploy.yml 8 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/third-party/redis/helm-values.yml: -------------------------------------------------------------------------------- 1 | # yamllint disable-file 2 | 3 | architecture: {{ redis.architecture }} 4 | 5 | auth: 6 | enabled: false 7 | 8 | {% if redis.architecture == "replication" %} 9 | sentinel: 10 | enabled: true 11 | quorum: 2 12 | 13 | replica: 14 | replicaCount: 3 15 | persistence: 16 | enabled: true 17 | {% endif %} 18 | 19 | master: 20 | persistence: 21 | enabled: true 22 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/third-party/redis/kustomization.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | - deploy.yml 3 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/vars/local.yml: -------------------------------------------------------------------------------- 1 | redis: 2 | architecture: standalone 3 | # the standalone architecture exposes redis via a different service then the replication architecture (which uses sentinel) 4 | svcName: cart-redis-master 5 | 6 | services: 7 | emailservice: 8 | enabled: false 9 | loadgenerator: 10 | enabled: false 11 | -------------------------------------------------------------------------------- /microservices-demo/3-templating-and-multi-env/vars/real.yml: -------------------------------------------------------------------------------- 1 | redis: 2 | architecture: replication 3 | # the standalone architecture exposes redis via a different service then the replication architecture (which uses sentinel) 4 | svcName: cart-redis 5 | 6 | services: 7 | emailservice: 8 | enabled: true 9 | loadgenerator: 10 | enabled: true 11 | -------------------------------------------------------------------------------- /microservices-demo/README.md: -------------------------------------------------------------------------------- 1 | # Microservices Demo 2 | 3 | This example project is used in the article series [Microservices Demo](https://kluctl.io/docs/guides/tutorials/microservices-demo/) 4 | -------------------------------------------------------------------------------- /preview-envs/README.md: -------------------------------------------------------------------------------- 1 | # preview-envs 2 | 3 | This directory is used to demonstrate the [template-controller's](https://github.com/kluctl/template-controller) 4 | [GitProjector](https://github.com/kluctl/template-controller/blob/main/docs/spec/v1alpha1/gitprojector.md) and related 5 | examples. 6 | 7 | It simply contains a few yaml files with configuration of dynamic preview environments, which are read by the 8 | `GitProjector` and then used with an `ObjectTemplate` to create `KluctlDeployments`. 9 | -------------------------------------------------------------------------------- /preview-envs/preview-env1.yaml: -------------------------------------------------------------------------------- 1 | envName: preview-env1 2 | replicas: 3 -------------------------------------------------------------------------------- /preview-envs/preview-env2.yaml: -------------------------------------------------------------------------------- 1 | envName: preview-env2 2 | replicas: 1 -------------------------------------------------------------------------------- /readme-assets/gitops-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kluctl/kluctl-examples/8dcccb8453e89e895916f98af5b0ca89ca458cc6/readme-assets/gitops-diagram.png -------------------------------------------------------------------------------- /simple-helm/.helm-charts/https_charts.bitnami.com/bitnami/nginx/17.3.2/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | # img folder 23 | img/ 24 | # Changelog 25 | CHANGELOG.md 26 | -------------------------------------------------------------------------------- /simple-helm/.helm-charts/https_charts.bitnami.com/bitnami/nginx/17.3.2/Chart.lock: -------------------------------------------------------------------------------- 1 | dependencies: 2 | - name: common 3 | repository: oci://registry-1.docker.io/bitnamicharts 4 | version: 2.19.3 5 | digest: sha256:de997835d9ce9a9deefc2d70d8c62b11aa1d1a76ece9e86a83736ab9f930bf4d 6 | generated: "2024-05-21T14:20:36.308910981+02:00" 7 | -------------------------------------------------------------------------------- /simple-helm/.helm-charts/https_charts.bitnami.com/bitnami/nginx/17.3.2/Chart.yaml: -------------------------------------------------------------------------------- 1 | annotations: 2 | category: Infrastructure 3 | images: | 4 | - name: git 5 | image: docker.io/bitnami/git:2.45.1-debian-12-r0 6 | - name: nginx 7 | image: docker.io/bitnami/nginx:1.26.1-debian-12-r0 8 | - name: nginx-exporter 9 | image: docker.io/bitnami/nginx-exporter:1.2.0-debian-12-r0 10 | licenses: Apache-2.0 11 | apiVersion: v2 12 | appVersion: 1.26.1 13 | dependencies: 14 | - name: common 15 | repository: oci://registry-1.docker.io/bitnamicharts 16 | tags: 17 | - bitnami-common 18 | version: 2.x.x 19 | description: NGINX Open Source is a web server that can be also used as a reverse 20 | proxy, load balancer, and HTTP cache. Recommended for high-demanding sites due to 21 | its ability to provide faster content. 22 | home: https://bitnami.com 23 | icon: https://bitnami.com/assets/stacks/nginx/img/nginx-stack-220x234.png 24 | keywords: 25 | - nginx 26 | - http 27 | - web 28 | - www 29 | - reverse proxy 30 | maintainers: 31 | - name: Broadcom, Inc. All Rights Reserved. 32 | url: https://github.com/bitnami/charts 33 | name: nginx 34 | sources: 35 | - https://github.com/bitnami/charts/tree/main/bitnami/nginx 36 | version: 17.3.2 37 | -------------------------------------------------------------------------------- /simple-helm/.helm-charts/https_charts.bitnami.com/bitnami/nginx/17.3.2/charts/common/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | .vscode/ 23 | # img folder 24 | img/ 25 | -------------------------------------------------------------------------------- /simple-helm/.helm-charts/https_charts.bitnami.com/bitnami/nginx/17.3.2/charts/common/Chart.yaml: -------------------------------------------------------------------------------- 1 | annotations: 2 | category: Infrastructure 3 | licenses: Apache-2.0 4 | apiVersion: v2 5 | appVersion: 2.19.3 6 | description: A Library Helm Chart for grouping common logic between bitnami charts. 7 | This chart is not deployable by itself. 8 | home: https://bitnami.com 9 | icon: https://bitnami.com/downloads/logos/bitnami-mark.png 10 | keywords: 11 | - common 12 | - helper 13 | - template 14 | - function 15 | - bitnami 16 | maintainers: 17 | - name: Broadcom, Inc. All Rights Reserved. 18 | url: https://github.com/bitnami/charts 19 | name: common 20 | sources: 21 | - https://github.com/bitnami/charts 22 | type: library 23 | version: 2.19.3 24 | -------------------------------------------------------------------------------- /simple-helm/.helm-charts/https_charts.bitnami.com/bitnami/nginx/17.3.2/charts/common/templates/_compatibility.tpl: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright Broadcom, Inc. All Rights Reserved. 3 | SPDX-License-Identifier: APACHE-2.0 4 | */}} 5 | 6 | {{/* vim: set filetype=mustache: */}} 7 | 8 | {{/* 9 | Return true if the detected platform is Openshift 10 | Usage: 11 | {{- include "common.compatibility.isOpenshift" . -}} 12 | */}} 13 | {{- define "common.compatibility.isOpenshift" -}} 14 | {{- if .Capabilities.APIVersions.Has "security.openshift.io/v1" -}} 15 | {{- true -}} 16 | {{- end -}} 17 | {{- end -}} 18 | 19 | {{/* 20 | Render a compatible securityContext depending on the platform. By default it is maintained as it is. In other platforms like Openshift we remove default user/group values that do not work out of the box with the restricted-v1 SCC 21 | Usage: 22 | {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.containerSecurityContext "context" $) -}} 23 | */}} 24 | {{- define "common.compatibility.renderSecurityContext" -}} 25 | {{- $adaptedContext := .secContext -}} 26 | 27 | {{- if (((.context.Values.global).compatibility).openshift) -}} 28 | {{- if or (eq .context.Values.global.compatibility.openshift.adaptSecurityContext "force") (and (eq .context.Values.global.compatibility.openshift.adaptSecurityContext "auto") (include "common.compatibility.isOpenshift" .context)) -}} 29 | {{/* Remove incompatible user/group values that do not work in Openshift out of the box */}} 30 | {{- $adaptedContext = omit $adaptedContext "fsGroup" "runAsUser" "runAsGroup" -}} 31 | {{- if not .secContext.seLinuxOptions -}} 32 | {{/* If it is an empty object, we remove it from the resulting context because it causes validation issues */}} 33 | {{- $adaptedContext = omit $adaptedContext "seLinuxOptions" -}} 34 | {{- end -}} 35 | {{- end -}} 36 | {{- end -}} 37 | {{- omit $adaptedContext "enabled" | toYaml -}} 38 | {{- end -}} 39 | -------------------------------------------------------------------------------- /simple-helm/.helm-charts/https_charts.bitnami.com/bitnami/nginx/17.3.2/charts/common/templates/_errors.tpl: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright Broadcom, Inc. All Rights Reserved. 3 | SPDX-License-Identifier: APACHE-2.0 4 | */}} 5 | 6 | {{/* vim: set filetype=mustache: */}} 7 | {{/* 8 | Through error when upgrading using empty passwords values that must not be empty. 9 | 10 | Usage: 11 | {{- $validationError00 := include "common.validations.values.single.empty" (dict "valueKey" "path.to.password00" "secret" "secretName" "field" "password-00") -}} 12 | {{- $validationError01 := include "common.validations.values.single.empty" (dict "valueKey" "path.to.password01" "secret" "secretName" "field" "password-01") -}} 13 | {{ include "common.errors.upgrade.passwords.empty" (dict "validationErrors" (list $validationError00 $validationError01) "context" $) }} 14 | 15 | Required password params: 16 | - validationErrors - String - Required. List of validation strings to be return, if it is empty it won't throw error. 17 | - context - Context - Required. Parent context. 18 | */}} 19 | {{- define "common.errors.upgrade.passwords.empty" -}} 20 | {{- $validationErrors := join "" .validationErrors -}} 21 | {{- if and $validationErrors .context.Release.IsUpgrade -}} 22 | {{- $errorString := "\nPASSWORDS ERROR: You must provide your current passwords when upgrading the release." -}} 23 | {{- $errorString = print $errorString "\n Note that even after reinstallation, old credentials may be needed as they may be kept in persistent volume claims." -}} 24 | {{- $errorString = print $errorString "\n Further information can be obtained at https://docs.bitnami.com/general/how-to/troubleshoot-helm-chart-issues/#credential-errors-while-upgrading-chart-releases" -}} 25 | {{- $errorString = print $errorString "\n%s" -}} 26 | {{- printf $errorString $validationErrors | fail -}} 27 | {{- end -}} 28 | {{- end -}} 29 | -------------------------------------------------------------------------------- /simple-helm/.helm-charts/https_charts.bitnami.com/bitnami/nginx/17.3.2/charts/common/templates/_labels.tpl: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright Broadcom, Inc. All Rights Reserved. 3 | SPDX-License-Identifier: APACHE-2.0 4 | */}} 5 | 6 | {{/* vim: set filetype=mustache: */}} 7 | 8 | {{/* 9 | Kubernetes standard labels 10 | {{ include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" $) -}} 11 | */}} 12 | {{- define "common.labels.standard" -}} 13 | {{- if and (hasKey . "customLabels") (hasKey . "context") -}} 14 | {{- $default := dict "app.kubernetes.io/name" (include "common.names.name" .context) "helm.sh/chart" (include "common.names.chart" .context) "app.kubernetes.io/instance" .context.Release.Name "app.kubernetes.io/managed-by" .context.Release.Service -}} 15 | {{- with .context.Chart.AppVersion -}} 16 | {{- $_ := set $default "app.kubernetes.io/version" . -}} 17 | {{- end -}} 18 | {{ template "common.tplvalues.merge" (dict "values" (list .customLabels $default) "context" .context) }} 19 | {{- else -}} 20 | app.kubernetes.io/name: {{ include "common.names.name" . }} 21 | helm.sh/chart: {{ include "common.names.chart" . }} 22 | app.kubernetes.io/instance: {{ .Release.Name }} 23 | app.kubernetes.io/managed-by: {{ .Release.Service }} 24 | {{- with .Chart.AppVersion }} 25 | app.kubernetes.io/version: {{ . | quote }} 26 | {{- end -}} 27 | {{- end -}} 28 | {{- end -}} 29 | 30 | {{/* 31 | Labels used on immutable fields such as deploy.spec.selector.matchLabels or svc.spec.selector 32 | {{ include "common.labels.matchLabels" (dict "customLabels" .Values.podLabels "context" $) -}} 33 | 34 | We don't want to loop over custom labels appending them to the selector 35 | since it's very likely that it will break deployments, services, etc. 36 | However, it's important to overwrite the standard labels if the user 37 | overwrote them on metadata.labels fields. 38 | */}} 39 | {{- define "common.labels.matchLabels" -}} 40 | {{- if and (hasKey . "customLabels") (hasKey . "context") -}} 41 | {{ merge (pick (include "common.tplvalues.render" (dict "value" .customLabels "context" .context) | fromYaml) "app.kubernetes.io/name" "app.kubernetes.io/instance") (dict "app.kubernetes.io/name" (include "common.names.name" .context) "app.kubernetes.io/instance" .context.Release.Name ) | toYaml }} 42 | {{- else -}} 43 | app.kubernetes.io/name: {{ include "common.names.name" . }} 44 | app.kubernetes.io/instance: {{ .Release.Name }} 45 | {{- end -}} 46 | {{- end -}} 47 | -------------------------------------------------------------------------------- /simple-helm/.helm-charts/https_charts.bitnami.com/bitnami/nginx/17.3.2/charts/common/templates/_resources.tpl: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright Broadcom, Inc. All Rights Reserved. 3 | SPDX-License-Identifier: APACHE-2.0 4 | */}} 5 | 6 | {{/* vim: set filetype=mustache: */}} 7 | 8 | {{/* 9 | Return a resource request/limit object based on a given preset. 10 | These presets are for basic testing and not meant to be used in production 11 | {{ include "common.resources.preset" (dict "type" "nano") -}} 12 | */}} 13 | {{- define "common.resources.preset" -}} 14 | {{/* The limits are the requests increased by 50% (except ephemeral-storage and xlarge/2xlarge sizes)*/}} 15 | {{- $presets := dict 16 | "nano" (dict 17 | "requests" (dict "cpu" "100m" "memory" "128Mi" "ephemeral-storage" "50Mi") 18 | "limits" (dict "cpu" "150m" "memory" "192Mi" "ephemeral-storage" "1024Mi") 19 | ) 20 | "micro" (dict 21 | "requests" (dict "cpu" "250m" "memory" "256Mi" "ephemeral-storage" "50Mi") 22 | "limits" (dict "cpu" "375m" "memory" "384Mi" "ephemeral-storage" "1024Mi") 23 | ) 24 | "small" (dict 25 | "requests" (dict "cpu" "500m" "memory" "512Mi" "ephemeral-storage" "50Mi") 26 | "limits" (dict "cpu" "750m" "memory" "768Mi" "ephemeral-storage" "1024Mi") 27 | ) 28 | "medium" (dict 29 | "requests" (dict "cpu" "500m" "memory" "1024Mi" "ephemeral-storage" "50Mi") 30 | "limits" (dict "cpu" "750m" "memory" "1536Mi" "ephemeral-storage" "1024Mi") 31 | ) 32 | "large" (dict 33 | "requests" (dict "cpu" "1.0" "memory" "2048Mi" "ephemeral-storage" "50Mi") 34 | "limits" (dict "cpu" "1.5" "memory" "3072Mi" "ephemeral-storage" "1024Mi") 35 | ) 36 | "xlarge" (dict 37 | "requests" (dict "cpu" "1.5" "memory" "4096Mi" "ephemeral-storage" "50Mi") 38 | "limits" (dict "cpu" "3.0" "memory" "6144Mi" "ephemeral-storage" "1024Mi") 39 | ) 40 | "2xlarge" (dict 41 | "requests" (dict "cpu" "1.5" "memory" "4096Mi" "ephemeral-storage" "50Mi") 42 | "limits" (dict "cpu" "6.0" "memory" "12288Mi" "ephemeral-storage" "1024Mi") 43 | ) 44 | }} 45 | {{- if hasKey $presets .type -}} 46 | {{- index $presets .type | toYaml -}} 47 | {{- else -}} 48 | {{- printf "ERROR: Preset key '%s' invalid. Allowed values are %s" .type (join "," (keys $presets)) | fail -}} 49 | {{- end -}} 50 | {{- end -}} 51 | -------------------------------------------------------------------------------- /simple-helm/.helm-charts/https_charts.bitnami.com/bitnami/nginx/17.3.2/charts/common/templates/_storage.tpl: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright Broadcom, Inc. All Rights Reserved. 3 | SPDX-License-Identifier: APACHE-2.0 4 | */}} 5 | 6 | {{/* vim: set filetype=mustache: */}} 7 | {{/* 8 | Return the proper Storage Class 9 | {{ include "common.storage.class" ( dict "persistence" .Values.path.to.the.persistence "global" $) }} 10 | */}} 11 | {{- define "common.storage.class" -}} 12 | 13 | {{- $storageClass := default .persistence.storageClass ((.global).storageClass) -}} 14 | {{- if $storageClass -}} 15 | {{- if (eq "-" $storageClass) -}} 16 | {{- printf "storageClassName: \"\"" -}} 17 | {{- else }} 18 | {{- printf "storageClassName: %s" $storageClass -}} 19 | {{- end -}} 20 | {{- end -}} 21 | 22 | {{- end -}} 23 | -------------------------------------------------------------------------------- /simple-helm/.helm-charts/https_charts.bitnami.com/bitnami/nginx/17.3.2/charts/common/templates/_tplvalues.tpl: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright Broadcom, Inc. All Rights Reserved. 3 | SPDX-License-Identifier: APACHE-2.0 4 | */}} 5 | 6 | {{/* vim: set filetype=mustache: */}} 7 | {{/* 8 | Renders a value that contains template perhaps with scope if the scope is present. 9 | Usage: 10 | {{ include "common.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $ ) }} 11 | {{ include "common.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $ "scope" $app ) }} 12 | */}} 13 | {{- define "common.tplvalues.render" -}} 14 | {{- $value := typeIs "string" .value | ternary .value (.value | toYaml) }} 15 | {{- if contains "{{" (toJson .value) }} 16 | {{- if .scope }} 17 | {{- tpl (cat "{{- with $.RelativeScope -}}" $value "{{- end }}") (merge (dict "RelativeScope" .scope) .context) }} 18 | {{- else }} 19 | {{- tpl $value .context }} 20 | {{- end }} 21 | {{- else }} 22 | {{- $value }} 23 | {{- end }} 24 | {{- end -}} 25 | 26 | {{/* 27 | Merge a list of values that contains template after rendering them. 28 | Merge precedence is consistent with http://masterminds.github.io/sprig/dicts.html#merge-mustmerge 29 | Usage: 30 | {{ include "common.tplvalues.merge" ( dict "values" (list .Values.path.to.the.Value1 .Values.path.to.the.Value2) "context" $ ) }} 31 | */}} 32 | {{- define "common.tplvalues.merge" -}} 33 | {{- $dst := dict -}} 34 | {{- range .values -}} 35 | {{- $dst = include "common.tplvalues.render" (dict "value" . "context" $.context "scope" $.scope) | fromYaml | merge $dst -}} 36 | {{- end -}} 37 | {{ $dst | toYaml }} 38 | {{- end -}} 39 | -------------------------------------------------------------------------------- /simple-helm/.helm-charts/https_charts.bitnami.com/bitnami/nginx/17.3.2/charts/common/values.yaml: -------------------------------------------------------------------------------- 1 | # Copyright Broadcom, Inc. All Rights Reserved. 2 | # SPDX-License-Identifier: APACHE-2.0 3 | 4 | ## bitnami/common 5 | ## It is required by CI/CD tools and processes. 6 | ## @skip exampleValue 7 | ## 8 | exampleValue: common-chart 9 | -------------------------------------------------------------------------------- /simple-helm/.helm-charts/https_charts.bitnami.com/bitnami/nginx/17.3.2/templates/extra-list.yaml: -------------------------------------------------------------------------------- 1 | {{- /* 2 | Copyright Broadcom, Inc. All Rights Reserved. 3 | SPDX-License-Identifier: APACHE-2.0 4 | */}} 5 | 6 | {{- range .Values.extraDeploy }} 7 | --- 8 | {{ include "common.tplvalues.render" (dict "value" . "context" $) }} 9 | {{- end }} 10 | -------------------------------------------------------------------------------- /simple-helm/.helm-charts/https_charts.bitnami.com/bitnami/nginx/17.3.2/templates/hpa.yaml: -------------------------------------------------------------------------------- 1 | {{- /* 2 | Copyright Broadcom, Inc. All Rights Reserved. 3 | SPDX-License-Identifier: APACHE-2.0 4 | */}} 5 | 6 | {{- if .Values.autoscaling.enabled }} 7 | apiVersion: {{ include "common.capabilities.hpa.apiVersion" ( dict "context" $ ) }} 8 | kind: HorizontalPodAutoscaler 9 | metadata: 10 | name: {{ template "common.names.fullname" . }} 11 | namespace: {{ include "common.names.namespace" . | quote }} 12 | labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} 13 | {{- if .Values.commonAnnotations }} 14 | annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 15 | {{- end }} 16 | spec: 17 | scaleTargetRef: 18 | apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }} 19 | kind: Deployment 20 | name: {{ template "common.names.fullname" . }} 21 | minReplicas: {{ .Values.autoscaling.minReplicas }} 22 | maxReplicas: {{ .Values.autoscaling.maxReplicas }} 23 | metrics: 24 | {{- if .Values.autoscaling.targetMemory }} 25 | - type: Resource 26 | resource: 27 | name: memory 28 | {{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }} 29 | targetAverageUtilization: {{ .Values.autoscaling.targetMemory }} 30 | {{- else }} 31 | target: 32 | type: Utilization 33 | averageUtilization: {{ .Values.autoscaling.targetMemory }} 34 | {{- end }} 35 | {{- end }} 36 | {{- if .Values.autoscaling.targetCPU }} 37 | - type: Resource 38 | resource: 39 | name: cpu 40 | {{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }} 41 | targetAverageUtilization: {{ .Values.autoscaling.targetCPU }} 42 | {{- else }} 43 | target: 44 | type: Utilization 45 | averageUtilization: {{ .Values.autoscaling.targetCPU }} 46 | {{- end }} 47 | {{- end }} 48 | {{- end }} 49 | -------------------------------------------------------------------------------- /simple-helm/.helm-charts/https_charts.bitnami.com/bitnami/nginx/17.3.2/templates/pdb.yaml: -------------------------------------------------------------------------------- 1 | {{- /* 2 | Copyright Broadcom, Inc. All Rights Reserved. 3 | SPDX-License-Identifier: APACHE-2.0 4 | */}} 5 | 6 | {{- if .Values.pdb.create }} 7 | apiVersion: {{ include "common.capabilities.policy.apiVersion" . }} 8 | kind: PodDisruptionBudget 9 | metadata: 10 | name: {{ include "common.names.fullname" . }} 11 | namespace: {{ include "common.names.namespace" . | quote }} 12 | labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} 13 | {{- if .Values.commonAnnotations }} 14 | annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 15 | {{- end }} 16 | spec: 17 | {{- if .Values.pdb.minAvailable }} 18 | minAvailable: {{ .Values.pdb.minAvailable }} 19 | {{- end }} 20 | {{- if or .Values.pdb.maxUnavailable (not .Values.pdb.minAvailable)}} 21 | maxUnavailable: {{ .Values.pdb.maxUnavailable | default 1 }} 22 | {{- end }} 23 | {{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.podLabels .Values.commonLabels ) "context" . ) }} 24 | selector: 25 | matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }} 26 | {{- end }} 27 | -------------------------------------------------------------------------------- /simple-helm/.helm-charts/https_charts.bitnami.com/bitnami/nginx/17.3.2/templates/prometheusrules.yaml: -------------------------------------------------------------------------------- 1 | {{- /* 2 | Copyright Broadcom, Inc. All Rights Reserved. 3 | SPDX-License-Identifier: APACHE-2.0 4 | */}} 5 | 6 | {{- if and .Values.metrics.enabled .Values.metrics.prometheusRule.enabled }} 7 | apiVersion: monitoring.coreos.com/v1 8 | kind: PrometheusRule 9 | metadata: 10 | name: {{ include "common.names.fullname" . }} 11 | namespace: {{ default (include "common.names.namespace" .) .Values.metrics.prometheusRule.namespace | quote }} 12 | labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} 13 | app.kubernetes.io/component: nginx 14 | app.kubernetes.io/component: metrics 15 | {{- if .Values.metrics.prometheusRule.additionalLabels }} 16 | {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.prometheusRule.additionalLabels "context" $ ) | nindent 4 }} 17 | {{- end }} 18 | {{- if .Values.commonAnnotations }} 19 | annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 20 | {{- end }} 21 | spec: 22 | groups: 23 | - name: {{ include "common.names.fullname" . }} 24 | rules: {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.prometheusRule.rules "context" $ ) | nindent 6 }} 25 | {{- end }} 26 | -------------------------------------------------------------------------------- /simple-helm/.helm-charts/https_charts.bitnami.com/bitnami/nginx/17.3.2/templates/server-block-configmap.yaml: -------------------------------------------------------------------------------- 1 | {{- /* 2 | Copyright Broadcom, Inc. All Rights Reserved. 3 | SPDX-License-Identifier: APACHE-2.0 4 | */}} 5 | 6 | {{- if and .Values.serverBlock (not .Values.existingServerBlockConfigmap) }} 7 | apiVersion: v1 8 | kind: ConfigMap 9 | metadata: 10 | name: {{ template "common.names.fullname" . }}-server-block 11 | namespace: {{ include "common.names.namespace" . | quote }} 12 | labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} 13 | {{- if .Values.commonAnnotations }} 14 | annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 15 | {{- end }} 16 | data: 17 | server-block.conf: |- 18 | {{- include "common.tplvalues.render" ( dict "value" .Values.serverBlock "context" $ ) | nindent 4 }} 19 | {{- end }} 20 | -------------------------------------------------------------------------------- /simple-helm/.helm-charts/https_charts.bitnami.com/bitnami/nginx/17.3.2/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- /* 2 | Copyright Broadcom, Inc. All Rights Reserved. 3 | SPDX-License-Identifier: APACHE-2.0 4 | */}} 5 | 6 | {{- if .Values.serviceAccount.create -}} 7 | apiVersion: v1 8 | kind: ServiceAccount 9 | metadata: 10 | name: {{ include "nginx.serviceAccountName" . }} 11 | namespace: {{ include "common.names.namespace" . | quote }} 12 | labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} 13 | {{- if or .Values.serviceAccount.annotations .Values.commonAnnotations }} 14 | {{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.serviceAccount.annotations .Values.commonAnnotations ) "context" . ) }} 15 | annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }} 16 | {{- end }} 17 | automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }} 18 | {{- end -}} 19 | -------------------------------------------------------------------------------- /simple-helm/.helm-charts/https_charts.bitnami.com/bitnami/nginx/17.3.2/templates/servicemonitor.yaml: -------------------------------------------------------------------------------- 1 | {{- /* 2 | Copyright Broadcom, Inc. All Rights Reserved. 3 | SPDX-License-Identifier: APACHE-2.0 4 | */}} 5 | 6 | {{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled }} 7 | apiVersion: monitoring.coreos.com/v1 8 | kind: ServiceMonitor 9 | metadata: 10 | name: {{ template "common.names.fullname" . }} 11 | namespace: {{ default (include "common.names.namespace" .) .Values.metrics.serviceMonitor.namespace | quote }} 12 | {{- $labels := include "common.tplvalues.merge" ( dict "values" ( list .Values.metrics.serviceMonitor.labels .Values.commonLabels ) "context" . ) }} 13 | labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }} 14 | {{- if .Values.commonAnnotations }} 15 | annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 16 | {{- end }} 17 | spec: 18 | jobLabel: {{ .Values.metrics.serviceMonitor.jobLabel | quote }} 19 | selector: 20 | matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 6 }} 21 | {{- if .Values.metrics.serviceMonitor.selector }} 22 | {{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.selector "context" $) | nindent 6 }} 23 | {{- end }} 24 | endpoints: 25 | - port: metrics 26 | path: /metrics 27 | {{- if .Values.metrics.serviceMonitor.interval }} 28 | interval: {{ .Values.metrics.serviceMonitor.interval }} 29 | {{- end }} 30 | {{- if .Values.metrics.serviceMonitor.scrapeTimeout }} 31 | scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }} 32 | {{- end }} 33 | {{- if .Values.metrics.serviceMonitor.honorLabels }} 34 | honorLabels: {{ .Values.metrics.serviceMonitor.honorLabels }} 35 | {{- end }} 36 | {{- if .Values.metrics.serviceMonitor.relabelings }} 37 | relabelings: {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.serviceMonitor.relabelings "context" $) | nindent 8 }} 38 | {{- end }} 39 | {{- if .Values.metrics.serviceMonitor.metricRelabelings }} 40 | metricRelabelings: {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.serviceMonitor.metricRelabelings "context" $) | nindent 8 }} 41 | {{- end }} 42 | namespaceSelector: 43 | matchNames: 44 | - {{ .Release.Namespace }} 45 | {{- end }} 46 | -------------------------------------------------------------------------------- /simple-helm/.helm-charts/https_charts.bitnami.com/bitnami/nginx/17.3.2/templates/tls-secret.yaml: -------------------------------------------------------------------------------- 1 | {{- /* 2 | Copyright Broadcom, Inc. All Rights Reserved. 3 | SPDX-License-Identifier: APACHE-2.0 4 | */}} 5 | 6 | {{- if and .Values.tls.enabled (not .Values.tls.existingSecret) }} 7 | {{- $ca := genCA "nginx-ca" 365 }} 8 | apiVersion: v1 9 | kind: Secret 10 | metadata: 11 | name: {{ printf "%s-tls" (include "common.names.fullname" .) }} 12 | namespace: {{ include "common.names.namespace" . | quote }} 13 | labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} 14 | {{- if .Values.commonAnnotations }} 15 | annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} 16 | {{- end }} 17 | type: kubernetes.io/tls 18 | data: 19 | {{- if .Values.tls.autoGenerated }} 20 | {{- $cert := genSignedCert (include "common.names.fullname" .) nil (list (include "common.names.fullname" .) (printf "%s.%s" (include "common.names.fullname" .) (include "common.names.namespace" .)) (printf "%s.%s.svc" (include "common.names.fullname" .) (include "common.names.namespace" .)) (printf "%s.%s.svc.%s" (include "common.names.fullname" .) (include "common.names.namespace" .) .Values.clusterDomain)) 365 $ca }} 21 | {{ .Values.tls.certFilename }}: {{ include "common.secrets.lookup" (dict "secret" (printf "%s-tls" (include "common.names.fullname" .)) "key" .Values.tls.certFilename "defaultValue" $cert.Cert "context" $) }} 22 | {{ .Values.tls.certKeyFilename }}: {{ include "common.secrets.lookup" (dict "secret" (printf "%s-tls" (include "common.names.fullname" .)) "key" .Values.tls.certKeyFilename "defaultValue" $cert.Key "context" $) }} 23 | {{ .Values.tls.certCAFilename }}: {{ include "common.secrets.lookup" (dict "secret" (printf "%s-tls" (include "common.names.fullname" .)) "key" .Values.tls.certCAFilename "defaultValue" $ca.Cert "context" $) }} 24 | {{- else }} 25 | {{- if .Values.tls.cert }} 26 | {{ .Values.tls.certFilename }}: {{ .Values.tls.cert | b64enc }} 27 | {{- end }} 28 | {{- if .Values.tls.key }} 29 | {{ .Values.tls.certKeyFilename }}: {{ .Values.tls.key | b64enc }} 30 | {{- end }} 31 | {{- if .Values.tls.ca }} 32 | {{ .Values.tls.certCAFilename }}: {{ .Values.tls.ca | b64enc }} 33 | {{- end }} 34 | {{- end }} 35 | {{- end }} 36 | -------------------------------------------------------------------------------- /simple-helm/.kluctl.yml: -------------------------------------------------------------------------------- 1 | discriminator: kluctl-examples-simple-helm-{{ target.name }} 2 | 3 | targets: 4 | - name: simple-helm 5 | args: 6 | environment: simple-helm 7 | 8 | args: 9 | - name: environment 10 | -------------------------------------------------------------------------------- /simple-helm/deployment.yml: -------------------------------------------------------------------------------- 1 | deployments: 2 | - include: deployment 3 | -------------------------------------------------------------------------------- /simple-helm/deployment/deployment.yml: -------------------------------------------------------------------------------- 1 | deployments: 2 | - path: nginx 3 | 4 | overrideNamespace: "simple-helm-{{ args.environment }}" 5 | -------------------------------------------------------------------------------- /simple-helm/deployment/nginx/helm-chart.yml: -------------------------------------------------------------------------------- 1 | helmChart: 2 | repo: https://charts.bitnami.com/bitnami 3 | chartName: nginx 4 | chartVersion: 17.3.2 5 | releaseName: nginx 6 | namespace: simple-helm-{{ args.environment }} 7 | -------------------------------------------------------------------------------- /simple-helm/deployment/nginx/helm-values.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | limits: 3 | cpu: 100m 4 | memory: 128Mi 5 | requests: 6 | cpu: 100m 7 | memory: 128Mi 8 | 9 | service: 10 | type: ClusterIP 11 | -------------------------------------------------------------------------------- /simple-helm/deployment/nginx/kustomization.yml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | 4 | resources: 5 | - namespace.yml 6 | - helm-rendered.yaml # this file is auto-generated at deploy time 7 | -------------------------------------------------------------------------------- /simple-helm/deployment/nginx/namespace.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: "simple-helm-{{ args.environment }}" 5 | -------------------------------------------------------------------------------- /simple/.kluctl.yml: -------------------------------------------------------------------------------- 1 | discriminator: kluctl-examples-simple-{{ target.name }} 2 | 3 | targets: 4 | - name: simple 5 | args: 6 | environment: simple 7 | - name: another 8 | args: 9 | environment: another 10 | 11 | args: 12 | - name: environment 13 | -------------------------------------------------------------------------------- /simple/deployment.yml: -------------------------------------------------------------------------------- 1 | deployments: 2 | - include: deployment 3 | -------------------------------------------------------------------------------- /simple/deployment/deployment.yml: -------------------------------------------------------------------------------- 1 | deployments: 2 | - path: nginx 3 | 4 | overrideNamespace: "simple-{{ args.environment }}" 5 | -------------------------------------------------------------------------------- /simple/deployment/nginx/deploy.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: nginx-deployment 5 | labels: 6 | app: nginx 7 | spec: 8 | replicas: 3 9 | selector: 10 | matchLabels: 11 | app: nginx 12 | template: 13 | metadata: 14 | labels: 15 | app: nginx 16 | spec: 17 | containers: 18 | - name: nginx 19 | image: nginx:1.27.0 20 | ports: 21 | - containerPort: 80 22 | -------------------------------------------------------------------------------- /simple/deployment/nginx/kustomization.yml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | 4 | resources: 5 | - namespace.yml 6 | - deploy.yml 7 | - service.yml 8 | -------------------------------------------------------------------------------- /simple/deployment/nginx/namespace.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: "simple-{{ args.environment }}" 5 | -------------------------------------------------------------------------------- /simple/deployment/nginx/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: nginx 5 | spec: 6 | selector: 7 | app: nginx 8 | ports: 9 | - name: http 10 | port: 80 11 | targetPort: http 12 | --------------------------------------------------------------------------------