Skip to content

Commit 38376ff

Browse files
committed
add FallbackToLogsOnError for easier debugging
1 parent c9de8bd commit 38376ff

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

install/0000_30_machine-api-operator_11_deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ spec:
4646
requests:
4747
memory: 20Mi
4848
cpu: 10m
49+
terminationMessagePolicy: FallbackToLogsOnError
4950
volumeMounts:
5051
- name: config
5152
mountPath: /etc/kube-rbac-proxy
@@ -78,6 +79,7 @@ spec:
7879
requests:
7980
cpu: 10m
8081
memory: 50Mi
82+
terminationMessagePolicy: FallbackToLogsOnError
8183
volumeMounts:
8284
- name: images
8385
mountPath: /etc/machine-api-operator-config/images

pkg/operator/sync.go

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,7 @@ func newContainers(config *OperatorConfig, features map[string]bool) []corev1.Co
692692
},
693693
},
694694
},
695+
TerminationMessagePolicy: corev1.TerminationMessageFallbackToLogsOnError,
695696
VolumeMounts: []corev1.VolumeMount{
696697
{
697698
MountPath: "/etc/machine-api-operator/tls",
@@ -743,6 +744,7 @@ func newContainers(config *OperatorConfig, features map[string]bool) []corev1.Co
743744
},
744745
},
745746
},
747+
TerminationMessagePolicy: corev1.TerminationMessageFallbackToLogsOnError,
746748
VolumeMounts: []corev1.VolumeMount{
747749
{
748750
MountPath: "/etc/pki/ca-trust/extracted/pem",
@@ -762,12 +764,13 @@ func newContainers(config *OperatorConfig, features map[string]bool) []corev1.Co
762764
},
763765
},
764766
{
765-
Name: "nodelink-controller",
766-
Image: config.Controllers.NodeLink,
767-
Command: []string{"/nodelink-controller"},
768-
Args: args,
769-
Env: proxyEnvArgs,
770-
Resources: resources,
767+
Name: "nodelink-controller",
768+
Image: config.Controllers.NodeLink,
769+
Command: []string{"/nodelink-controller"},
770+
Args: args,
771+
Env: proxyEnvArgs,
772+
Resources: resources,
773+
TerminationMessagePolicy: corev1.TerminationMessageFallbackToLogsOnError,
771774
},
772775
}
773776
if config.Controllers.MachineHealthCheck != "" {
@@ -800,6 +803,7 @@ func newContainers(config *OperatorConfig, features map[string]bool) []corev1.Co
800803
},
801804
},
802805
},
806+
TerminationMessagePolicy: corev1.TerminationMessageFallbackToLogsOnError,
803807
})
804808
}
805809
return containers
@@ -843,11 +847,12 @@ func newKubeProxyContainer(image, portName, upstreamPort string, exposePort int3
843847
}}
844848

845849
return corev1.Container{
846-
Name: fmt.Sprintf("kube-rbac-proxy-%s", portName),
847-
Image: image,
848-
Args: args,
849-
Resources: resources,
850-
Ports: ports,
850+
Name: fmt.Sprintf("kube-rbac-proxy-%s", portName),
851+
Image: image,
852+
Args: args,
853+
Resources: resources,
854+
Ports: ports,
855+
TerminationMessagePolicy: corev1.TerminationMessageFallbackToLogsOnError,
851856
VolumeMounts: []corev1.VolumeMount{
852857
{
853858
Name: kubeRBACConfigName,

0 commit comments

Comments
 (0)