Skip to content
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

Create ns with kubectl when using helm3 #713

Conversation

Chemaclass
Copy link
Contributor

📚 Description

When using helm3, the app deploy preview doesn't work because the namespace it's missing.

The solution is to create the k8s namespace right before running helm to ensure there is a k8s namespace in place.

kierenevans and others added 2 commits May 30, 2022 10:40
* Ignore in the phpstan baseline

```
 ------ -----------------------------------------------------------------------
  Line   Pyz/Client/Catalog/CatalogDependencyProvider.php
 ------ -----------------------------------------------------------------------
  147    Parameter inviqa#1 $rawCatalogSearchResultFormatterPlugin of class
         Spryker\Client\CatalogPriceProductConnector\Plugin\CurrencyAwareSugge
         stionByTypeResultFormatter constructor expects
         Spryker\Client\Search\Dependency\Plugin\ResultFormatterPluginInterfac
         e,
         Spryker\Client\SearchElasticsearch\Plugin\ResultFormatter\SuggestionB
         yTypeResultFormatterPlugin given.
 ------ -----------------------------------------------------------------------
```

* Downgrade phpstan to 1.6.9 as it is having issues with class_alias()
@kierenevans kierenevans enabled auto-merge (squash) November 8, 2022 17:32
@@ -91,6 +91,9 @@ command('app deploy <environment>'):
if helm version --short --client | grep '^Client: v2' >/dev/null 2>&1; then
passthru helm init --client-only
fi
if helm version --short --client | grep '^v3' >/dev/null 2>&1; then
kubectl --kubeconfig="${PWD}/kubectl.config.yaml" create ns "${NAMESPACE}" || true
fi
Copy link

@andytson andytson Nov 8, 2022

Choose a reason for hiding this comment

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

needs to be conditional for if the k8s server doesn't allow ns creation to the user. Not all uses will be necessarily for feature branch environments only, and so static environments may have namespace already created.

can't presume also can list namespaces either to check if it exists, although kubectl get namespace "${NAMESPACE}" might be useable.

Copy link

Choose a reason for hiding this comment

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

ah, nvm I forgot I mentioned this before, and the || true stops it causing breakage

@kierenevans kierenevans disabled auto-merge November 8, 2022 17:44
@kierenevans kierenevans enabled auto-merge (squash) November 8, 2022 22:19
@kierenevans kierenevans disabled auto-merge November 8, 2022 22:19
@kierenevans kierenevans merged commit 08c5f7e into inviqa:1.5.x Nov 8, 2022
@Chemaclass Chemaclass deleted the feature/create-ns-when-app-deploy-using-helm3 branch November 8, 2022 23:15
@andytson-inviqa andytson-inviqa added this to the 1.5.0 milestone May 12, 2023
@andytson-inviqa andytson-inviqa added enhancement New feature or request harness-all Changes required to all harness directories labels May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request harness-all Changes required to all harness directories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants