Skip to content

Commit

Permalink
Adding kubelet logging verbosity
Browse files Browse the repository at this point in the history
  • Loading branch information
kevchu3 committed Oct 26, 2020
1 parent 5959d09 commit b4e9fbe
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 2 deletions.
10 changes: 8 additions & 2 deletions day-two.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@ oc patch imagepruner.imageregistry.operator.openshift.io/cluster --type merge --
Refer to these instructions to configure chrony time service
* [Chrony time service]

### 5. Configure multitenant network policy
### 5. Configure kubelet logging verbosity

Refer to these instructions to configure kubelet logging verbosity
* [Kubelet logging verbosity]

### 6. Configure multitenant network policy

Using Network Policy, by default, all Pods in a project are accessible from other Pods and network endpoints. Refer to the documentation for information on [configuring multitenant network policy]. Refer to the documentation for steps to [configure this policy for new projects by default].

Expand All @@ -71,7 +76,7 @@ oc create -f template/multitenant-project-template.yaml -n openshift-config
oc patch project.config.openshift.io/cluster --type merge -p '{"spec":{"projectRequestTemplate":{"name":"multitenant-project-template"}}}'
```

### 6. [Restricted Network] - Configure support tools
### 7. [Restricted Network] - Configure support tools

Refer to these instructions to configure support tools for a restricted network
* [Support tools]
Expand All @@ -93,6 +98,7 @@ Kevin Chung
[3scale operator]: ./operator/3scale/
[automatically pruning images]: https://docs.openshift.com/container-platform/latest/applications/pruning-objects.html#pruning-images_pruning-objects
[Chrony time service]: ./machineconfig/chrony/
[Kubelet logging verbosity]: ./machineconfig/kubelet/
[configuring multitenant network policy]: https://docs.openshift.com/container-platform/latest/networking/network_policy/multitenant-network-policy.html
[configure this policy for new projects by default]: https://docs.openshift.com/container-platform/latest/networking/network_policy/default-network-policy.html
[example project template for multitenant network policy]: ./template/multitenant-project-template.yaml
Expand Down
25 changes: 25 additions & 0 deletions machineconfig/kubelet/02-kubelet-env-config-infra.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
labels:
machineconfiguration.openshift.io/role: infra
name: 02-kubelet-env-config-infra
spec:
config:
ignition:
config: {}
security:
tls: {}
timeouts: {}
version: 2.2.0
networkd: {}
passwd: {}
storage:
files:
- contents:
source: data:text/plain;charset=utf-8;base64,S1VCRUxFVF9MT0dfTEVWRUw9MQo=
verification: {}
filesystem: root
mode: 420
path: /etc/kubernetes/kubelet-env
osImageURL: ""
25 changes: 25 additions & 0 deletions machineconfig/kubelet/02-kubelet-env-config-master.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
labels:
machineconfiguration.openshift.io/role: master
name: 02-kubelet-env-config-master
spec:
config:
ignition:
config: {}
security:
tls: {}
timeouts: {}
version: 2.2.0
networkd: {}
passwd: {}
storage:
files:
- contents:
source: data:text/plain;charset=utf-8;base64,S1VCRUxFVF9MT0dfTEVWRUw9MQo=
verification: {}
filesystem: root
mode: 420
path: /etc/kubernetes/kubelet-env
osImageURL: ""
25 changes: 25 additions & 0 deletions machineconfig/kubelet/02-kubelet-env-config-worker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
labels:
machineconfiguration.openshift.io/role: worker
name: 02-kubelet-env-config-worker
spec:
config:
ignition:
config: {}
security:
tls: {}
timeouts: {}
version: 2.2.0
networkd: {}
passwd: {}
storage:
files:
- contents:
source: data:text/plain;charset=utf-8;base64,S1VCRUxFVF9MT0dfTEVWRUw9MQo=
verification: {}
filesystem: root
mode: 420
path: /etc/kubernetes/kubelet-env
osImageURL: ""
16 changes: 16 additions & 0 deletions machineconfig/kubelet/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Configure Kubelet Logging Verbosity

Refer to this Knowledgebase article for [configuring kubelet logging verbosity].

### Step by step example

In this example, I have followed the article to create MachineConfigs to apply the logging level to `/etc/kubernetes/kubelet-env` which will persist across reboots.

Then, I applied the MachineConfigs to the cluster with:
```
oc apply -f 02-kubelet-env-config-master.yaml
oc apply -f 02-kubelet-env-config-worker.yaml
oc apply -f 02-kubelet-env-config-infra.yaml # for clusters with infra tier
```

[configuring kubelet logging verbosity]: https://access.redhat.com/solutions/4619431

0 comments on commit b4e9fbe

Please sign in to comment.