github.com/google/cadvisor@v0.49.1/deploy/kubernetes/README.md (about)

     1  # cAdvisor Kubernetes Daemonset
     2  
     3  cAdvisor uses [Kustomize](https://github.com/kubernetes-sigs/kustomize) to manage Kubernetes manifests. See the [Install Kustomize](https://kubectl.docs.kubernetes.io/installation/kustomize/) for installation instructions, and for a description of how it works.
     4  
     5  ## Deploy
     6  
     7  Pick a [cAdvisor release](https://github.com/google/cadvisor/releases)
     8  ```
     9  VERSION=v0.42.0
    10  ```
    11  
    12  Deploy to Kubernetes cluster with [remote build](https://github.com/kubernetes-sigs/kustomize/blob/master/examples/remoteBuild.md):
    13  ```
    14  kustomize build "https://github.com/google/cadvisor/deploy/kubernetes/base?ref=${VERSION}" | kubectl apply -f -
    15  ```
    16  
    17  ## Usage
    18  
    19  To update the image version([reference](https://github.com/kubernetes-sigs/kustomize/blob/master/examples/image.md)):
    20  ```
    21  cd deploy/kubernetes/base && kustomize edit set image gcr.io/cadvisor/cadvisor:${VERSION} && cd ../../..
    22  ```
    23  
    24  To generate the base daemonset:
    25  ```
    26  kubectl kustomize deploy/kubernetes/base
    27  ```
    28  
    29  To apply the base daemonset to your cluster:
    30  ```
    31  kubectl kustomize deploy/kubernetes/base | kubectl apply -f -
    32  ```
    33  
    34  To generate the daemonset with example patches applied:
    35  ```
    36  kubectl kustomize deploy/kubernetes/overlays/examples
    37  ```
    38  
    39  To apply the daemonset to your cluster with example patches applied:
    40  ```
    41  kubectl kustomize deploy/kubernetes/overlays/examples | kubectl apply -f -
    42  ```
    43  
    44  ### cAdvisor with perf support on Kubernetes
    45  
    46  Example of modifications needed to deploy cAdvisor with perf support is provided in [overlays/examples_perf](overlays/examples_perf) directory (modification to daemonset and configmap with perf events configuration).
    47  
    48  To generate and apply the daemonset with patches for cAdvisor with perf support:
    49  ```
    50  kubectl kustomize deploy/kubernetes/overlays/examples_perf | kubectl apply -f -
    51  ```
    52  
    53  ## Kustomization
    54  
    55  On your own fork of cAdvisor, create your own overlay directoy with your patches.  Copy patches from the example folder if you intend to use them, but don't modify the originals.  Commit your changes in your local branch, and use git to manage them the same way you would any other piece of code.
    56  
    57  To run the daemonset with your patches applied:
    58  ```
    59  kubectl kustomize deploy/kubernetes/overlays/<my_custom_overlays> | kubectl apply -f -
    60  ```
    61  
    62  To get changes made to the upstream cAdvisor daemonset, simply rebase your fork of cAdvisor on top of upstream.  Since you didn't make changes to the originals, you won't have any conflicts.