GoogleCloudPlatform / k8s-multicluster-ingress

kubemci: Command line tool to configure L7 load balancers using multiple kubernetes clusters
Apache License 2.0
376 stars 68 forks source link

lacks a matching HTTP probe for use in health checks #209

Closed dihmeetree closed 5 years ago

dihmeetree commented 5 years ago

When I run the kubemci create command I get the following output..

...
Ensuring health checks
Pod helloweb-69cf49755d-7xbg6 matching service selectors app=hello,tier=web (targetport ): lacks a matching HTTP probe for use in health checks.
Pod helloweb-69cf49755d-9dww2 matching service selectors app=hello,tier=web (targetport ): lacks a matching HTTP probe for use in health checks.
Pod helloweb-69cf49755d-ts474 matching service selectors app=hello,tier=web (targetport ): lacks a matching HTTP probe for use in health checks.
Pod helloweb-69cf49755d-5nrj5 matching service selectors app=hello,tier=web (targetport ): lacks a matching HTTP probe for use in health checks.
Pod helloweb-69cf49755d-vdvmm matching service selectors app=hello,tier=web (targetport ): lacks a matching HTTP probe for use in health checks.
Pod helloweb-69cf49755d-xmhlf matching service selectors app=hello,tier=web (targetport ): lacks a matching HTTP probe for use in health checks.
Path for healthcheck is /
Ensuring health check for port: {SvcName:default/helloweb-backend SvcPort:{Type:0 IntVal:443 StrVal:} NodePort:30061 Protocol:HTTPS SvcTargetPort: NEGEnabled:false}
Creating health check mci1-hc-30061--helloweb
Health check mci1-hc-30061--helloweb created successfully
...

However I have a custom healthcheck setup in my deployment file like so:

helloweb-deployment.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: helloweb
  labels:
    app: hello
spec:
  replicas: 3
  minReadySeconds: 5
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
  selector:
    matchLabels:
      app: hello
  template:
    metadata:
      labels:
        app: hello
        tier: web
    spec:
      containers:
      - name: hello-app
        image: gcr.io/google-samples/hello-app-tls:1.0
        imagePullPolicy: Always
        readinessProbe:
          httpGet:
            port: 8443
            path: /readiness
            scheme: HTTPS
          initialDelaySeconds: 30
          periodSeconds: 5
          timeoutSeconds: 5
        livenessProbe:
          httpGet:
            port: 8443
            path: /healthz
            scheme: HTTPS
          initialDelaySeconds: 15
          periodSeconds: 15
          timeoutSeconds: 5
        ports:
        - containerPort: 8443
        volumeMounts:
          - name: tls
            mountPath: /etc/tls
            readOnly: true
        env:
          - name: TLS_CERT
            value: /etc/tls/tls.crt
          - name: TLS_KEY
            value: /etc/tls/tls.key
      volumes:
      - name: tls
        secret:
          secretName: yourdomain-tls

helloweb-nodeport.yaml

apiVersion: v1
kind: Service
metadata:
  name: helloweb-backend
  labels:
    app: hello
  annotations:
    # Use app-protocols annotation with your ports[0].name:
    # - "HTTPS": Encrypts traffic between the load balancer and your app. Your
    #            app does not have to present a valid TLS cert, you can use
    #            self-signed certs as in this hello-app-tls example.
    # - "HTTP2": If the backend app supports http2 (hello-app-tls does), use
    #            this to have the load balancer proxy traffic using http2. This
    #            also incudes the "HTTPS" option implicity and provides TLS
    #            between the load balancer and your app.
    service.alpha.kubernetes.io/app-protocols: '{"helloweb-tls":"HTTPS"}'
spec:
  type: NodePort
  selector:
    app: hello
    tier: web
  ports:
  - name: helloweb-tls # port name must match the value in the annotation
    port: 443
    targetPort: 8443
    nodePort: 30061

helloweb-ingress-tls.yaml

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: helloweb
  labels:
    app: hello
  annotations:
    kubernetes.io/ingress.allow-http: "false" # disable HTTP
    kubernetes.io/ingress.class: gce-multi-cluster
    kubernetes.io/ingress.global-static-ip-name: helloweb-ip
spec:
  tls:
    - secretName: yourdomain-tls
  backend:
    serviceName: helloweb-backend
    servicePort: 443

ANy ideas to what i'm doing wrong here? It seems to create the health check but it's telling me there's an issue in the output so idk.. :/