Skip to content

Commit

Permalink
K8s 1.9 API bump: image-puller
Browse files Browse the repository at this point in the history
  • Loading branch information
consideRatio committed Sep 8, 2018
1 parent 1d835e9 commit 9239472
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions images/image-awaiter/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ COPY --from=0 /go/image-awaiter /image-awaiter
# > kubectl proxy --port=8080

# 2. Try the API using the proxy...
# > curl http://localhost:8080/apis/apps/v1beta2/namespaces/<namespace>/demonsets/hook-image-puller
# > curl http://localhost:8080/apis/apps/v1/namespaces/<namespace>/demonsets/hook-image-puller

# 3. Try the container using the proxy...
# > docker build --tag <name:tag> .
# > docker run -it --rm --net=host <name:tag> /image-awaiter -debug -namespace <namespace> -daemonset hook-image-puller
# > docker run -it --rm --net=host <name:tag> /image-awaiter -debug -namespace <namespace> -daemonset hook-image-puller
2 changes: 1 addition & 1 deletion images/image-awaiter/daemonset.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type DaemonSet struct {
// Return a *DaemonSet and the relevant state its in
func getDaemonSet(transportPtr *http.Transport, server string, headers map[string]string, namespace string, daemonSet string) (*DaemonSet, error) {
client := &http.Client{Transport: transportPtr}
url := server + "/apis/apps/v1beta2/namespaces/" + namespace + "/daemonsets/" + daemonSet
url := server + "/apis/apps/v1/namespaces/" + namespace + "/daemonsets/" + daemonSet

req, err := http.NewRequest("GET", url, nil)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion images/image-awaiter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// started when this job starts. When all images are pulled, this job exits.

/*
K8s API options - currently using 1.8
K8s API options - currently using 1.9
- K8s 1.8 API: curl http://localhost:8080/apis/apps/v1beta2/namespaces/<ns>/demonsets/<ds>
- K8s 1.9 API: curl http://localhost:8080/apis/apps/v1/namespaces/<ns>/demonsets/<ds>
*/
Expand Down
2 changes: 1 addition & 1 deletion jupyterhub/templates/image-puller/_daemonset-helper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Returns an image-puller daemonset. Two daemonsets will be created like this.
- continuous-image-puller: for newly added nodes image pulling
*/}}
{{- define "jupyterhub.imagePuller.daemonset" -}}
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: {{ print .componentPrefix "image-puller" }}
Expand Down
4 changes: 2 additions & 2 deletions jupyterhub/templates/image-puller/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ metadata:
... will be used by this role...
*/}}
kind: Role
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: hook-image-awaiter
labels:
Expand All @@ -41,7 +41,7 @@ rules:
... as declared by this binding.
*/}}
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: hook-image-awaiter
labels:
Expand Down

0 comments on commit 9239472

Please sign in to comment.