Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

kubernetes plugin Pod Customization #3759

freecode82 ·

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
  • replies 2
  • views 1081
  • stars 0
robinshen ADMIN ·

Currently only pod definition can be customized. There is no service definition for customization yet. I filed an improvement request as https://track.pmease.com/browse/QB-4025.

The directory for kubectl apply is a temp directory created by QB and will be deleted afterwards. If you want to check it in detail, you may want to check the method "createResource" in class "KubernetesNodeLauncher" in QB source code.

freecode82 ·

Thank you for answer. I hope Quick Build improves a lot.
Now, I am using the latest plugin and modifying it to make it work the way I want.