Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to merge multiple deployment yaml files in k8s into one yaml file without using the separator '---'? [closed]

As mentioned above, I want to merge multiple deployment yaml files in k8s into one yaml file, but because of the project, I can't use the separator "---".

like image 815
AIMarvel Avatar asked Nov 07 '22 04:11

AIMarvel


1 Answers

You can use a list:

apiVersion: v1
kind: List
items:
- apiVersion: v1
  kind: ConfigMap
  metadata:
    name: cm1
- apiVersion: v1
  kind: ConfigMap
  metadata:
    name: cm2

$ kubectl apply -f list.yaml
configmap/cm1 created
configmap/cm2 created
like image 86
Ghokun Avatar answered Nov 15 '22 07:11

Ghokun