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

Upgrade templates to use apps/v1 schema, also fixes a build problem #79

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/hdfs-client-k8s/templates/client-deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "hdfs-k8s.client.fullname" . }}
Expand Down
6 changes: 5 additions & 1 deletion charts/hdfs-datanode-k8s/templates/datanode-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ data:
---
# Deleting a daemonset may need some trick. See
# https://github.com/kubernetes/kubernetes/issues/33245#issuecomment-261250489
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: {{ template "hdfs-k8s.datanode.fullname" . }}
Expand All @@ -43,6 +43,10 @@ metadata:
chart: {{ template "hdfs-k8s.subchart" . }}
release: {{ .Release.Name }}
spec:
selector:
matchLabels:
app: {{ template "hdfs-k8s.datanode.name" . }}
release: {{ .Release.Name }}
template:
metadata:
labels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ spec:
release: {{ .Release.Name }}
minAvailable: {{ div .Values.global.journalnodeQuorumSize 2 | add1 }}
---
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ template "hdfs-k8s.journalnode.fullname" . }}
Expand All @@ -46,6 +46,10 @@ metadata:
chart: {{ template "hdfs-k8s.subchart" . }}
release: {{ .Release.Name }}
spec:
selector:
matchLabels:
app: {{ template "hdfs-k8s.journalnode.name" . }}
release: {{ .Release.Name }}
serviceName: {{ template "hdfs-k8s.journalnode.fullname" . }}
replicas: {{ .Values.global.journalnodeQuorumSize }}
template:
Expand Down
4 changes: 2 additions & 2 deletions charts/hdfs-k8s/requirements.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dependencies:
- name: zookeeper
version: "1.3.1"
repository: https://kubernetes-charts-incubator.storage.googleapis.com/
version: "2.1.1"
repository: https://charts.helm.sh/incubator
condition: condition.subchart.zookeeper
tags:
- ha
Expand Down
2 changes: 1 addition & 1 deletion charts/hdfs-krb5-k8s/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spec:
app: {{ template "hdfs-k8s.krb5.name" . }}
release: {{ .Release.Name }}
---
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ template "hdfs-k8s.krb5.fullname" . }}
Expand Down
6 changes: 5 additions & 1 deletion charts/hdfs-namenode-k8s/templates/namenode-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ data:
# ad-hoc operation as specified by a user.
custom-run.sh: {{ .Values.customRunScript | quote }}
---
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ template "hdfs-k8s.namenode.fullname" . }}
Expand All @@ -119,6 +119,10 @@ metadata:
chart: {{ template "hdfs-k8s.subchart" . }}
release: {{ .Release.Name }}
spec:
selector:
matchLabels:
app: {{ template "hdfs-k8s.namenode.name" . }}
release: {{ .Release.Name }}
serviceName: {{ template "hdfs-k8s.namenode.fullname" . }}
replicas: 2
template:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
app: {{ template "hdfs-k8s.namenode.name" . }}
release: {{ .Release.Name }}
---
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ template "hdfs-k8s.namenode.fullname" . }}
Expand All @@ -25,6 +25,10 @@ metadata:
chart: {{ template "hdfs-k8s.subchart" . }}
release: {{ .Release.Name }}
spec:
selector:
matchLabels:
app: {{ template "hdfs-k8s.namenode.name" . }}
release: {{ .Release.Name }}
serviceName: {{ template "hdfs-k8s.namenode.fullname" . }}
# Create a size-1 set.
replicas: 1
Expand Down
9 changes: 4 additions & 5 deletions tests/gold/basic.gold
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ spec:
# Source: hdfs/charts/hdfs-datanode-k8s/templates/datanode-daemonset.yaml
# Deleting a daemonset may need some trick. See
# https://github.com/kubernetes/kubernetes/issues/33245#issuecomment-261250489
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: my-hdfs-datanode
Expand Down Expand Up @@ -741,7 +741,6 @@ spec:
---
# Source: hdfs/charts/hdfs-client-k8s/templates/client-deployment.yaml
apiVersion: apps/v1
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: my-hdfs-client
Expand Down Expand Up @@ -783,7 +782,7 @@ spec:
name: my-hdfs-config
---
# Source: hdfs/charts/hdfs-journalnode-k8s/templates/journalnode-statefulset.yaml
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: my-hdfs-journalnode
Expand Down Expand Up @@ -842,7 +841,7 @@ spec:
storage: "20Gi"
---
# Source: hdfs/charts/hdfs-namenode-k8s/templates/namenode-statefulset.yaml
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: my-hdfs-namenode
Expand Down Expand Up @@ -920,7 +919,7 @@ spec:
storage: "100Gi"
---
# Source: hdfs/charts/zookeeper/templates/statefulset.yaml
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: my-hdfs-zookeeper
Expand Down
11 changes: 5 additions & 6 deletions tests/gold/kerberos.gold
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ spec:
# Source: hdfs/charts/hdfs-datanode-k8s/templates/datanode-daemonset.yaml
# Deleting a daemonset may need some trick. See
# https://github.com/kubernetes/kubernetes/issues/33245#issuecomment-261250489
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: my-hdfs-datanode
Expand Down Expand Up @@ -899,7 +899,6 @@ spec:
---
# Source: hdfs/charts/hdfs-client-k8s/templates/client-deployment.yaml
apiVersion: apps/v1
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: my-hdfs-client
Expand Down Expand Up @@ -948,7 +947,7 @@ spec:
name: my-hdfs-krb5-config
---
# Source: hdfs/charts/hdfs-journalnode-k8s/templates/journalnode-statefulset.yaml
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: my-hdfs-journalnode
Expand Down Expand Up @@ -1038,7 +1037,7 @@ spec:
storage: "20Gi"
---
# Source: hdfs/charts/hdfs-krb5-k8s/templates/statefulset.yaml
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: my-hdfs-krb5
Expand Down Expand Up @@ -1093,7 +1092,7 @@ spec:
storage: "20Gi"
---
# Source: hdfs/charts/hdfs-namenode-k8s/templates/namenode-statefulset.yaml
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: my-hdfs-namenode
Expand Down Expand Up @@ -1202,7 +1201,7 @@ spec:
storage: "100Gi"
---
# Source: hdfs/charts/zookeeper/templates/statefulset.yaml
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: my-hdfs-zookeeper
Expand Down
5 changes: 2 additions & 3 deletions tests/gold/single-namenode.gold
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ spec:
# Source: hdfs/charts/hdfs-datanode-k8s/templates/datanode-daemonset.yaml
# Deleting a daemonset may need some trick. See
# https://github.com/kubernetes/kubernetes/issues/33245#issuecomment-261250489
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: my-hdfs-datanode
Expand Down Expand Up @@ -316,7 +316,6 @@ spec:
---
# Source: hdfs/charts/hdfs-client-k8s/templates/client-deployment.yaml
apiVersion: apps/v1
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: my-hdfs-client
Expand Down Expand Up @@ -358,7 +357,7 @@ spec:
name: my-hdfs-config
---
# Source: hdfs/charts/hdfs-simple-namenode-k8s/templates/namenode-statefulset.yaml
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: my-hdfs-namenode
Expand Down
1 change: 0 additions & 1 deletion tests/gold/subchart-client.gold
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ MANIFEST:
---
# Source: hdfs/charts/hdfs-client-k8s/templates/client-deployment.yaml
apiVersion: apps/v1
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: my-hdfs-client
Expand Down
2 changes: 1 addition & 1 deletion tests/gold/subchart-datanode.gold
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ data:
# Source: hdfs/charts/hdfs-datanode-k8s/templates/datanode-daemonset.yaml
# Deleting a daemonset may need some trick. See
# https://github.com/kubernetes/kubernetes/issues/33245#issuecomment-261250489
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: my-hdfs-datanode
Expand Down
2 changes: 1 addition & 1 deletion tests/gold/subchart-journalnode.gold
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ spec:
release: my-hdfs-journalnode
---
# Source: hdfs/charts/hdfs-journalnode-k8s/templates/journalnode-statefulset.yaml
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: my-hdfs-journalnode
Expand Down
2 changes: 1 addition & 1 deletion tests/gold/subchart-namenode.gold
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ spec:
release: my-hdfs-namenode
---
# Source: hdfs/charts/hdfs-namenode-k8s/templates/namenode-statefulset.yaml
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: my-hdfs-namenode
Expand Down
2 changes: 1 addition & 1 deletion tests/gold/subchart-zookeeper.gold
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ spec:
release: my-hdfs-zookeeper
---
# Source: hdfs/charts/zookeeper/templates/statefulset.yaml
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: my-hdfs-zookeeper
Expand Down
38 changes: 21 additions & 17 deletions tests/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,24 +65,18 @@ fi

