-
Notifications
You must be signed in to change notification settings - Fork 5
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
Create ns with kubectl when using helm3 #713
Conversation
* 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()
@@ -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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
* inviqa/harness-base-php#727 * inviqa/harness-base-php#760 * inviqa/harness-base-php#752 * inviqa/harness-base-php#717 * inviqa/harness-base-php#777 * inviqa/harness-base-php#686 * inviqa/harness-base-php#713 * inviqa/harness-base-php#770 * inviqa/harness-base-php#759 * inviqa/harness-base-php#707 - except v2 rather than v1
* inviqa/harness-base-php#727 * inviqa/harness-base-php#760 * inviqa/harness-base-php#752 * inviqa/harness-base-php#717 * inviqa/harness-base-php#777 * inviqa/harness-base-php#686 * inviqa/harness-base-php#713 * inviqa/harness-base-php#770 * inviqa/harness-base-php#759 * inviqa/harness-base-php#707 - except v2 rather than v1
* inviqa/harness-base-php#727 * inviqa/harness-base-php#760 * inviqa/harness-base-php#752 * inviqa/harness-base-php#717 * inviqa/harness-base-php#777 * inviqa/harness-base-php#686 * inviqa/harness-base-php#713 * inviqa/harness-base-php#770 * inviqa/harness-base-php#759 * inviqa/harness-base-php#707 - except v2 rather than v1
* inviqa/harness-base-php#727 * inviqa/harness-base-php#760 * inviqa/harness-base-php#752 * inviqa/harness-base-php#717 * inviqa/harness-base-php#777 * inviqa/harness-base-php#686 * inviqa/harness-base-php#713 * inviqa/harness-base-php#770 * inviqa/harness-base-php#759 * inviqa/harness-base-php#707 - except v2 rather than v1
📚 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.