Giter Club home page Giter Club logo

skywalking-injection's People

Contributors

lipangeng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

skywalking-injection's Issues

not match %s{ v1 pods}

k8s version

1.21.6

MutatingWebhookConfiguration

apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
  name: skywalking-injector
webhooks:
  - admissionReviewVersions: ["v1", "v1beta1"]
    failurePolicy: Fail
    clientConfig:
      caBundle: "xxxxxxxxxxxxxxx"
      service:
        name: skywalking-injection
        namespace: skywalking
    objectSelector:
      matchLabels:
        skywalking-injection: "true"
    name: injection.skywalking.com
    timeoutSeconds: 5
    sideEffects: None
    rules:
      - apiGroups: ["*"]
        apiVersions: ["v1","v1beta1"]
        operations:  ["CREATE","UPDATE"]
        resources:   ["pods","deployments"]
        scope: "Namespaced"

Demo

apiVersion: v1
kind: Pod
metadata:
  labels:
    app: nginx
    skywalking-injection: "true"
    skywalking-volume: sw-volume-09befabe
  name: nginx
  namespace: atai-dev
spec:
  containers:
    - image: nginx
      imagePullPolicy: IfNotPresent
      name: nginx
      volumeMounts:
        - mountPath: /opt/skywalking
          name: sw-volume-09befabe
  volumes:
    - emptyDir:
        sizeLimit: 200Mi
      name: sw-volume-09befabe

Response

 I0411 05:41:02.716694       7 server.go:35] handling request: {"kind":"AdmissionReview","apiVersion":"admission.k8s.io/v1","request":{"uid":"034e7ad1-0e07-4f9b-b6e4-64f7b35ac830","kind":{"group":"","version":"v1","kind":"Pod"},"resource":{"group":"","version":"v1","resource":"pods"},"requestKind":{"group":"","version":"v1","kind":"Pod"},"requestResource":{"group":"","version":"v1","resource":"pods"},"name":"nginx","namespace":"atai-dev","operation":"CREATE","userInfo":{"username":"kubernetes-admin","groups":["system:masters","system:authenticated"]},"object":{"kind":"Pod","apiVersion":"v1","metadata":{"name":"nginx","namespace":"atai-dev","creationTimestamp":null,"labels":{"app":"nginx","skywalking-injection":"true","skywalking-volume":"sw-volume-09befabe"},"annotations":{"kubectl.kubernetes.io/last-applied-configuration":"{\"apiVersion\":\"v1\",\"kind\":\"Pod\",\"metadata\":{\"annotations\":{},\"labels\":{\"app\":\"nginx\",\"skywalking-injection\":\"true\",\"skywalking-volume\":\"sw-volume-09befabe\"},\"name\":\"nginx\",\"namespace\":\"atai-dev\"},\"spec\":{\"containers\":[{\"image\":\"nginx\",\"imagePullPolicy\":\"IfNotPresent\",\"name\":\"nginx\",\"volumeMounts\":[{\"mountPath\":\"/opt/skywalking\",\"name\":\"sw-volume-09befabe\"}]}],\"volumes\":[{\"emptyDir\":{\"sizeLimit\":\"200Mi\"},\"name\":\"sw-volume-09befabe\"}]}}\n","kubernetes.io/limit-ranger":"LimitRanger plugin set: memory request for container nginx"},"managedFields":[{"manager":"kubectl-client-side-apply","operation":"Update","apiVersion":"v1","time":"2022-04-11T05:41:02Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:annotations":{".":{},"f:kubectl.kubernetes.io/last-applied-configuration":{}},"f:labels":{".":{},"f:app":{},"f:skywalking-injection":{},"f:skywalking-volume":{}}},"f:spec":{"f:containers":{"k:{\"name\":\"nginx\"}":{".":{},"f:image":{},"f:imagePullPolicy":{},"f:name":{},"f:resources":{},"f:terminationMessagePath":{},"f:terminationMessagePolicy":{},"f:volumeMounts":{".":{},"k:{\"mountPath\":\"/opt/skywalking\"}":{".":{},"f:mountPath":{},"f:name":{}}}}},"f:dnsPolicy":{},"f:enableServiceLinks":{},"f:restartPolicy":{},"f:schedulerName":{},"f:securityContext":{},"f:terminationGracePeriodSeconds":{},"f:volumes":{".":{},"k:{\"name\":\"sw-volume-09befabe\"}":{".":{},"f:emptyDir":{".":{},"f:sizeLimit":{}},"f:name":{}}}}}}]},"spec":{"volumes":[{"name":"sw-volume-09befabe","emptyDir":{"sizeLimit":"200Mi"}},{"name":"kube-api-access-fjwb4","projected":{"sources":[{"serviceAccountToken":{"expirationSeconds":3607,"path":"token"}},{"configMap":{"name":"kube-root-ca.crt","items":[{"key":"ca.crt","path":"ca.crt"}]}},{"downwardAPI":{"items":[{"path":"namespace","fieldRef":{"apiVersion":"v1","fieldPath":"metadata.namespace"}}]}}]}}],"containers":[{"name":"nginx","image":"nginx","resources":{"requests":{"memory":"1Gi"}},"volumeMounts":[{"name":"sw-volume-09befabe","mountPath":"/opt/skywalking"},{"name":"kube-api-access-fjwb4","readOnly":true,"mountPath":"/var/run/secrets/kubernetes.io/serviceaccount"}],"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File","imagePullPolicy":"IfNotPresent"}],"restartPolicy":"Always","terminationGracePeriodSeconds":30,"dnsPolicy":"ClusterFirst","serviceAccountName":"default","serviceAccount":"default","securityContext":{},"schedulerName":"default-scheduler","tolerations":[{"key":"node.kubernetes.io/not-ready","operator":"Exists","effect":"NoExecute","tolerationSeconds":300},{"key":"node.kubernetes.io/unreachable","operator":"Exists","effect":"NoExecute","tolerationSeconds":300}],"priority":0,"enableServiceLinks":true,"preemptionPolicy":"PreemptLowerPriority"},"status":{}},"oldObject":null,"dryRun":false,"options":{"kind":"CreateOptions","apiVersion":"meta.k8s.io/v1","fieldManager":"kubectl-client-side-apply"}}}

 I0411 05:41:02.716964       7 pods.go:37] mutating pods

 W0411 05:41:02.717288       7 pods.go:68] not match %s{ v1 pods}

 I0411 05:41:02.717335       7 server.go:59] sending response: &AdmissionResponse{UID:034e7ad1-0e07-4f9b-b6e4-64f7b35ac830,Allowed:true,Result:nil,Patch:nil,PatchType:nil,AuditAnnotations:map[string]string{},}

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.