export PATH="${_MY_DIR}/bin:$PATH"

if [[ "${USE_MINIKUBE_DRIVER_NONE:-}" = "true" ]]; then
# Run minikube with none driver.
# See https://blog.travis-ci.com/2017-10-26-running-kubernetes-on-travis-ci-with-minikube
_VM_DRIVER="--vm-driver=none"
if [[ ! -x /usr/local/bin/nsenter ]]; then
# From https://engineering.bitnami.com/articles/implementing-kubernetes-integration-tests-in-travis.html
# Travis ubuntu trusty env doesn't have nsenter, needed for --vm-driver=none
check_or_build_nsenter() {
which nsenter >/dev/null && return 0
echo "INFO: Building 'nsenter' ..."
cat <<-EOF | docker run -i --rm -v "$(pwd):/build" ubuntu:14.04 >& nsenter.build.log
apt-get update
apt-get install -qy git bison build-essential autopoint libtool automake autoconf gettext pkg-config
git clone --depth 1 git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git /tmp/util-linux
cd /tmp/util-linux
./autogen.sh
./configure --without-python --disable-all-programs --enable-nsenter
make nsenter
cp -pfv nsenter /build
echo "INFO: Getting 'nsenter' ..."
cat <<-EOF | docker run -i --rm -v "$(pwd):/build" ubuntu:14.04 >& nsenter.build.log
apt-get update
apt-get install -qy git bison build-essential autopoint libtool automake autoconf gettext pkg-config
git clone --depth 1 git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git /tmp/util-linux
cd /tmp/util-linux
./autogen.sh
./configure --without-python --disable-all-programs --enable-nsenter
make nsenter
cp -pfv nsenter /build
EOF
if [ ! -f ./nsenter ]; then
echo "ERROR: nsenter build failed, log:"
Expand All @@ -91,6 +85,16 @@ EOF
fi
echo "INFO: nsenter build OK"
sudo mv ./nsenter /usr/local/bin
}

if [[ "${USE_MINIKUBE_DRIVER_NONE:-}" = "true" ]]; then
# Run minikube with none driver.
# See https://blog.travis-ci.com/2017-10-26-running-kubernetes-on-travis-ci-with-minikube
_VM_DRIVER="--vm-driver=none"
if [[ ! -x /usr/local/bin/nsenter ]]; then
# From https://engineering.bitnami.com/articles/implementing-kubernetes-integration-tests-in-travis.html
# Travis ubuntu trusty env doesn't have nsenter, needed for --vm-driver=none
check_or_build_nsenter
fi
fi

Expand Down