Skip to content

docs: Improve helm for Version 3 #1340

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 27 commits into from
Oct 29, 2021
Merged

Conversation

Chris53897
Copy link
Contributor

Improve helm for Version 3 (WIP)

There are some points to discuss in my point of view.

  • I removed the notice for < 18.04 (18.04 is released on 2018-04-10)
    https://docs.docker.com/engine/release-notes/18.04/
  • These lines do exactly the same, so they could be changed, or not?
    actual: docker build -t gcr.io/test-api-platform/php -t gcr.io/test-api-platform/php:latest api --target api_platform_php
    new: docker build -t gcr.io/test-api-platform/php:latest api --target api_platform_php
  • Can i remove the part of "Tiller RBAC Issue" and concentrate on Helm v.3 ?
  • Can i remove the Sentence "Finally, build the pwa (client and admin) JavaScript apps and deploy them on a static
    website hosting service
    ." ?
    The PWA is now a Pod in Kubernetes.
  • Needs more testing

The ServiceAccount default works in minikube. But it has errors in kubernetes for me.
I will open an issue after further investigation.
--set serviceAccount.create=false

@Chris53897
Copy link
Contributor Author

@dunglas There is a problem with the Linter checker on pull requests. See https://github.com/api-platform/docs/pull/1340/checks?check_run_id=2290796856 It worked 15 Minutes ago. Maybe a temporary rate limit?

@alanpoulain
Copy link
Member

Related: #1104

Chris53897 and others added 5 commits April 8, 2021 19:47
Co-authored-by: Alan Poulain <contact@alanpoulain.eu>
Co-authored-by: Alan Poulain <contact@alanpoulain.eu>
Co-authored-by: Alan Poulain <contact@alanpoulain.eu>
Co-authored-by: Alan Poulain <contact@alanpoulain.eu>
Co-authored-by: Alan Poulain <contact@alanpoulain.eu>
@Chris53897
Copy link
Contributor Author

@alanpoulain Thanks for the suggestions. I merged them. Can you maybe answer some of the question above?

@alanpoulain
Copy link
Member

* I removed the notice for < 18.04 (18.04 is released on 2018-04-10)
  https://docs.docker.com/engine/release-notes/18.04/

I think it's OK too.

* These lines do exactly the same, so they could be changed, or not?
  actual: docker build -t gcr.io/test-api-platform/php -t gcr.io/test-api-platform/php:latest api --target api_platform_php
  new: docker build -t gcr.io/test-api-platform/php:latest api --target api_platform_php

Seems fine to me.

* Can i remove the part of "Tiller RBAC Issue" and concentrate on Helm v.3 ?

If the problem is not there anymore in Helm v3, I think it's OK to remove it.

