Skip to content

Commit

Permalink
Merge pull request #920 from consideRatio/758-bump-k8s-api
Browse files Browse the repository at this point in the history
[Part 4 of #758] Bump k8s resources to v1.9 available API
  • Loading branch information
minrk authored Sep 10, 2018
2 parents e700e22 + 05b4e8c commit 7174419
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 19 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/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
## Example usage
```yaml
# Excerpt from proxy/autohttps/deployment.yaml
apiVersion: apps/v1beta2
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "jupyterhub.nameField" . }}
Expand Down
2 changes: 1 addition & 1 deletion jupyterhub/templates/hub/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: apps/v1beta2
apiVersion: apps/v1
kind: Deployment
metadata:
name: hub
Expand Down
4 changes: 2 additions & 2 deletions jupyterhub/templates/hub/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
{{- include "jupyterhub.labels" . | nindent 4 }}
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: hub
labels:
Expand All @@ -21,7 +21,7 @@ rules:
verbs: ["get", "watch", "list"]
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: hub
labels:
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
2 changes: 1 addition & 1 deletion jupyterhub/templates/proxy/autohttps/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- $HTTPS := (and .Values.proxy.https.hosts .Values.proxy.https.enabled) }}
{{- $autoHTTPS := (and $HTTPS (eq .Values.proxy.https.type "letsencrypt")) }}
{{- if $autoHTTPS -}}
apiVersion: apps/v1beta2
apiVersion: apps/v1
kind: Deployment
metadata:
name: autohttps
Expand Down
12 changes: 6 additions & 6 deletions jupyterhub/templates/proxy/autohttps/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ metadata:
labels:
{{- include "jupyterhub.labels" . | nindent 4 }}
---
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: nginx-{{ .Release.Name }}
Expand Down Expand Up @@ -74,7 +74,7 @@ rules:
verbs:
- update
---
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: nginx-{{ .Release.Name }}
Expand All @@ -89,7 +89,7 @@ subjects:
name: autohttps
namespace: {{ .Release.Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: nginx
Expand Down Expand Up @@ -129,7 +129,7 @@ rules:
- get
- update
---
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: kube-lego
Expand Down Expand Up @@ -166,7 +166,7 @@ rules:
- create
- update
---
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: nginx
Expand All @@ -181,7 +181,7 @@ subjects:
name: autohttps
namespace: {{ .Release.Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: kube-lego
Expand Down
2 changes: 1 addition & 1 deletion jupyterhub/templates/proxy/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- $manualHTTPS := (and .Values.proxy.https.enabled (eq .Values.proxy.https.type "manual")) -}}
{{- $manualHTTPSwithsecret := (and .Values.proxy.https.enabled (eq .Values.proxy.https.type "secret")) -}}
apiVersion: apps/v1beta2
apiVersion: apps/v1
kind: Deployment
metadata:
name: proxy
Expand Down

0 comments on commit 7174419

Please sign in to comment.