Important: RKE add-on install is only supported up to Rancher v2.0.8

Please use the Rancher Helm chart to install Rancher on a Kubernetes cluster. For details, see the Kubernetes Install .

If you are currently using the RKE add-on install method, see Migrating from a Kubernetes Install with an RKE Add-on for details on how to move to using the helm chart.

If you’re using RKE to install Rancher, you can use directives to enable API Auditing for your Rancher install. You can know what happened, when it happened, who initiated it, and what cluster it affected. API auditing records all requests and responses to and from the Rancher API, which includes use of the Rancher UI and any other use of the Rancher API through programmatic use.

In-line Arguments

Enable API Auditing using RKE by adding arguments to your Rancher container.

To enable API auditing:

  • Add API Auditing arguments (args) to your Rancher container.
  • Declare a mountPath in the volumeMounts directive of the container.
  • Declare a path in the volumes directive.

For more information about each argument, its syntax, and how to view API Audit logs, see Rancher v2.0 Documentation: API Auditing.

  1. ...
  2. containers:
  3. - image: rancher/rancher:latest
  4. imagePullPolicy: Always
  5. name: cattle-server
  6. args: ["--audit-log-path", "/var/log/auditlog/rancher-api-audit.log", "--audit-log-maxbackup", "5", "--audit-log-maxsize", "50", "--audit-level", "2"]
  7. ports:
  8. - containerPort: 80
  9. protocol: TCP
  10. - containerPort: 443
  11. protocol: TCP
  12. volumeMounts:
  13. - mountPath: /etc/rancher/ssl
  14. name: cattle-keys-volume
  15. readOnly: true
  16. - mountPath: /var/log/auditlog
  17. name: audit-log-dir
  18. volumes:
  19. - name: cattle-keys-volume
  20. secret:
  21. defaultMode: 420
  22. secretName: cattle-keys-server
  23. - name: audit-log-dir
  24. hostPath:
  25. path: /var/log/rancher/auditlog
  26. type: Directory