* Can i remove the Sentence "Finally, build the `pwa` (client and admin) JavaScript apps and [deploy them on a static
  website hosting service](https://create-react-app.dev/docs/deployment/)." ?
  The PWA is now a Pod in Kubernetes.

It's probably better to offer the alternative too, isn't it?

@Chris53897
Copy link
Contributor Author

* Can i remove the Sentence "Finally, build the `pwa` (client and admin) JavaScript apps and [deploy them on a static
  website hosting service](https://create-react-app.dev/docs/deployment/)." ?
  The PWA is now a Pod in Kubernetes.

It's probably better to offer the alternative too, isn't it?

i don't know the planned behavior of 2.6.
The pwa container is in the helm chart and not optional. if it is the plan to make it optional to deploy it to kubernetes or a static website hosting service the helm chart has to be updated. i do not know much about the pwa topic.

@Chris53897
Copy link
Contributor Author

i changed the paragraph of running the command to create the schema of the database. now it is just a info how to access the container to run commands.

it would be great if someone can review it and test a installation with these infos.
I am working on Mac M1. So the paragraph for building the image is maybe a little bit personally.

@Chris53897 Chris53897 marked this pull request as ready for review April 27, 2021 18:17
Co-authored-by: Vincent <vincentchalamon@protonmail.com>
Chris53897 and others added 3 commits May 20, 2021 21:02
Co-authored-by: Vincent <vincentchalamon@protonmail.com>
Co-authored-by: Vincent <vincentchalamon@protonmail.com>
…fix parameter "corsAllowOrigin" for use under Windows
@Chris53897 Chris53897 changed the title Improve helm for Version 3 (WIP) docs: Improve helm for Version 3 May 20, 2021
…grade --install". So you can reuse the command
@Chris53897
Copy link
Contributor Author

Any progress on this topic?
I don't see the one request change from @vincentchalamon that i need to resolve to go further.


Firstly you need to update helm dependencies by running:
helm dependency update ./helm/api-platform
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it work on your install? On api-platform/demo, I had to do the following;

helm repo add bitnami https://charts.bitnami.com/bitnami/
helm repo add stable https://charts.helm.sh/stable/
helm dependency build ./helm/api-platform

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It worked for us. It will update chart.lock and add the /charts/postgresql-10.3.18.tgz
But i need to check it. The gitlab-ci File has a part that scans dependencies and add it dynamically.

local pc:
➜ project git:(main) ✗ helm repo list
Error: no repositories to show
➜ project git:(main) ✗ helm dependency update ./helm/api-platform
Getting updates for unmanaged Helm repositories...
...Successfully got an update from the "https://charts.bitnami.com/bitnami/" chart repository
Saving 1 charts
Downloading postgresql from repo https://charts.bitnami.com/bitnami/
Deleting outdated charts


helm dependency update ./api/helm/api
This will create a folder /charts/ and add all dependencies there.
Actual this is [bitnami/postgresql](https://bitnami.com/stack/postgresql/helm), a file postgresql-[VERSION].tgz is created.
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand the first part of this sentence...

### 4. Deploy your API to the container

helm upgrade api-platform ./helm/api-platform --namespace=default \
--install \
Copy link
Contributor

Choose a reason for hiding this comment

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

What about the ingress and mercure?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Company does not use mercure right know. (We removed vulcain and mercure for faster build times) So i do not have much knowledge here. The Domain for ingress was hardcodet. I have to compare Company code to api-platform code.

--set postgresql.url=pgsql://username:password@host/database?serverVersion=9.6
--set postgresql.url=pgsql://username:password@host/database?serverVersion=13

Finally, build the `pwa` (client and admin) JavaScript apps and [deploy them on a static
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't use static version built of the PWA on api-platform, now we're using Next.js static generation. You can have a look at the demo PWA as an example.

But in a sense, you're still right as building the PWA and deploying it on a static server is still possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you please make a suggestion on how to change this? We are using an Angular Frontend not tied to API-Platform. I do not have knowledge in this topic.

--set "pwa.image.repository=gcr.io/test-api-platform/pwa" \
--set pwa.image.tag=latest \
--set php.appSecret='!ChangeMe!' \
--set postgresql.postgresqlPassword='!ChangeMe!' \
Copy link
Contributor

Choose a reason for hiding this comment

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

While updating an existing database, this might cause issues. I don't recommend to change the database password on update. That's why I had to do the following on api-platform/demo:

if ! kubectl get namespace $GITHUB_REF_SLUG > /dev/null 2>&1; then
    // install
else
    // update
fi

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i do not recommend to change the database password with the upgrade. We have an Database on a server outside of kubernetes and the password stays the same. with upgrade --install there is only one command needed.

Chris53897 and others added 9 commits October 27, 2021 19:39
Co-authored-by: Vincent <vincentchalamon@protonmail.com>
Co-authored-by: Vincent <vincentchalamon@protonmail.com>
Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
Co-authored-by: Vincent <vincentchalamon@protonmail.com>
Change name to 'main'

Co-authored-by: Vincent <vincentchalamon@protonmail.com>
@dunglas
Copy link
Member

dunglas commented Oct 27, 2021

I suggest merging this as is, as it fixes most current issues.
I'm rewriting this tutorial based on what I've done for Minikube, in the meantime, this contribution is better. WDYT @vincentchalamon?

@vincentchalamon
Copy link
Contributor

@dunglas OK for me. We can merge it, and fix the typos and errors in a new PR

@dunglas dunglas merged commit ee1d608 into api-platform:2.6 Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants