Skip to content

Sync v0.1.0 rc2 #16908

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

Merged
merged 3 commits into from
Oct 20, 2017
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .tito/lib/origin/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def get_os_git_vars():
shell utilities. The git tree state is spoofed.
"""
git_vars = {}
for var in ["COMMIT", "VERSION", "MAJOR", "MINOR"]:
for var in ["COMMIT", "VERSION", "MAJOR", "MINOR", "CATALOG_VERSION"]:
var_name = "OS_GIT_{}".format(var)
git_vars[var_name] = run_command(
"bash -c 'source ./hack/lib/init.sh; os::build::version::openshift_vars; echo ${}'".format(var_name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ cache:
script:
- make verify build test images
deploy:
skip_cleanup: true
provider: script
script: contrib/travis/deploy.sh
on:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,13 @@ def test_zone = params.TEST_ZONE ?: 'us-west1-b'
def namespace = 'catalog'
def root_path = 'src/github.com/kubernetes-incubator/service-catalog'
def timeoutMin = 30
def certFolder = '/tmp/sc-certs'

node {
echo "Service Catalog end-to-end test"

sh "sudo rm -rf ${env.WORKSPACE}/*"
sh "rm -rf ${certFolder} && mkdir ${certFolder}"

updatePullRequest('run')

Expand Down Expand Up @@ -120,6 +122,7 @@ node {
--create-artifacts
"""

/*
ansiColor('xterm-darker-gray') {
// Run the e2e test framework
sh """${env.ROOT}/contrib/jenkins/run_e2e.sh \
Expand All @@ -129,6 +132,7 @@ node {
--create-artifacts
"""
}
*/

