Traefik持久卷超时AKS

时间:2019-04-16 10:02:54

标签: azure kubernetes lets-encrypt kubernetes-helm traefik

我正在努力使Traefik在启用ACME的K8上工作。我想按照persistantVolume上的建议存储证书。这是因为请求证书是rateLimited,并且在pod重启的情况下,证书会丢失。下面是我用于稳定/ traefik(舵图)并安装在Azure AKS中的完整配置。

有些问题似乎不起作用(或者我只是错误地这样做)。

吊舱具有未绑定的即时PersistentVolume声明

这是我在启动Pod时收到的初始错误。奇怪的是,PersistantVolumeClaim实际上已经准备好了。当我在Azure门户中更改卷本身时,它还会说该卷已安装到我的服务器上

traefik-acme
Namespace: default
pv.kubernetes.io/bind-completed: yes
pv.kubernetes.io/bound-by-controller: yes
volume.beta.kubernetes.io/storage-provisioner: kubernetes.io/azure-disk
Creation Time: 2019-04-16T09:55 UTC
Status: Bound
Volume: pvc-b673da74-602d-11e9-a537-9275388
Access modes: ReadWriteOnce
Storage class: default

storageClass本身也是活动的:

$ kubectl get sc --all-namespaces
NAME                PROVISIONER                AGE
default (default)   kubernetes.io/azure-disk   4d
managed-premium     kubernetes.io/azure-disk   4d

当我再等待一会儿时,出现以下错误: Unable to mount volumes for pod "traefik-d65fcbc8b-lkzsh_default(b68c8aa3-602d-11e9-a537-92753888c74b)": timeout expired waiting for volumes to attach or mount for pod "default"/"traefik-d65fcbc8b-lkzsh". list of unmounted volumes=[acme]. list of unattached volumes=[config acme default-token-p2lgf]

这里是完整的K8s事件跟踪:

pod has unbound immediate PersistentVolumeClaims
default-scheduler
2019-04-16T09:55 UTC

Successfully assigned default/traefik-d65fcbc8b-lkzsh to aks-default-22301976-0
default-scheduler
2019-04-16T09:55 UTC

Unable to mount volumes for pod "traefik-d65fcbc8b-lkzsh_default(b68c8aa3-602d-11e9-a537-92753888c74b)": timeout expired waiting for volumes to attach or mount for pod "default"/"traefik-d65fcbc8b-lkzsh". list of unmounted volumes=[acme]. list of unattached volumes=[config acme default-token-p2lgf]
kubelet aks-default-22301976-0
2019-04-16T09:57 UTC

AttachVolume.Attach succeeded for volume "pvc-b673da74-602d-11e9-a537-92753888c74b"
attachdetach-controller
2019-04-16T09:58 UTC

Container image "traefik:1.7.9" already present on machine
kubelet aks-default-22301976-0
2019-04-16T10:01 UTC

Created container
kubelet aks-default-22301976-0
2019-04-16T10:00 UTC

Started container
kubelet aks-default-22301976-0
2019-04-16T10:00 UTC

Back-off restarting failed container
kubelet aks-default-22301976-0
2019-04-16T10:02 UTC

安装

完成Traefik舵图的安装:

helm install -f values.yaml stable/traefik --name traefik

下面是用于安装图表的完整values.yaml

## Default values for Traefik
image: traefik
imageTag: 1.7.9

testFramework:
  image: "dduportal/bats"
  tag: "0.4.0"

## can switch the service type to NodePort if required
serviceType: LoadBalancer
# loadBalancerIP: ""
# loadBalancerSourceRanges: []
whiteListSourceRange: []
externalTrafficPolicy: Cluster
replicas: 1
# startupArguments:
#   - "--ping"
#   - "--ping.entrypoint=http"

podDisruptionBudget: {}
  # maxUnavailable: 1
  # minAvailable: 2

# priorityClassName: ""

# rootCAs: []

resources: {}

debug:
  enabled: false

deploymentStrategy: {}
  # rollingUpdate:
  #   maxSurge: 1
  #   maxUnavailable: 0
  # type: RollingUpdate

securityContext: {}
env: {}

nodeSelector: {}
  # key: value
affinity: {}
  # key: value
