Missing namespace in deploy step when using kustomize deployment target
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start by locating the kustomize deployment target generation and the workflow template that creates the GitHub Action deploy step. Inspect the generated kustomization.yaml and deployment manifest, then verify that the configured namespace is applied consistently and passed to the deploy action; reproduce the workflow to confirm deployment succeeds for a non-default namespace.
Written by the indexing model from the issue text.
Description
Describe the bug
When creating a project using deployment type kustomize, the cli wizard will ask for target namespace:
✔ Please enter the namespace to place new resources in (default: default):
When using a non-default namespace, for example foo, the wizard will create the k8s deployment configuration like this:
apiVersion: apps/v1
kind: Deployment
metadata:
name: draft-demo
labels:
app: draft-demo
namespace: foo
However, the later workflow setup wizard will not prompt for target namespace, and generate a deployment step like this:
# Deploys application based on manifest files from previous step
- name: Deploy application
uses: Azure/k8s-deploy@v4
with:
action: deploy
manifests: ${{ steps.bake.outputs.manifestsBundle }}
images: |
${{ env.AZURE_CONTAINER_REGISTRY }}.azurecr.io/${{ env.CONTAINER_NAME }}:${{ github.sha }}
This deployment step will deploy to default namespace by default:
Run Azure/k8s-deploy@v4
with:
action: deploy
manifests: <omitted>
images: <omitted>
namespace: default # <---- default value for namespace
pull-images: true
strategy: basic
route-method: service
version-switch-buffer: 0
traffic-split-method: pod
percentage: 0
force: false
token: ***
annotate-namespace: true
private-cluster: false
skip-tls-verify: false
Hence, the deployment will fail with error like:
the namespace from the provided object "foo" does not match the namespace "default". You must pass '--namespace=foo' to perform this operation.
Mention the platform you are using
OSS draft
To Reproduce
Steps to reproduce the behavior:
See above description.
Expected behavior
When using kustomize deployment target:
- the namespace should be set in
kustomization.yamlinstead of k8s object spec. By using a kustomization level namespace settings, we can ensure all controlled k8s objects are created under the same namespace. - namespace settings should set in the deploy GitHub Action step.
- Dominant language
- Go
- Stars
- 644
- Forks
- 74
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Azure/draft
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 42/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
kind/cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
kubernetes-sigs/kueue#15947 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sympozium-ai/sympozium#627 ·