echo 'Run succeeded.'
}
Expand All @@ -137,8 +141,9 @@ node {
currentBuild.result = 'FAILURE'
} finally {
archiveArtifacts artifacts: 'walkthrough*.txt', fingerprint: true
archiveArtifacts artifacts: 'e2e*.txt', fingerprint: true
// archiveArtifacts artifacts: 'e2e*.txt', fingerprint: true
try {
sh "rm -rf ${certFolder}"
sh """${env.ROOT}/contrib/jenkins/cleanup_cluster.sh --kubeconfig ${KUBECONFIG}"""
} catch (Exception e) {
echo 'Exception caught during cleanup.'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ USER_BROKER_IMAGE = $(REGISTRY)user-broker-$(ARCH):$(VERSION)
USER_BROKER_MUTABLE_IMAGE = $(REGISTRY)user-broker-$(ARCH):$(MUTABLE_TAG)

# precheck to avoid kubernetes-incubator/service-catalog#361
$(if $(realpath vendor/k8s.io/kubernetes/vendor), \
$(error the vendor directory exists in the kubernetes \
$(if $(realpath vendor/k8s.io/apimachinery/vendor), \
$(error the vendor directory exists in the apimachinery \
vendored source and must be flattened. \
run 'glide i -v'))

Expand Down Expand Up @@ -188,6 +188,7 @@ $(BINDIR)/e2e.test: .init $(NEWEST_E2ETEST_SOURCE) $(NEWEST_GO_FILE)
# Generate conversions
$(DOCKER_CMD) $(BINDIR)/conversion-gen \
--v 1 --logtostderr \
--extra-peer-dirs k8s.io/api/core/v1,k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/conversion,k8s.io/apimachinery/pkg/runtime \
--go-header-file "vendor/github.com/kubernetes/repo-infra/verify/boilerplate/boilerplate.go.txt" \
--input-dirs "$(SC_PKG)/pkg/apis/servicecatalog" \
--input-dirs "$(SC_PKG)/pkg/apis/servicecatalog/v1beta1" \
Expand Down Expand Up @@ -228,6 +229,7 @@ verify: .init .generate_files verify-client-gen
@# observes conventions from upstream that will not pass lint checks).
@$(DOCKER_CMD) sh -c \
'for i in $$(find $(TOP_SRC_DIRS) -name *.go \
| grep -v ^pkg/kubernetes/ \
| grep -v generated \
| grep -v ^pkg/client/ \
| grep -v v1beta1/defaults.go); \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ _somewhere_ in a simple way:
cluster as the consumer or a different cluster, or even creating a new
tenant in a multi-tenant SaaS system. The point is that the
consumer doesn't have to be aware of or care at all about the details.
3. The user requests a _credential_ to use the service instance in their application
3. The user requests a _binding_ to use the service instance in their application

Credentials are delivered to users in normal Kubernetes secrets and
contain information necessary to connect to and authenticate to the
Expand All @@ -59,13 +59,6 @@ Kubernetes 1.8. See the
[milestones list](https://github.com/kubernetes-incubator/service-catalog/milestones?direction=desc&sort=due_date&state=open)
for information about the issues and PRs in current and future milestones.

**NOTE**: Some fields in our API may still be considered **ALPHA** after the
API graduates to **BETA**. These fields are prefixed with `alpha` in
JSON/YAML. Alpha fields are provided for use at your own risk, may not work
correctly, may be subject to change or removal at any time, and will not have
data migration provided for them when they graduate past alpha. When an alpha
field graduates past alpha, the `alpha` prefix will be removed.

The project [roadmap](https://github.com/kubernetes-incubator/service-catalog/wiki/Roadmap)
contains information about our high-level goals for future milestones.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ RUN curl -sSL https://github.com/Masterminds/glide/releases/download/$GLIDE_VERS
| tar -vxz -C /usr/local/bin --strip=1

# Install etcd
RUN curl -sSL https://github.com/coreos/etcd/releases/download/v3.1.0/etcd-v3.1.0-linux-amd64.tar.gz \
| tar -vxz -C /usr/local/bin --strip=1 etcd-v3.1.0-linux-amd64/etcd
RUN curl -sSL https://github.com/coreos/etcd/releases/download/v3.1.10/etcd-v3.1.10-linux-amd64.tar.gz \
| tar -vxz -C /usr/local/bin --strip=1 etcd-v3.1.10-linux-amd64/etcd

# Install the golint, use this to check our source for niceness
RUN go get -u github.com/golang/lint/golint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fi

# Gather the list of files that appear to be shell scripts.
# Meaning they have some form of "#!...sh" as a line in them.
shFiles=$(grep -rl '^#!.*sh$' $args)
shFiles=$(grep -rl '^#!.*sh$' $args | grep -v ^pkg/kubernetes/)

tmp=/tmp/out$RANDOM
for file in ${shFiles}; do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ chart and their default values.

| Parameter | Description | Default |
|-----------|-------------|---------|
| `apiserver.image` | apiserver image to use | `quay.io/kubernetes-service-catalog/apiserver:v0.1.0-rc1` |
| `apiserver.image` | apiserver image to use | `quay.io/kubernetes-service-catalog/apiserver:v0.1.0-rc2` |
| `apiserver.imagePullPolicy` | `imagePullPolicy` for the apiserver | `Always` |
| `apiserver.tls.cert` | Base64-encoded x509 certificate | A self-signed certificate |
| `apiserver.tls.key` | Base64-encoded private key | The private key for the certificate above |
Expand All @@ -53,12 +53,13 @@ chart and their default values.
| `apiserver.storage.etcd.servers` | If storage type is `etcd`: etcd URL(s); override this if NOT using embedded etcd | `http://localhost:2379` |
| `apiserver.verbosity` | Log level; valid values are in the range 0 - 10 | `10` |
| `apiserver.auth.enabled` | Enable authentication and authorization | `false` |
| `controllerManager.image` | controller-manager image to use | `quay.io/kubernetes-service-catalog/controller-manager:v0.1.0-rc1` |
| `controllerManager.image` | controller-manager image to use | `quay.io/kubernetes-service-catalog/controller-manager:v0.1.0-rc2` |
| `controllerManager.imagePullPolicy` | `imagePullPolicy` for the controller-manager | `Always` |
| `controllerManager.verbosity` | Log level; valid values are in the range 0 - 10 | `10` |
| `controllerManager.resyncInterval` | How often the controller should resync informers; duration format (`20m`, `1h`, etc) | `5m` |
| `controllerManager.brokerRelistInterval` | How often the controller should relist the catalogs of ready brokers; duration format (`20m`, `1h`, etc) | `24h` |
| `useAggregator` | whether or not to set up the controller-manager to go through the main Kubernetes API server's API aggregator (requires setting `apiserver.tls.ca` to work) | `false` |
| `rbacEnable` | If true, create & use RBAC resources | `true` |

Specify each parameter using the `--set key=value[,key=value]` argument to
`helm install`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,15 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
{{- define "fullname" -}}
{{- printf "%s-%s" .Release.Name .Chart.Name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Conditionally print out rbac api verison.
This will select v1 before v1beta1 if both are available.
*/}}
{{- define "rbacApiVersion" -}}
{{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1" -}}
rbac.authorization.k8s.io/v1
{{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1beta1" -}}
rbac.authorization.k8s.io/v1beta1
{{- end -}}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1beta1" }}
{{- if .Values.rbacEnable }}
apiVersion: v1
kind: List
items:

### API Server ###

# TODO: if this is just for namespace lifecycle admission, move to a generic role
# the role for the apiserver
- apiVersion: rbac.authorization.k8s.io/v1beta1
- apiVersion: {{template "rbacApiVersion" . }}
kind: ClusterRole
metadata:
name: "servicecatalog.k8s.io:apiserver"
Expand All @@ -18,7 +18,7 @@ items:
resources: ["namespaces"]
verbs: ["get", "list", "watch"]
# API-server service-account gets its own role
- apiVersion: rbac.authorization.k8s.io/v1beta1
- apiVersion: {{template "rbacApiVersion" . }}
kind: ClusterRoleBinding
metadata:
name: "servicecatalog.k8s.io:apiserver"
Expand All @@ -33,7 +33,7 @@ items:
namespace: "{{ .Release.Namespace }}"
# apiserver gets the auth-delegator role to delegate auth decisions to
# the core apiserver
- apiVersion: rbac.authorization.k8s.io/v1beta1
- apiVersion: {{template "rbacApiVersion" . }}
kind: ClusterRoleBinding
metadata:
name: "servicecatalog.k8s.io:apiserver-auth-delegator"
Expand All @@ -49,7 +49,7 @@ items:
# apiserver gets the ability to read authentication. This allows it to
# read the specific configmap that has the requestheader-* entries to
# enable api aggregation
- apiVersion: rbac.authorization.k8s.io/v1beta1
- apiVersion: {{template "rbacApiVersion" . }}
kind: RoleBinding
metadata:
name: "servicecatalog.k8s.io:apiserver-authentication-reader"
Expand All @@ -69,7 +69,7 @@ items:
# controller-manager role defines what access the service-catalog
# controller-manager needs to manage the resources of the
# service-catalog
- apiVersion: rbac.authorization.k8s.io/v1beta1
- apiVersion: {{template "rbacApiVersion" . }}
kind: ClusterRole
metadata:
name: "servicecatalog.k8s.io:controller-manager"
Expand Down Expand Up @@ -98,7 +98,7 @@ items:
resources: ["clusterservicebrokers/status","serviceinstances/status","serviceinstances/reference","servicebindings/status"]
verbs: ["update"]
# give the controller-manager service account access to whats defined in its role.
- apiVersion: rbac.authorization.k8s.io/v1beta1
- apiVersion: {{template "rbacApiVersion" . }}
kind: ClusterRoleBinding
metadata:
name: "servicecatalog.k8s.io:controller-manager"
Expand All @@ -114,7 +114,7 @@ items:

# This gives create/update access to an endpoint in kube-system for leader election
# TODO: use an object other than endpoints, and in the same namespace as the service catalog, not in kube-system
- apiVersion: rbac.authorization.k8s.io/v1beta1
- apiVersion: {{template "rbacApiVersion" . }}
kind: Role
metadata:
name: "servicecatalog.k8s.io:leader-locking-controller-manager"
Expand All @@ -127,7 +127,7 @@ items:
resources: ["endpoints"]
resourceNames: ["service-catalog-controller-manager"]
verbs: ["get","update"]
- apiVersion: rbac.authorization.k8s.io/v1beta1
- apiVersion: {{template "rbacApiVersion" . }}
kind: RoleBinding
metadata:
name: service-catalog-controller-manager
Expand All @@ -141,4 +141,4 @@ items:
kind: ServiceAccount
name: "{{ .Values.controllerManager.serviceAccount }}"
namespace: "{{ .Release.Namespace }}"
{{ end }}
{{end}}
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Default values for Service Catalog
# determines whether the API server should be registered with the kube-aggregator
useAggregator: false
## If true, create & use RBAC resources
##
rbacEnable: true
apiserver:
# apiserver image to use
image: quay.io/kubernetes-service-catalog/apiserver:v0.1.0-rc1
image: quay.io/kubernetes-service-catalog/apiserver:v0.1.0-rc2
# imagePullPolicy for the apiserver; valid values are "IfNotPresent",
# "Never", and "Always"
imagePullPolicy: Always
Expand Down Expand Up @@ -68,7 +71,7 @@ apiserver:
serviceAccount: service-catalog-apiserver
controllerManager:
# controller-manager image to use
image: quay.io/kubernetes-service-catalog/controller-manager:v0.1.0-rc1
image: quay.io/kubernetes-service-catalog/controller-manager:v0.1.0-rc2
# imagePullPolicy for the controller-manager; valid values are
# "IfNotPresent", "Never", and "Always"
imagePullPolicy: Always
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Service Broker

| Parameter | Description | Default |
|-----------|-------------|---------|
| `image` | Image to use | `quay.io/kubernetes-service-catalog/user-broker:v0.1.0-rc1` |
| `image` | Image to use | `quay.io/kubernetes-service-catalog/user-broker:v0.1.0-rc2` |
| `imagePullPolicy` | `imagePullPolicy` for the ups-broker | `Always` |

Specify each parameter using the `--set key=value[,key=value]` argument to
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Default values for User-Provided Service Broker
# Image to use
image: quay.io/kubernetes-service-catalog/user-broker:v0.1.0-rc1
image: quay.io/kubernetes-service-catalog/user-broker:v0.1.0-rc2
# ImagePullPolicy; valid values are "IfNotPresent", "Never", and "Always"
imagePullPolicy: Always
# Certificate details to use for TLS. Leave blank to not use TLS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (

"github.com/golang/glog"
"github.com/kubernetes-incubator/service-catalog/pkg"
"github.com/kubernetes-incubator/service-catalog/pkg/kubernetes/pkg/util/interrupt"
"github.com/kubernetes-incubator/service-catalog/pkg/registry/servicecatalog/server"
"github.com/kubernetes-incubator/service-catalog/plugin/pkg/admission/broker/authsarcheck"
"github.com/kubernetes-incubator/service-catalog/plugin/pkg/admission/namespace/lifecycle"
Expand All @@ -32,7 +33,6 @@ import (
"github.com/spf13/cobra"
"k8s.io/apiserver/pkg/admission"
genericserveroptions "k8s.io/apiserver/pkg/server/options"
"k8s.io/kubernetes/pkg/util/interrupt"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ import (
"k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/tools/record"

"github.com/kubernetes-incubator/service-catalog/pkg/kubernetes/pkg/util/configz"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/apiserver/pkg/server/healthz"
"k8s.io/client-go/tools/leaderelection"
"k8s.io/client-go/tools/leaderelection/resourcelock"
"k8s.io/kubernetes/pkg/util/configz"

// The API groups for our API must be installed before we can use the
// client to work with them. This needs to be done once per process; this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import (
utilfeature "k8s.io/apiserver/pkg/util/feature"

"github.com/kubernetes-incubator/service-catalog/pkg/apis/componentconfig"
k8scomponentconfig "github.com/kubernetes-incubator/service-catalog/pkg/kubernetes/pkg/apis/componentconfig"
"github.com/kubernetes-incubator/service-catalog/pkg/kubernetes/pkg/client/leaderelectionconfig"
osb "github.com/pmorie/go-open-service-broker-client/v2"
k8scomponentconfig "k8s.io/kubernetes/pkg/apis/componentconfig"
"k8s.io/kubernetes/pkg/client/leaderelectionconfig"
)

// ControllerManagerServer is the main context object for the controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ count=0
D_HOST=${DOCKER_HOST:-localhost}
D_HOST=${D_HOST#*//} # remove leading proto://
D_HOST=${D_HOST%:*} # remove trailing port #
while ! curl --cacert ${ROOT}/.var/run/kubernetes-service-catalog/apiserver.crt https://${D_HOST}:${PORT} > /dev/null 2>&1 ; do
while ! wget --ca-certificate ${ROOT}/.var/run/kubernetes-service-catalog/apiserver.crt https://${D_HOST}:${PORT} > /dev/null 2>&1 ; do
sleep 1
(( count++ )) || true
if [ "${count}" == "30" ]; then
echo "Timed-out waiting for API Server"
(set -x ; curl --cacert ${ROOT}/.var/run/kubernetes-service-catalog/apiserver.crt https://${D_HOST}:${PORT})
(set -x ; wget --ca-certificate ${ROOT}/.var/run/kubernetes-service-catalog/apiserver.crt https://${D_HOST}:${PORT})
(set -x ; docker ps)
(set -x ; docker logs apiserver)
exit 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,34 +48,33 @@ gcloud auth activate-service-account \

echo "Creating cluster ${CLUSTERNAME}"

# Use the latest 1.6.X version that GKE offers.
# Use the latest 1.7.X version that GKE offers.
CLUSTER_VERSION="$(gcloud container get-server-config --zone "${ZONE}" \
| awk '
BEGIN {p=0};
/validMasterVersions:/ {p=1; next};
/validNodeVersions:/ {exit};
p && /1.6/ {print $2; exit}
p && /1.7/ {print $2; exit}
')"

[[ -n "${CLUSTER_VERSION}" ]] \
|| { echo 'Could not find valid 1.6.X cluster version on Google Container Engine.'; exit 1; }
|| { echo 'Could not find valid 1.7.X cluster version on Google Container Engine.'; exit 1; }

echo "Using cluster version ${CLUSTER_VERSION}"

gcloud container clusters create "${CLUSTERNAME}" --project="${PROJECT}" --zone="${ZONE}" \
--cluster-version "${CLUSTER_VERSION}" \
--cluster-version "${CLUSTER_VERSION}" --no-enable-legacy-authorization \
|| { echo 'Cannot create cluster.'; exit 1; }

echo "Using cluster ${CLUSTERNAME}."

gcloud container clusters get-credentials "${CLUSTERNAME}" --project="${PROJECT}" --zone="${ZONE}" \
|| { echo 'Cannot get credentials for cluster.'; exit 1; }

# On GKE you need to give your user proper permissions in order to create new
# cluster roles. Needed for RBAC setup.
ACCOUNT_NAME="$(gcloud info | grep Account | sed 's/.*\[\(.*\)\]/\1/')"
kubectl create clusterrolebinding jenkins-cluster-admin-binding \
--clusterrole=cluster-admin --user="${ACCOUNT_NAME}" \
# Need to give tiller proper permissions in order to create RBAC roles.
kubectl create clusterrolebinding tiller-cluster-admin \
--clusterrole=cluster-admin \
--serviceaccount=kube-system:default \
|| { echo 'Cannot not create cluster-admin role for service account.'; exit 1; }

helm init \
Expand Down
Loading