Skip to content

Commit

Permalink
Introduce KO for fast development iteration (kubeflow#65)
Browse files Browse the repository at this point in the history
* ko requires controller manifest to be separated out

* Add deploy-test makefile recipe for fast dev develop and deploy for testing

* Add image patch script for development overlay

* Consolidate to deploy-dev
  • Loading branch information
yuzisun authored and k8s-ci-robot committed May 7, 2019
1 parent 84558fd commit c178dd7
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 34 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ bin
*.swp
*.swo
*~

# development overlay for image patch not to be checked in
config/overlays/development/manager_image_patch.yaml
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ deploy: manifests

deploy-dev: manifests
kubectl apply -f config/crds
./image_patch_dev.sh
kustomize build config/overlays/development | kubectl apply -f -

undeploy: manifests
Expand Down
25 changes: 1 addition & 24 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,3 @@
apiVersion: v1
kind: Namespace
metadata:
labels:
control-plane: kfserving-controller-manager
controller-tools.k8s.io: "1.0"
name: system
---
apiVersion: v1
kind: Service
metadata:
name: controller-manager-service
namespace: system
labels:
control-plane: kfserving-controller-manager
controller-tools.k8s.io: "1.0"
spec:
selector:
control-plane: kfserving-controller-manager
controller-tools.k8s.io: "1.0"
ports:
- port: 443
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
Expand All @@ -44,7 +21,7 @@ spec:
containers:
- command:
- /manager
image: controller:latest
image: github.com/kubeflow/kfserving/cmd/manager
imagePullPolicy: Always
name: manager
env:
Expand Down
22 changes: 22 additions & 0 deletions config/manager/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: v1
kind: Namespace
metadata:
labels:
control-plane: kfserving-controller-manager
controller-tools.k8s.io: "1.0"
name: system
---
apiVersion: v1
kind: Service
metadata:
name: controller-manager-service
namespace: system
labels:
control-plane: kfserving-controller-manager
controller-tools.k8s.io: "1.0"
spec:
selector:
control-plane: kfserving-controller-manager
controller-tools.k8s.io: "1.0"
ports:
- port: 443
10 changes: 0 additions & 10 deletions config/overlays/development/manager_image_patch.yaml

This file was deleted.

15 changes: 15 additions & 0 deletions image_patch_dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
IMG=$(ko resolve -f config/manager/manager.yaml | grep 'image:' | awk '{print $2}')
cat > config/overlays/development/manager_image_patch.yaml << EOF
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: controller-manager
spec:
template:
spec:
containers:
- name: manager
command:
image: ${IMG}
EOF

0 comments on commit c178dd7

Please sign in to comment.