Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploying with a hook command, without any manifests #8396

Open
alexellis opened this issue Feb 1, 2023 · 0 comments
Open

Deploying with a hook command, without any manifests #8396

alexellis opened this issue Feb 1, 2023 · 0 comments
Labels
area/deploy kind/friction Issues causing user pain that do not have a workaround priority/p3 agreed that this would be good to have, but no one is available at the moment.

Comments

@alexellis
Copy link

Expected behavior

I'd like to be able to deploy OpenFaaS functions via HTTP/REST using faas-cli deploy. This does work using an after hook, but a spurious and unnecessary Kubernetes YAML file is required, which makes using Skaffold confusing for users.

apiVersion: skaffold/v4beta2
kind: Config
metadata:
  name: quick
build:
  tagPolicy:
    inputDigest: {}
  artifacts:
  - image: alexellis2/quick
    custom:
      buildCommand: |
        sed 's/SKAFFOLD_IMAGE/IMAGE/g' ./stack.yml > /tmp/stack.yml
        DOCKER_BUILDKIT=1 faas-cli publish -f /tmp/stack.yml
      dependencies:
        paths:
          - ./quick/**/
    hooks:
      before:
        - command: ["kubectl", "delete", "job", "quick", "--ignore-not-found=true"]
      after:
        - command: ["faas-cli", "deploy"]
manifests:
  rawYaml:
  - ./warmup.yaml

Actual behavior

A dummy deployment file is required with 0 replicas i.e.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: quick-warmup
  namespace: openfaas-fn
  labels:
    app: quick
spec:
  replicas: 0
  selector:
    matchLabels:
      app: quick
  template:
    metadata:
      labels:
        app: quick
    spec:
      containers:
      - name: quick
        image: alexellis2/quick
        command: ["fwatchdog", "--version"]
        ports:
        - containerPort: 8080

OpenFaaS stack.yml

version: 1.0
provider:
  name: openfaas
  gateway: http://127.0.0.1:8080
functions:
  quick:
    lang: node16
    handler: ./quick
    image: ${SKAFFOLD_IMAGE:-alexellis2/quick:latest}

Steps to reproduce the behavior

skaffold version
v2.1.0

Full example plus additional context on the current issues: https://github.com/alexellis/openfaas-skaffold-faas-cli

@gsquared94 gsquared94 added area/deploy priority/p3 agreed that this would be good to have, but no one is available at the moment. kind/friction Issues causing user pain that do not have a workaround labels Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/deploy kind/friction Issues causing user pain that do not have a workaround priority/p3 agreed that this would be good to have, but no one is available at the moment.
Projects
None yet
Development

No branches or pull requests

2 participants