tolerations: []
# - key: "key"
#   operator: "Equal|Exists"
#   value: "value"
#   effect: "NoSchedule|PreferNoSchedule|NoExecute(1.6 only)"
## Kubernetes ingress filters
# kubernetes:
  # endpoint:
  # namespaces:
  # - default
  # labelSelector:
  # ingressClass:
  # ingressEndpoint:
  #   hostname: "localhost"
  #   ip: "127.0.0.1"
  #   publishedService: "namespace/servicename"
  #   useDefaultPublishedService: false
proxyProtocol:
  enabled: false
  # trustedIPs is required when enabled
  trustedIPs: []
  # - 10.0.0.0/8
forwardedHeaders:
  enabled: false
  # trustedIPs is required when enabled
  trustedIPs: []
  # - 10.0.0.0/8

## Add arbitrary ConfigMaps to deployment
## Will be mounted to /configs/, i.e. myconfig.json would
## be mounted to /configs/myconfig.json.
configFiles: {}
  # myconfig.json: |
  #   filecontents...

## Add arbitrary Secrets to deployment
## Will be mounted to /secrets/, i.e. file.name would
## be mounted to /secrets/mysecret.txt.
## The contents will be base64 encoded when added
secretFiles: {}
  # mysecret.txt: |
  #   filecontents...

ssl:
  enabled: false
  enforced: false
  permanentRedirect: false
  upstream: false
  insecureSkipVerify: false
  generateTLS: false
  # defaultCN: "example.com"
    # or *.example.com
  defaultSANList: []
    # - example.com
    # - test1.example.com
  defaultIPList: []
    # - 1.2.3.4
  # cipherSuites: []
  # https://docs.traefik.io/configuration/entrypoints/#specify-minimum-tls-version
  # tlsMinVersion: VersionTLS12
  defaultCert: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUVtekNDQTRPZ0F3SUJBZ0lKQUpBR1FsTW1DMGt5TUEwR0NTcUdTSWIzRFFFQkJRVUFNSUdQTVFzd0NRWUQKVlFRR0V3SlZVekVSTUE4R0ExVUVDQk1JUTI5c2IzSmhaRzh4RURBT0JnTlZCQWNUQjBKdmRXeGtaWEl4RkRBUwpCZ05WQkFvVEMwVjRZVzF3YkdWRGIzSndNUXN3Q1FZRFZRUUxFd0pKVkRFV01CUUdBMVVFQXhRTktpNWxlR0Z0CmNHeGxMbU52YlRFZ01CNEdDU3FHU0liM0RRRUpBUllSWVdSdGFXNUFaWGhoYlhCc1pTNWpiMjB3SGhjTk1UWXgKTURJME1qRXdPVFV5V2hjTk1UY3hNREkwTWpFd09UVXlXakNCanpFTE1Ba0dBMVVFQmhNQ1ZWTXhFVEFQQmdOVgpCQWdUQ0VOdmJHOXlZV1J2TVJBd0RnWURWUVFIRXdkQ2IzVnNaR1Z5TVJRd0VnWURWUVFLRXd0RmVHRnRjR3hsClEyOXljREVMTUFrR0ExVUVDeE1DU1ZReEZqQVVCZ05WQkFNVURTb3VaWGhoYlhCc1pTNWpiMjB4SURBZUJna3EKaGtpRzl3MEJDUUVXRVdGa2JXbHVRR1Y0WVcxd2JHVXVZMjl0TUlJ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RGZDBFejNvQTZLCmhqUUY0L2lNYnpxUStQREFQR0YrVHFFQ2dZQmQ1YnZncjJMMURzV1FJU3M4MHh3MDBSZDdIbTRaQVAxdGJuNk8KK0IvUWVNRC92UXBaTWV4c1hZbU9lV2Noc3FCMnJ2eW1MOEs3WDY1NnRWdGFYay9nVzNsM3ZVNTdYSFF4Q3RNUwpJMVYvcGVSNHRiN24yd0ZncFFlTm1XNkQ4QXk4Z0xiaUZhRkdRSDg5QWhFa0dTd1d5cWJKc2NoTUZZOUJ5OEtUCkZaVWZsUUtCZ0V3VzJkVUpOZEJMeXNycDhOTE1VbGt1ZnJxbllpUTNTQUhoNFZzWkg1TXU0MW55Yi95NUUyMW4KMk55d3ltWGRlb3VJcFZjcUlVTXl0L3FKRmhIcFJNeVEyWktPR0QyWG5YaENNVlRlL0FQNDJod294Nm02QkZpQgpvemZFa2wwak5uZmREcjZrL1p2MlQ1TnFzaWxaRXJBQlZGOTBKazdtUFBIa0Q2R1ZMUUJ4Ci0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg==
  # Basic auth to protect all the routes. Can use htpasswd to generate passwords
  # > htpasswd -n -b testuser testpass
  # > testuser:$apr1$JXRA7j2s$LpVns9vsme8FHN0r.aSt11
  auth: {}
    # basic:
    #   testuser: $apr1$JXRA7j2s$LpVns9vsme8FHN0r.aSt11

