bh90210 / dron8s

Yet another Kubernetes plugin for Drone using dynamic Server Side Apply to achieve --server-side parity for your CI-CD pipelines
http://plugins.drone.io/bh90210/dron8s
The Unlicense
20 stars 5 forks source link

Namespace #27

Closed keinou closed 2 years ago

keinou commented 2 years ago

how define the namespace of apply?

bh90210 commented 2 years ago

the namespace should be defined in the config file

ie.

apiVersion: v1
kind: Service
metadata:
  name: test
  namespace: customnamespace
spec:
  type: LoadBalancer
  ports:
  - port: 80
    targetPort: 8080
  selector:
    app: hello-kubernetes
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: hello-kubernetes
  namespace: customnamespace
spec:
  replicas: 3
  selector:
    matchLabels:
      app: hello-kubernetes
  template:
    metadata:
      labels:
        app: hello-kubernetes
    spec:
      containers:
      - name: hello-kubernetes
        image: paulbouwer/hello-kubernetes:1.8
        ports:
        - containerPort: 8080
keinou commented 2 years ago

Thanks

bh90210 commented 2 years ago

https://kubernetes.io/docs/tasks/administer-cluster/namespaces/ also if namespace does not exists yet you can place this in your yaml config before the service

apiVersion: v1
kind: Namespace
metadata:
  name: <insert-namespace-name-here>