serverless / serverless-knative

Serverless Knative Provider Plugin – Adds Knative to the Serverless Framework
https://serverless.com
28 stars 19 forks source link

Unable to deploy an HelloWorld service to local minikube #1

Closed faxioman closed 5 years ago

faxioman commented 5 years ago

When I try do deploy a simple "hello world" service to my local knative installation (minikube) I always get a 404 error:

Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Building Docker image "faxioman/knative-docker-hello:1573739327270"...
Serverless: Pushing "faxioman/knative-docker-hello:1573739327270" to Container Registry...
Serverless: Deploying Kubernetes namespace "sls-knative-docker-dev"...
Serverless: Deploying Knative service for function "knative-docker-hello"...

 Exception -----------------------------------------------

  { response:
     IncomingMessage {
       _readableState:
        ReadableState {
          objectMode: false,
          highWaterMark: 16384,
          buffer: BufferList { head: null, tail: null, length: 0 },
          length: 0,
          pipes: null,
          pipesCount: 0,
          flowing: true,
          ended: true,
          endEmitted: true,
          reading: false,
          sync: true,
          needReadable: false,
          emittedReadable: false,
          readableListening: false,
          resumeScheduled: false,
          paused: false,
          emitClose: true,
          destroyed: false,
          defaultEncoding: 'utf8',
          awaitDrain: 0,
          readingMore: true,
          decoder: null,
          encoding: null },
       readable: false,
       domain: null,
       _events:
        [Object: null prototype] {
          end: [Array],
          close: [Array],
          data: [Function],
          error: [Function] },
       _eventsCount: 4,
       _maxListeners: undefined,
       socket:
        TLSSocket {
          _tlsOptions: [Object],
          _secureEstablished: true,
          _securePending: false,
          _newSessionPending: false,
          _controlReleased: true,
          _SNICallback: null,
          servername: '10.211.55.198',
          alpnProtocol: false,
          authorized: true,
          authorizationError: null,
          encrypted: true,
          _events: [Object],
          _eventsCount: 7,
          connecting: false,
          _hadError: false,
          _handle: null,
          _parent: null,
          _host: null,
          _readableState: [ReadableState],
          readable: false,
          domain: null,
          _maxListeners: undefined,
          _writableState: [WritableState],
          writable: false,
          allowHalfOpen: false,
          _sockname: null,
          _pendingData: null,
          _pendingEncoding: '',
          server: undefined,
          _server: null,
          ssl: null,
          _requestCert: true,
          _rejectUnauthorized: true,
          parser: null,
          _httpMessage: [ClientRequest],
          [Symbol(res)]: [TLSWrap],
          [Symbol(asyncId)]: 28577,
          [Symbol(lastWriteQueueSize)]: 0,
          [Symbol(timeout)]: null,
          [Symbol(kBytesRead)]: 195,
          [Symbol(kBytesWritten)]: 524,
          [Symbol(connect-options)]: [Object] },
       connection:
        TLSSocket {
          _tlsOptions: [Object],
          _secureEstablished: true,
          _securePending: false,
          _newSessionPending: false,
          _controlReleased: true,
          _SNICallback: null,
          servername: '10.211.55.198',
          alpnProtocol: false,
          authorized: true,
          authorizationError: null,
          encrypted: true,
          _events: [Object],
          _eventsCount: 7,
          connecting: false,
          _hadError: false,
          _handle: null,
          _parent: null,
          _host: null,
          _readableState: [ReadableState],
          readable: false,
          domain: null,
          _maxListeners: undefined,
          _writableState: [WritableState],
          writable: false,
          allowHalfOpen: false,
          _sockname: null,
          _pendingData: null,
          _pendingEncoding: '',
          server: undefined,
          _server: null,
          ssl: null,
          _requestCert: true,
          _rejectUnauthorized: true,
          parser: null,
          _httpMessage: [ClientRequest],
          [Symbol(res)]: [TLSWrap],
          [Symbol(asyncId)]: 28577,
          [Symbol(lastWriteQueueSize)]: 0,
          [Symbol(timeout)]: null,
          [Symbol(kBytesRead)]: 195,
          [Symbol(kBytesWritten)]: 524,
          [Symbol(connect-options)]: [Object] },
       httpVersionMajor: 1,
       httpVersionMinor: 1,
       httpVersion: '1.1',
       complete: true,
       headers:
        { 'content-type': 'text/plain; charset=utf-8',
          'x-content-type-options': 'nosniff',
          date: 'Thu, 14 Nov 2019 13:49:00 GMT',
          'content-length': '19',
          connection: 'close' },
       rawHeaders:
        [ 'Content-Type',
          'text/plain; charset=utf-8',
          'X-Content-Type-Options',
          'nosniff',
          'Date',
          'Thu, 14 Nov 2019 13:49:00 GMT',
          'Content-Length',
          '19',
          'Connection',
          'close' ],
       trailers: {},
       rawTrailers: [],
       aborted: false,
       upgrade: false,
       url: '',
       method: null,
       statusCode: 404,
       statusMessage: 'Not Found',
       client:
        TLSSocket {
          _tlsOptions: [Object],
          _secureEstablished: true,
          _securePending: false,
          _newSessionPending: false,
          _controlReleased: true,
          _SNICallback: null,
          servername: '10.211.55.198',
          alpnProtocol: false,
          authorized: true,
          authorizationError: null,
          encrypted: true,
          _events: [Object],
          _eventsCount: 7,
          connecting: false,
          _hadError: false,
          _handle: null,
          _parent: null,
          _host: null,
          _readableState: [ReadableState],
          readable: false,
          domain: null,
          _maxListeners: undefined,
          _writableState: [WritableState],
          writable: false,
          allowHalfOpen: false,
          _sockname: null,
          _pendingData: null,
          _pendingEncoding: '',
          server: undefined,
          _server: null,
          ssl: null,
          _requestCert: true,
          _rejectUnauthorized: true,
          parser: null,
          _httpMessage: [ClientRequest],
          [Symbol(res)]: [TLSWrap],
          [Symbol(asyncId)]: 28577,
          [Symbol(lastWriteQueueSize)]: 0,
          [Symbol(timeout)]: null,
          [Symbol(kBytesRead)]: 195,
          [Symbol(kBytesWritten)]: 524,
          [Symbol(connect-options)]: [Object] },
       _consuming: false,
       _dumped: false,
       req:
        ClientRequest {
          domain: null,
          _events: [Object],
          _eventsCount: 5,
          _maxListeners: undefined,
          output: [],
          outputEncodings: [],
          outputCallbacks: [],
          outputSize: 0,
          writable: true,
          _last: true,
          chunkedEncoding: false,
          shouldKeepAlive: false,
          useChunkedEncodingByDefault: true,
          sendDate: false,
          _removedConnection: false,
          _removedContLen: false,
          _removedTE: false,
          _contentLength: null,
          _hasBody: true,
          _trailer: '',
          finished: true,
          _headerSent: true,
          socket: [TLSSocket],
          connection: [TLSSocket],
          _header:
           'PATCH /apis/serving.knative.dev/v1alpha1/namespaces/sls-knative-docker-dev/services/knative-docker-hello HTTP/1.1\r\nContent-Type: application/merge-patch+json\r\nauthorization: \r\nhost: 10.211.55.198:8443\r\naccept: application/json\r\ncontent-length: 254\r\nConnection: close\r\n\r\n',
          _onPendingData: [Function: noopPendingOutput],
          agent: [Agent],
          socketPath: undefined,
          timeout: undefined,
          method: 'PATCH',
          path:
           '/apis/serving.knative.dev/v1alpha1/namespaces/sls-knative-docker-dev/services/knative-docker-hello',
          _ended: true,
          res: [Circular],
          aborted: undefined,
          timeoutCb: null,
          upgradeOrConnect: false,
          parser: null,
          maxHeadersCount: null,
          [Symbol(isCorked)]: false,
          [Symbol(outHeadersKey)]: [Object] },
       request:
        Request {
          domain: null,
          _events: [Object],
          _eventsCount: 5,
          _maxListeners: undefined,
          method: 'PATCH',
          headers: [Object],
          uri: [Url],
          useQuerystring: false,
          body:
           '{"apiVersion":"serving.knative.dev/v1alpha1","kind":"Service","metadata":{"name":"knative-docker-hello","namespace":"sls-knative-docker-dev"},"spec":{"template":{"spec":{"containers":[{"image":"docker.io/faxioman/knative-docker-hello:1573739327270"}]}}}}',
          ca:
           <Buffer 2d 2d 2d 2d 2d 42 45 47 49 4e 20 43 45 52 54 49 46 49 43 41 54 45 2d 2d 2d 2d 2d 0a 4d 49 49 43 35 7a 43 43 41 63 2b 67 41 77 49 42 41 67 49 42 41 54 ... >,
          cert:
           <Buffer 2d 2d 2d 2d 2d 42 45 47 49 4e 20 43 45 52 54 49 46 49 43 41 54 45 2d 2d 2d 2d 2d 0a 4d 49 49 44 41 44 43 43 41 65 69 67 41 77 49 42 41 67 49 42 41 6a ... >,
          key:
           <Buffer 2d 2d 2d 2d 2d 42 45 47 49 4e 20 52 53 41 20 50 52 49 56 41 54 45 20 4b 45 59 2d 2d 2d 2d 2d 0a 4d 49 49 45 70 51 49 42 41 41 4b 43 41 51 45 41 6e 48 ... >,
          callback: [Function],
          readable: true,
          writable: true,
          explicitMethod: true,
          _qs: [Querystring],
          _auth: [Auth],
          _oauth: [OAuth],
          _multipart: [Multipart],
          _redirect: [Redirect],
          _tunnel: [Tunnel],
          setHeader: [Function],
          hasHeader: [Function],
          getHeader: [Function],
          removeHeader: [Function],
          localAddress: undefined,
          pool: [Object],
          dests: [],
          __isRequestRequest: true,
          _callback: [Function],
          proxy: null,
          tunnel: true,
          setHost: true,
          originalCookieHeader: undefined,
          _disableCookies: true,
          _jar: undefined,
          port: '8443',
          host: '10.211.55.198',
          path:
           '/apis/serving.knative.dev/v1alpha1/namespaces/sls-knative-docker-dev/services/knative-docker-hello',
          _json: true,
          httpModule: [Object],
          agentClass: [Function],
          agent: [Agent],
          _started: true,
          href:
           'https://10.211.55.198:8443/apis/serving.knative.dev/v1alpha1/namespaces/sls-knative-docker-dev/services/knative-docker-hello',
          req: [ClientRequest],
          ntick: true,
          response: [Circular],
          originalHost: '10.211.55.198:8443',
          originalHostHeaderName: 'host',
          responseContent: [Circular],
          _destdata: true,
          _ended: true,
          _callbackCalled: true },
       toJSON: [Function: responseToJSON],
       caseless: Caseless { dict: [Object] },
       body: '404 page not found\n' },
    body: '404 page not found\n' }

     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

  Your Environment Information ---------------------------
     Operating System:          darwin
     Node Version:              10.15.1
     Framework Version:         1.57.0
     Plugin Version:            3.2.2
     SDK Version:               2.2.1
     Components Core Version:   1.1.2
     Components CLI Version:    1.4.0
faxioman commented 5 years ago

My fault in knative installation.

faxioman commented 5 years ago

Anyway, probably is not possible at this time to use serverless-knative with minikube.

billfine commented 5 years ago

@faxioman would love to get your feedback one the project and where you think we should go with it. Interested and available for a quick chat?

armisael commented 3 years ago

@faxioman can you share what the issue was (if you remember, given it was almost 2 years ago)? We're testing serverless with knative, and we're facing the same error with our test project.

faxioman commented 3 years ago

Sorry @armisael but we choose kubeless as backend for serverless sdk. It’s really a simple layer over k8s … and we love it. In the near future we could check this plugin again … but for now having a dockerfile in a faas service is not an option for us. I’m sorry I can’t help you.