kvprovider:
  ## If you want to run Traefik in HA mode, you will need to setup a KV Provider. Therefore you can choose one of
  ## * etcd
  ## * consul
  ## * boltdb
  ## * zookeeper
  ##
  ## ref: https://docs.traefik.io/user-guide/cluster/

  ## storeAcme has to be enabled to support HA Support using acme, but at least one kvprovider is needed
  storeAcme: false
  importAcme: false

  # etcd:
    # endpoint: etcd-service:2379
    # useAPIV3: false
    # watch: true
    # prefix: traefik

    ## Override default configuration template.
    ## For advanced users :)
    ##
    ## Optional
    # filename: consul.tmpl
    # username: foo
    # password: bar
    # tls:
    #   ca: "/etc/ssl/ca.crt"
    #   cert: "/etc/ssl/consul.crt"
    #   key: "/etc/ssl/consul.key"
    #   insecureSkipVerify: true
    #
  # consul:
    # endpoint: consul-service:8500
    # watch: true
    # prefix: traefik

    ## Override default configuration template.
    ## For advanced users :)
    ##
    ## Optional
    # filename: consul.tmpl
    # username: foo
    # password: bar
    # tls:
    #   ca: "/etc/ssl/ca.crt"
    #   cert: "/etc/ssl/consul.crt"
    #   key: "/etc/ssl/consul.key"
    #   insecureSkipVerify: true

    ## only relevant for etcd

