GoogleContainerTools / GoogleContainerTools/skaffold

Pin namespace for certain resources even when -n option is used

Open
#5,011 1 comment 0 reactions 0 assignees View on GitHub
area/deploy kind/feature-request kind/friction priority/p3
Dominant language
Go
Stars
15.9k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

### Expected behavior
I want to pin the namespace for source resources even when the `-n` option is used for `skaffold dev -n `

For example, I have an istio authorization policy that needs to be deployed to the `default` namespace. At the same time, my other resources need to go to another custom namespace .

*manifests/security.yaml*
```yaml
apiVersion: security.istio.io/v1beta1
kind: AuthorizationPolicy
metadata:
name: deny-all
namespace: default
spec:
{}
```
So I would like to use `skaffold dev -n ` while still have the authorzation policy to be deployed to the `default` namespace.
Is there a way to pin the namespace for it?

### Actual behavior

All resources will go to

### Information

- Skaffold version: v1.13.1
- Operating system: Linux yuhuishi-ubuntu-server 5.4.0-47-generic #51~18.04.1-Ubuntu SMP Sat Sep 5 14:35:50 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
- Contents of skaffold.yaml:

```yaml
apiVersion: skaffold/v2beta6
kind: Config
metadata:
name: convect-ui-public
build:
local:
push: false
artifacts:
- image: convect-jupyter
context: extern/jupyterlab
- image: convect-web
context: convect
sync:
infer:
- '**/*.*'
- image: notebook-spawner-api
context: extern/spawner/spawner-api
sync:
infer:
- '**/*.*'
deploy:
kubectl:
manifests:
- config/manifests/hue-config.yaml
- config/manifests/jupyter-config.yaml
- config/manifests/mysql-config.yaml
- config/manifests/nbviewer-config.yaml
- convect/manifests/deployment.yaml
- extern/jupyterlab/manifests/deployment.yaml
- manifests/deployments.yaml
- manifests/network.yaml
- extern/spawner/spawner-api/manifests/deployment.yaml
- extern/spawner/spawner-api/manifests/roles.yaml
- manifests/security.yaml
portForward:
- resourceType: service
resourceName: istio-ingressgateway
namespace: istio-system
port: 80
localPort: 9000
address: 0.0.0.0
- resourceType: service
resourceName: istio-ingressgateway
namespace: istio-system
port: 443
localPort: 9001
address: 0.0.0.0
profiles:
- name: cicd
patches:
- op: replace
path: /build/local/push
value: true
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.