mirror of
				https://github.com/siderolabs/talos.git
				synced 2025-11-04 02:11:12 +01:00 
			
		
		
		
	fix: containerd log symlink
Kubelet creates symlinks from /var/log/containers/<pod>.log to the log file /var/log/pod/<pod-folder>/0.log Log senders (like fluentd) usually watch the folder /var/log/containers/*.log Kubelet needs to share containers folder. Signed-off-by: Serge Logvinov <serge.logvinov@sinextra.dev> Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
This commit is contained in:
		
							parent
							
								
									efa7f48e08
								
							
						
					
					
						commit
						d9eb18bfdd
					
				@ -732,7 +732,7 @@ func SetupSharedFilesystems(seq runtime.Sequence, data interface{}) (runtime.Tas
 | 
				
			|||||||
// SetupVarDirectory represents the SetupVarDirectory task.
 | 
					// SetupVarDirectory represents the SetupVarDirectory task.
 | 
				
			||||||
func SetupVarDirectory(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string) {
 | 
					func SetupVarDirectory(seq runtime.Sequence, data interface{}) (runtime.TaskExecutionFunc, string) {
 | 
				
			||||||
	return func(ctx context.Context, logger *log.Logger, r runtime.Runtime) (err error) {
 | 
						return func(ctx context.Context, logger *log.Logger, r runtime.Runtime) (err error) {
 | 
				
			||||||
		for _, p := range []string{"/var/log/pods", "/var/lib/kubelet", "/var/run/lock"} {
 | 
							for _, p := range []string{"/var/log/containers", "/var/log/pods", "/var/lib/kubelet", "/var/run/lock"} {
 | 
				
			||||||
			if err = os.MkdirAll(p, 0o700); err != nil {
 | 
								if err = os.MkdirAll(p, 0o700); err != nil {
 | 
				
			||||||
				return err
 | 
									return err
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
				
			|||||||
@ -168,6 +168,7 @@ func (k *Kubelet) Runner(r runtime.Runtime) (runner.Runner, error) {
 | 
				
			|||||||
		{Type: "bind", Destination: "/var/run", Source: "/run", Options: []string{"rbind", "rshared", "rw"}},
 | 
							{Type: "bind", Destination: "/var/run", Source: "/run", Options: []string{"rbind", "rshared", "rw"}},
 | 
				
			||||||
		{Type: "bind", Destination: "/var/lib/containerd", Source: "/var/lib/containerd", Options: []string{"rbind", "rshared", "rw"}},
 | 
							{Type: "bind", Destination: "/var/lib/containerd", Source: "/var/lib/containerd", Options: []string{"rbind", "rshared", "rw"}},
 | 
				
			||||||
		{Type: "bind", Destination: "/var/lib/kubelet", Source: "/var/lib/kubelet", Options: []string{"rbind", "rshared", "rw"}},
 | 
							{Type: "bind", Destination: "/var/lib/kubelet", Source: "/var/lib/kubelet", Options: []string{"rbind", "rshared", "rw"}},
 | 
				
			||||||
 | 
							{Type: "bind", Destination: "/var/log/containers", Source: "/var/log/containers", Options: []string{"rbind", "rshared", "rw"}},
 | 
				
			||||||
		{Type: "bind", Destination: "/var/log/pods", Source: "/var/log/pods", Options: []string{"rbind", "rshared", "rw"}},
 | 
							{Type: "bind", Destination: "/var/log/pods", Source: "/var/log/pods", Options: []string{"rbind", "rshared", "rw"}},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user