acme:
  enabled: true
  email: me@gmail.com
  onHostRule: true
  staging: true
  logging: true
  # Configure a Let's Encrypt certificate to be managed by default.
  # This is the only way to request wildcard certificates (works only with dns challenge).
  domains:
    enabled: true
    # List of sets of main and (optional) SANs to generate for
    # for wildcard certificates see https://docs.traefik.io/configuration/acme/#wildcard-domains
    domainsList:
      - main: "*.k8s-test.hardstyletop40.com"
      # - sans:
        # - "k8s-test.hardstyletop40.com"
      # - main: "*.example2.com"
      # - sans:
      #   - "test1.example2.com"
      #   - "test2.example2.com"
  ## ACME challenge type: "tls-sni-01", "tls-alpn-01", "http-01" or "dns-01"
  ## Note the chart's default of tls-sni-01 has been DEPRECATED and (except in
  ## certain circumstances) DISABLED by Let's Encrypt. It remains as a default
  ## value in this chart to preserve legacy behavior and avoid a breaking
  ## change. Users of this chart should strongly consider making the switch to
  ## the recommended "tls-alpn-01" (avaialbe since v1.7), dns-01 or http-01
  ## (available since v1.5) challenge.
  challengeType: tls-alpn-01
  ## Configure dnsProvider to perform domain verification using dns challenge
  ## Applicable only if using the dns-01 challenge type
  delayBeforeCheck: 0
  resolvers: []
    # - 1.1.1.1:53
    # - 8.8.8.8:53
  dnsProvider:
    name: nil
    auroradns:
      AURORA_USER_ID: ""
      AURORA_KEY: ""
      AURORA_ENDPOINT: ""
    azure:
      AZURE_CLIENT_ID: ""
      AZURE_CLIENT_SECRET: ""
      AZURE_SUBSCRIPTION_ID: ""
      AZURE_TENANT_ID: ""
      AZURE_RESOURCE_GROUP: ""
    cloudflare:
      CLOUDFLARE_EMAIL: ""
      CLOUDFLARE_API_KEY: ""
    digitalocean:
      DO_AUTH_TOKEN: ""
    dnsimple:
      DNSIMPLE_OAUTH_TOKEN: ""
      DNSIMPLE_BASE_URL: ""
    dnsmadeeasy:
      DNSMADEEASY_API_KEY: ""
      DNSMADEEASY_API_SECRET: ""
      DNSMADEEASY_SANDBOX: ""
    dnspod:
      DNSPOD_API_KEY: ""
    dyn:
      DYN_CUSTOMER_NAME: ""
      DYN_USER_NAME: ""
      DYN_PASSWORD: ""
    exoscale:
      EXOSCALE_API_KEY: ""
      EXOSCALE_API_SECRET: ""
      EXOSCALE_ENDPOINT: ""
    gandi:
      GANDI_API_KEY: ""
    godaddy:
      GODADDY_API_KEY: ""
      GODADDY_API_SECRET: ""
    gcloud:
      GCE_PROJECT: ""
      GCE_SERVICE_ACCOUNT_FILE: ""
    linode:
      LINODE_API_KEY: ""
    namecheap:
      NAMECHEAP_API_USER: ""
      NAMECHEAP_API_KEY: ""
    ns1:
      NS1_API_KEY: ""
    otc:
      OTC_DOMAIN_NAME: ""
      OTC_USER_NAME: ""
      OTC_PASSWORD: ""
      OTC_PROJECT_NAME: ""
      OTC_IDENTITY_ENDPOINT: ""
    ovh:
      OVH_ENDPOINT: ""
      OVH_APPLICATION_KEY: ""
      OVH_APPLICATION_SECRET: ""
      OVH_CONSUMER_KEY: ""
    pdns:
      PDNS_API_URL: ""
    rackspace:
      RACKSPACE_USER: ""
      RACKSPACE_API_KEY: ""
    rfc2136:
      RFC2136_NAMESERVER: ""
      RFC2136_TSIG_ALGORITHM: ""
      RFC2136_TSIG_KEY: ""
      RFC2136_TSIG_SECRET: ""
      RFC2136_TIMEOUT: ""
    route53:
      AWS_REGION: ""
      AWS_ACCESS_KEY_ID: ""
      AWS_SECRET_ACCESS_KEY: ""
    vultr:
      VULTR_API_KEY: ""
  ## Save ACME certs to a persistent volume.
  ## WARNING: If you do not do this and you did not have configured
  ## a kvprovider, you will re-request certs every time a pod (re-)starts
  ## and you WILL be rate limited!
  persistence:
    enabled: true
    annotations: {}
    ## acme data Persistent Volume Storage Class
    ## If defined, storageClassName: <storageClass>
    ## If set to "-", storageClassName: "", which disables dynamic provisioning
    ## If undefined (the default) or set to null, no storageClassName spec is
    ##   set, choosing the default provisioner.  (gp2 on AWS, standard on
    ##   GKE, AWS & OpenStack)
    ##
    storageClass: "default"
    accessMode: ReadWriteOnce
    size: 1Gi
    ## A manually managed Persistent Volume Claim
    ## Requires persistence.enabled: true
    ## If defined, PVC must be created manually before volume will be bound
    ##
    # existingClaim:
dashboard:
  enabled: true
  domain: traefik.k8s-test.hardstyletop40.com
  # serviceType: ClusterIP
  service: {}
    # annotations:
    #   key: value
  ingress: {}
    # annotations:
    #   key: value
    # labels:
    #   key: value
    # tls:
      # - hosts:
      #   - traefik.example.com
      #   secretName: traefik-default-cert
  auth: {}
    # basic:
    #   username: password
  statistics: {}
    ## Number of recent errors to show in the ‘Health’ tab
    # recentErrors:
service:
  # annotations:
  #   key: value
  # labels:
  #   key: value
  ## Further config for service of type NodePort
  ## Default config with empty string "" will assign a dynamic
  ## nodePort to http and https ports
  nodePorts:
    http: ""
    https: ""
  ## If static nodePort configuration is required it can be enabled as below
  ## Configure ports in allowable range (eg. 30000 - 32767 on minikube)
  # nodePorts:
  #   http: 30080
  #   https: 30443
