Coder Social home page Coder Social logo

Comments (4)

zhangjianweibj avatar zhangjianweibj commented on July 2, 2024

modify sidecar-confimg.yaml file,bu still no mounts


apiVersion: v1
kind: ConfigMap
metadata:
name: sidecar-telegraf-basic
namespace: monitoring
labels:
app: k8s-sidecar-injector
track: prod
data:
sidecar-telegraf-basic: |
name: sidecar-telegraf-basic
hostNetwork: true
hostPID: true
containers:
- name: telegraf-basic
image: registry.icp.com:5000/service/lma/mcp-telegraf:0.1
imagePullPolicy: IfNotPresent
ports:
- containerPort: 9126
volumeMounts:
- name: telegraf-basic-directory
mountPath: /etc/telegraf
volumes:
- name: telegraf-basic-directory
configMap:
name: telegraf-basic-config

configmap

apiVersion: v1
kind: ConfigMap
metadata:
name: telegraf-basic-config
namespace: monitoring
data:
telegraf.conf: |
[global_tags]
[agent]
interval = "15s"
round_interval = false
metric_batch_size = 1000
metric_buffer_limit = 10000
collection_jitter = "2s"

image

from k8s-sidecar-injector.

zhangjianweibj avatar zhangjianweibj commented on July 2, 2024
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: sidecar-telegraf-basic
  namespace: monitoring
  labels:
    app: k8s-sidecar-injector
    track: prod
data:
  sidecar-telegraf-basic: |
    name: sidecar-telegraf-basic
    hostNetwork: true
    hostPID: true
    containers:
    - name: telegraf-basic
      image: registry.icp.com:5000/service/lma/mcp-telegraf:0.1   
      imagePullPolicy: IfNotPresent
      ports:
        - containerPort: 9126
      volumeMounts:
        - name: telegraf-basic-directory
          mountPath: /etc/telegraf
    volumes:
    - name: telegraf-basic-directory
      configMap:
        name: telegraf-basic-config
---
# configmap
apiVersion: v1
kind: ConfigMap
metadata:
  name: telegraf-basic-config
  namespace: monitoring
data:
  telegraf.conf: |
    [global_tags]
    [agent]
      interval = "15s"
      round_interval = false
      metric_batch_size = 1000
      metric_buffer_limit = 10000
      collection_jitter = "2s"

from k8s-sidecar-injector.

byxorna avatar byxorna commented on July 2, 2024

hi @zhangjianweibj

If you look at the full kubectl describe pod/... output for the created pod, there should be an annotation added indicating whether or not the injector was able to successfully modify your pod. If the annotation is not present, it points to a misconfiguration in your K8s mutating webhook configuration. If the annotation is present and says it succeeded, that makes me think there is a configuration issue in your ConfigMap - perhaps keys for Volumes at the wrong level, or something?

Please include the logs from the injector's startup - it will tell you how many volumes/containers/env vars it has loaded for each sidecar config. This is a good litmus test to confirm the sidecar injector is reading your configuration properly.

from k8s-sidecar-injector.

zhangjianweibj avatar zhangjianweibj commented on July 2, 2024

ok,very thanks。

from k8s-sidecar-injector.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.