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

cluster up support for N-1 clusters #17338

Merged
merged 2 commits into from
Dec 6, 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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cmd/template-service-broker/tsb.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ import (
"github.com/golang/glog"
"github.com/openshift/origin/pkg/cmd/util/serviceability"
tsbcmd "github.com/openshift/origin/pkg/templateservicebroker/cmd/server"

// install all APIs
_ "github.com/openshift/origin/pkg/api/install"
_ "k8s.io/kubernetes/pkg/api/install"
_ "k8s.io/kubernetes/pkg/apis/autoscaling/install"
_ "k8s.io/kubernetes/pkg/apis/batch/install"
_ "k8s.io/kubernetes/pkg/apis/extensions/install"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deads2k fyi this was necessary for the TSB to be able to do restmapping successfully. And it seems utterly unsustainable.

)

func main() {
Expand Down
7 changes: 7 additions & 0 deletions hack/build-local-images.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@
"files": {},
"enable_default": False,
},
"template-service-broker": {
"directory": "template-service-broker",
"binaries": {
"template-service-broker": "/usr/bin/template-service-broker"
},
"files": {}
},
}


Expand Down
6 changes: 3 additions & 3 deletions install/templateservicebroker/apiserver-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: template-service-broker-apiserver
parameters:
- name: IMAGE
value: openshift/origin:latest
value: openshift/origin-template-service-broker:latest
- name: NAMESPACE
value: openshift-template-service-broker
- name: LOGLEVEL
Expand Down Expand Up @@ -40,14 +40,14 @@ objects:
image: ${IMAGE}
imagePullPolicy: IfNotPresent
command:
- "/usr/bin/openshift"
- "/usr/bin/template-service-broker"
- "start"
- "template-service-broker"
- "--secure-port=8443"
- "--audit-log-path=-"
- "--tls-cert-file=/var/serving-cert/tls.crt"
- "--tls-private-key-file=/var/serving-cert/tls.key"
- "--loglevel=${LOGLEVEL}"
- "-v=${LOGLEVEL}"
- "--config=/var/apiserver-config/apiserver-config.yaml"
ports:
- containerPort: 8443
Expand Down
126 changes: 126 additions & 0 deletions install/templateservicebroker/previous/apiserver-template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
apiVersion: template.openshift.io/v1
kind: Template
metadata:
name: template-service-broker-apiserver
parameters:
- name: IMAGE
value: openshift/origin:latest
- name: NAMESPACE
value: openshift-template-service-broker
- name: LOGLEVEL
value: "0"
- name: API_SERVER_CONFIG
value: |
kind: TemplateServiceBrokerConfig
apiVersion: config.templateservicebroker.openshift.io/v1
templateNamespaces:
- openshift
- name: NODE_SELECTOR
value: "{}"
objects:

# to create the tsb server
- apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
namespace: ${NAMESPACE}
name: apiserver
labels:
apiserver: "true"
spec:
template:
metadata:
name: apiserver
labels:
apiserver: "true"
spec:
serviceAccountName: apiserver
containers:
- name: c
image: ${IMAGE}
imagePullPolicy: IfNotPresent
command:
- "/usr/bin/openshift"
- "start"
- "template-service-broker"
- "--secure-port=8443"
- "--audit-log-path=-"
- "--tls-cert-file=/var/serving-cert/tls.crt"
- "--tls-private-key-file=/var/serving-cert/tls.key"
- "--loglevel=${LOGLEVEL}"
- "--config=/var/apiserver-config/apiserver-config.yaml"
ports:
- containerPort: 8443
volumeMounts:
- mountPath: /var/serving-cert
name: serving-cert
- mountPath: /var/apiserver-config
name: apiserver-config
readinessProbe:
httpGet:
path: /healthz
port: 8443
scheme: HTTPS
nodeSelector: "${{NODE_SELECTOR}}"
volumes:
- name: serving-cert
secret:
defaultMode: 420
secretName: apiserver-serving-cert
- name: apiserver-config
configMap:
defaultMode: 420
name: apiserver-config

# to create the config for the TSB
- apiVersion: v1
kind: ConfigMap
metadata:
namespace: ${NAMESPACE}
name: apiserver-config
data:
apiserver-config.yaml: ${API_SERVER_CONFIG}

# to be able to assign powers to the process
- apiVersion: v1
kind: ServiceAccount
metadata:
namespace: ${NAMESPACE}
name: apiserver

# to be able to expose TSB inside the cluster
- apiVersion: v1
kind: Service
metadata:
namespace: ${NAMESPACE}
name: apiserver
annotations:
service.alpha.openshift.io/serving-cert-secret-name: apiserver-serving-cert
spec:
selector:
apiserver: "true"
ports:
- name: https
port: 443
targetPort: 8443

# This service account will be granted permission to call the TSB.
# The token for this SA will be provided to the service catalog for
# use when calling the TSB.
- apiVersion: v1
kind: ServiceAccount
metadata:
namespace: ${NAMESPACE}
name: templateservicebroker-client

# This secret will be populated with a copy of the templateservicebroker-client SA's
# auth token. Since this secret has a static name, it can be referenced more
# easily than the auto-generated secret for the service account.
- apiVersion: v1
kind: Secret
metadata:
namespace: ${NAMESPACE}
name: templateservicebroker-client
annotations:
kubernetes.io/service-account.name: templateservicebroker-client
type: kubernetes.io/service-account-token
154 changes: 151 additions & 3 deletions pkg/oc/bootstrap/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading