If the quickbuild server and agent are in the same cluster, it works well by creating a Nodeport type service. However, we are in a situation where the server and agent are in different clusters, so clusterip type service and ingress must be automatically created for each agent. Pod definitions work well in the plugin's pod customization. However, if you enter service or ingress code, it is not created as follows.
=============== error message ===============
"Failed to run command: /root/kubectl --kubeconfig /root/quickbuild-13.0.39/k8s/config apply -k . Command return code: 1 Command error output: # Warning: 'bases' is deprecated. Please use 'resources' instead. Run 'kustomize edit fix' to update your Kustomization automatically. # Warning: 'patchesStrategicMerge' is deprecated. Please use 'patches' instead. Run 'kustomize edit fix' to update your Kustomization automatically. error: no matches for Id Ingress.v1beta1.networking.k8s.io/aaa-ing.default; failed to find unique target for patch Ingress.v1beta1.networking.k8s.io/aaa-ing.default"
================error message end ===================
The way the command is executed is as follows, but I cannot tell where the content defined in pod kustomization is temporarily created and disappeared on the server. If I know the location, I want to process the error by placing a pre-defined yaml for the part where the error occurs. What server location handles "."? In other words, where is the server where the command below is executed? It seems that the kubectl or config file specified in the Kubernetes plugin settings does not exist.
Or is there another way to create services and ingress through pod kustomization?
======error message command ============
"/root/kubectl --kubeconfig /root/quickbuild-13.0.39/k8s/config apply -k ."
==========================
============= test pod kustomization code =================
apiVersion: v1
kind: Pod
metadata:
name: ${name}
labels:
aa: test
spec:
containers:
- name: ${name}
imagePullPolicy: ${imagePullPolicy}
ports:
- containerPort: 8811
nodeSelector:
beta.kubernetes.io/os: linux
restartPolicy: Never
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: aaa-ing
namespace: default
spec:
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
serviceName: aaa
servicePort: 80