gzip:
  enabled: true
traefikLogFormat: json
accessLogs:
  enabled: false
  ## Path to the access logs file. If not provided, Traefik defaults it to stdout.
  # filePath: ""
  format: common  # choices are: common, json
  ## for JSON logging, finer-grained control over what is logged. Fields can be
  ## retained or dropped, and request headers can be retained, dropped or redacted
  fields:
    # choices are keep, drop
    defaultMode: keep
    names: {}
      # ClientUsername: drop
    headers:
      # choices are keep, drop, redact
      defaultMode: keep
      names: {}
        # Authorization: redact
rbac:
  enabled: false
## Enable the /metrics endpoint, for now only supports prometheus
## set to true to enable metric collection by prometheus
metrics:
  prometheus:
    enabled: false
    ## If true, prevents exposing port 8080 on the main Traefik service, reserving
    ## it to the dashboard service only
    restrictAccess: false
    # buckets: [0.1,0.3,1.2,5]
  datadog:
    enabled: false
    # address: localhost:8125
    # pushinterval: 10s
  statsd:
    enabled: false
    # address: localhost:8125
    # pushinterval: 10s
deployment:
  # labels to add to the pod container metadata
  # podLabels:
  #   key: value
  # podAnnotations:
  #   key: value
  hostPort:
    httpEnabled: false
    httpsEnabled: false
    dashboardEnabled: false
    # httpPort: 80
    # httpsPort: 443
    # dashboardPort: 8080
sendAnonymousUsage: false
tracing:
  enabled: false
  serviceName: traefik
  # backend: choices are jaeger, zipkin, datadog
  # jaeger:
  #   localAgentHostPort: "127.0.0.1:6831"
  #   samplingServerURL: http://localhost:5778/sampling
  #   samplingType: const
  #   samplingParam: 1.0
  # zipkin:
  #   httpEndpoint: http://localhost:9411/api/v1/spans
  #   debug: false
  #   sameSpan: false
  #   id128bit: true
  # datadog:
  #   localAgentHostPort: "127.0.0.1:8126"
  #   debug: false
  #   globalTag: ""

## Create HorizontalPodAutoscaler object.
##
# autoscaling:
#   minReplicas: 1
#   maxReplicas: 10
#   metrics:
#   - type: Resource
#     resource:
#       name: cpu
#       targetAverageUtilization: 60
#   - type: Resource
#     resource:
#       name: memory
#       targetAverageUtilization: 60

## Timeouts
##
# timeouts:
#   ## responding are timeouts for incoming requests to the Traefik instance
#   responding:
#     readTimeout: 0s
#     writeTimeout: 0s
#     idleTimeout: 180s
#   ## forwarding are timeouts for requests forwarded to the backend servers
#   forwarding:
#     dialTimeout: 30s
#     responseHeaderTimeout: 0s

2 个答案:

答案 0 :(得分:2)

对于您的问题,您似乎误解了持续数量索赔。使用命令时:

kubectl get sc --all-namespaces

它仅显示存储类,而不显示持久卷声明。存储类用于定义如何使用持久卷动态创建存储单元。您需要按以下方式创建持久性批量声明:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: azure-managed-disk
spec:
  accessModes:
  - ReadWriteOnce
  storageClassName: managed-premium
  resources:
    requests:
      storage: 5Gi

然后您可以使用该命令来显示持久卷声明,如下所示:

kubectl get pvc --all-namespaces

它实际上显示了您创建的持久卷声明。看一下Dynamically create and use a persistent volume with Azure disks in Azure Kubernetes Service (AKS)。或Use the special disk that you create

更新

此外,您也会收到错误消息,但是当Pod处于运行状态时,我检查了Pod的内部并发现所有已正确装入的卷。因此,我猜是否可能由于Pod不在运行状态而导致错误。当pod处于运行状态时,卷将按预期装入。

答案 1 :(得分:0)

主要问题是,附加外部Azure资源的速度很慢,因此最初会重试。由于已动态创建卷,因此在该窗格中会出现很多无法挂载的错误。由于重试jt会在几分钟后恢复。

实际上,实际的容器崩溃是由于ACME和Traefik本身而不是直接与卷有关的问题引起的。