fluxcd / flux

Successor: https://github.com/fluxcd/flux2
https://fluxcd.io
Apache License 2.0
6.9k stars 1.08k forks source link

imageupdateautomation / unable to clone: dial tcp xx.xx.xx.xx:22 connect: connection timed out #3595

Closed joerg-walter-de closed 2 years ago

joerg-walter-de commented 2 years ago

Describe the bug

I have an image update automation as follows (and another one):

apiVersion: image.toolkit.fluxcd.io/v1beta1
kind: ImageUpdateAutomation
metadata:
  name: test-cicd-image-update-automation
  namespace: frontend-test
spec:
  interval: 1m0s
  sourceRef:
    kind: GitRepository
    name: frontend-test
  git:
    checkout:
      ref:
        branch: master
    commit:
      author:
        email: gitlab_deployment@xxx.xxx
        name: fluxcdbot
      messageTemplate: '{{range .Updated.Images}}{{println .}}{{end}}'
    push:
      branch: master
  update:
    path: ./clusters/development
    strategy: Setters

An Gitlab repo:

---
apiVersion: source.toolkit.fluxcd.io/v1beta1
kind: GitRepository
metadata:
  name: frontend-test
  namespace: frontend-test
spec:
  gitImplementation: go-git
  interval: 1m0s
  ref:
    branch: master
  secretRef:
    name:  frontend-test
  timeout: 20s
  url: ssh://git@xxx.xxx/xxx/frontend-test

After restarting the image automation controller they work for a bit but then fall into producing an error message:

unable to clone: dial tcp xx.xx.xx.xx:22: connect: connection timed out

from the controller log:

{"level":"info","ts":"2022-03-10T01:19:54.099Z","logger":"controller-runtime.metrics","msg":"Metrics server is starting to listen","addr":":8080"}
{"level":"info","ts":"2022-03-10T01:19:54.100Z","logger":"setup","msg":"starting manager"}
{"level":"info","ts":"2022-03-10T01:19:54.101Z","msg":"Starting server","path":"/metrics","kind":"metrics","addr":"[::]:8080"}
{"level":"info","ts":"2022-03-10T01:19:54.101Z","msg":"Starting server","kind":"health probe","addr":"[::]:9440"}
I0310 01:19:54.202365       1 leaderelection.go:248] attempting to acquire leader lease flux-system/image-automation-controller-leader-election...
I0310 01:20:49.326455       1 leaderelection.go:258] successfully acquired lease flux-system/image-automation-controller-leader-election  
{"level":"info","ts":"2022-03-10T01:20:49.327Z","logger":"controller.imageupdateautomation","msg":"Starting EventSource","reconciler group":"image.toolkit.fluxcd.io","reconciler kind":"ImageUpdateAutomation","source":"kind source: *v1beta1.ImageUpdateAutomation"}
{"level":"info","ts":"2022-03-10T01:20:49.327Z","logger":"controller.imageupdateautomation","msg":"Starting EventSource","reconciler group":"image.toolkit.fluxcd.io","reconciler kind":"ImageUpdateAutomation","source":"kind source: *v1beta1.GitRepository"}
{"level":"info","ts":"2022-03-10T01:20:49.327Z","logger":"controller.imageupdateautomation","msg":"Starting EventSource","reconciler group":"image.toolkit.fluxcd.io","reconciler kind":"ImageUpdateAutomation","source":"kind source: *v1beta1.ImagePolicy"}
{"level":"info","ts":"2022-03-10T01:20:49.327Z","logger":"controller.imageupdateautomation","msg":"Starting Controller","reconciler group":"image.toolkit.fluxcd.io","reconciler kind":"ImageUpdateAutomation"}
{"level":"info","ts":"2022-03-10T01:20:49.429Z","logger":"controller.imageupdateautomation","msg":"Starting workers","reconciler group":"image.toolkit.fluxcd.io","reconciler kind":"ImageUpdateAutomation","worker count":4}
{"level":"info","ts":"2022-03-10T01:20:53.456Z","logger":"controller.imageupdateautomation","msg":"pushed commit to origin","reconciler group":"image.toolkit.fluxcd.io","reconciler kind":"ImageUpdateAutomation","name":"test-cicd-image-update-automation","namespace":"frontend-test","revision":"xxx","branch":"master"}
{"level":"info","ts":"2022-03-10T01:40:14.497Z","logger":"controller.imageupdateautomation","msg":"pushed commit to origin","reconciler group":"image.toolkit.fluxcd.io","reconciler kind":"ImageUpdateAutomation","name":"test-cicd-image-update-automation","namespace":"frontend-test","revision":"xxx","branch":"master"}
{"level":"info","ts":"2022-03-10T01:49:50.502Z","logger":"controller.imageupdateautomation","msg":"pushed commit to origin","reconciler group":"image.toolkit.fluxcd.io","reconciler kind":"ImageUpdateAutomation","name":"test-cicd-image-update-automation","namespace":"frontend-test","revision":"xxx","branch":"master"}
{"level":"error","ts":"2022-03-10T05:42:33.811Z","logger":"controller.imageupdateautomation","msg":"Reconciler error","reconciler group":"image.toolkit.fluxcd.io","reconciler kind":"ImageUpdateAutomation","name":"xxx","namespace":"xxx","error":"unable to clone: dial tcp XX.XX.XX.XX:22: connect: connection timed out"}
{"level":"error","ts":"2022-03-10T05:42:35.862Z","logger":"controller.imageupdateautomation","msg":"Reconciler error","reconciler groimage.toolkit.fluxcd.io","reconciler kind":"ImageUpdateAutomation","name":"test-cicd-image-update-automation","namespace":"frontend-test", "error":"unable to clone: dial tcp xx.xx.xx.xx:22: connect: connection timed out"}

Steps to reproduce

na

Expected behavior

The repo is updated

Kubernetes version / Distro / Cloud provider

1.22.4 AKS

Flux version

0.26.3

Git provider

Gitlab self-managed

Container Registry provider

Gitlab self-managed

Additional context

► checking prerequisites ✗ flux 0.26.3 <0.27.3 (new version is available, please upgrade) ✔ Kubernetes 1.22.4 >=1.20.6-0 ► checking controllers ✔ helm-controller: deployment ready ► ghcr.io/fluxcd/helm-controller:v0.16.0 ✔ image-automation-controller: deployment ready ► ghcr.io/fluxcd/image-automation-controller:v0.20.0 ✔ image-reflector-controller: deployment ready ► ghcr.io/fluxcd/image-reflector-controller:v0.16.0 ✔ kustomize-controller: deployment ready ► ghcr.io/fluxcd/kustomize-controller:v0.20.2 ✔ notification-controller: deployment ready ► ghcr.io/fluxcd/notification-controller:v0.21.0 ✔ source-controller: deployment ready ► ghcr.io/fluxcd/source-controller:v0.21.2 ✔ all checks passed

Maintenance Acknowledgement

Code of Conduct