Skip to content

Commit

Permalink
Merge pull request #20314 from deads2k/oc-01-serving-cert
Browse files Browse the repository at this point in the history
use the service cert signing project
  • Loading branch information
openshift-merge-robot authored Jul 17, 2018
2 parents 893b40d + e1f0b61 commit 179c130
Show file tree
Hide file tree
Showing 8 changed files with 599 additions and 51 deletions.
51 changes: 34 additions & 17 deletions install/openshift-apiserver/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,12 @@ objects:
privileged: true
runAsUser: 0
volumeMounts:
- mountPath: /etc/origin/master/
name: master-config
- mountPath: /etc/origin/cloudprovider/
name: master-cloud-provider
- mountPath: /var/serving-cert
name: serving-cert
- mountPath: /etc/origin/master/
name: master-config
- mountPath: /etc/origin/cloudprovider/
name: master-cloud-provider
readinessProbe:
httpGet:
path: /healthz
Expand All @@ -73,6 +75,9 @@ objects:
- name: master-cloud-provider
hostPath:
path: /etc/origin/cloudprovider
- name: serving-cert
secret:
secretName: serving-cert


# to be able to assign powers to the process
Expand All @@ -88,7 +93,7 @@ objects:
namespace: ${NAMESPACE}
name: api
annotations:
service.alpha.openshift.io/serving-cert-secret-name: apiserver-serving-cert
service.alpha.openshift.io/serving-cert-secret-name: serving-cert
spec:
selector:
openshift.io/component: api
Expand All @@ -101,166 +106,178 @@ objects:
kind: APIService
metadata:
name: v1.apps.openshift.io
annotations:
service.alpha.openshift.io/inject-cabundle: "true"
spec:
group: apps.openshift.io
version: v1
service:
namespace: openshift-apiserver
name: api
insecureSkipTLSVerify: true
groupPriorityMinimum: 9900
versionPriority: 15

- apiVersion: apiregistration.k8s.io/v1beta1
kind: APIService
metadata:
name: v1.authorization.openshift.io
annotations:
service.alpha.openshift.io/inject-cabundle: "true"
spec:
group: authorization.openshift.io
version: v1
service:
namespace: openshift-apiserver
name: api
insecureSkipTLSVerify: true
groupPriorityMinimum: 9900
versionPriority: 15

- apiVersion: apiregistration.k8s.io/v1beta1
kind: APIService
metadata:
name: v1.build.openshift.io
annotations:
service.alpha.openshift.io/inject-cabundle: "true"
spec:
group: build.openshift.io
version: v1
service:
namespace: openshift-apiserver
name: api
insecureSkipTLSVerify: true
groupPriorityMinimum: 9900
versionPriority: 15

- apiVersion: apiregistration.k8s.io/v1beta1
kind: APIService
metadata:
name: v1.image.openshift.io
annotations:
service.alpha.openshift.io/inject-cabundle: "true"
spec:
group: image.openshift.io
version: v1
service:
namespace: openshift-apiserver
name: api
insecureSkipTLSVerify: true
groupPriorityMinimum: 9900
versionPriority: 15

- apiVersion: apiregistration.k8s.io/v1beta1
kind: APIService
metadata:
name: v1.network.openshift.io
annotations:
service.alpha.openshift.io/inject-cabundle: "true"
spec:
group: network.openshift.io
version: v1
service:
namespace: openshift-apiserver
name: api
insecureSkipTLSVerify: true
groupPriorityMinimum: 9900
versionPriority: 15

- apiVersion: apiregistration.k8s.io/v1beta1
kind: APIService
metadata:
name: v1.oauth.openshift.io
annotations:
service.alpha.openshift.io/inject-cabundle: "true"
spec:
group: oauth.openshift.io
version: v1
service:
namespace: openshift-apiserver
name: api
insecureSkipTLSVerify: true
groupPriorityMinimum: 9900
versionPriority: 15

- apiVersion: apiregistration.k8s.io/v1beta1
kind: APIService
metadata:
name: v1.project.openshift.io
annotations:
service.alpha.openshift.io/inject-cabundle: "true"
spec:
group: project.openshift.io
version: v1
service:
namespace: openshift-apiserver
name: api
insecureSkipTLSVerify: true
groupPriorityMinimum: 9900
versionPriority: 15

- apiVersion: apiregistration.k8s.io/v1beta1
kind: APIService
metadata:
name: v1.quota.openshift.io
annotations:
service.alpha.openshift.io/inject-cabundle: "true"
spec:
group: quota.openshift.io
version: v1
service:
namespace: openshift-apiserver
name: api
insecureSkipTLSVerify: true
groupPriorityMinimum: 9900
versionPriority: 15

- apiVersion: apiregistration.k8s.io/v1beta1
kind: APIService
metadata:
name: v1.route.openshift.io
annotations:
service.alpha.openshift.io/inject-cabundle: "true"
spec:
group: route.openshift.io
version: v1
service:
namespace: openshift-apiserver
name: api
insecureSkipTLSVerify: true
groupPriorityMinimum: 9900
versionPriority: 15

- apiVersion: apiregistration.k8s.io/v1beta1
kind: APIService
metadata:
name: v1.security.openshift.io
annotations:
service.alpha.openshift.io/inject-cabundle: "true"
spec:
group: security.openshift.io
version: v1
service:
namespace: openshift-apiserver
name: api
insecureSkipTLSVerify: true
groupPriorityMinimum: 9900
versionPriority: 15

- apiVersion: apiregistration.k8s.io/v1beta1
kind: APIService
metadata:
name: v1.template.openshift.io
annotations:
service.alpha.openshift.io/inject-cabundle: "true"
spec:
group: template.openshift.io
version: v1
service:
namespace: openshift-apiserver
name: api
insecureSkipTLSVerify: true
groupPriorityMinimum: 9900
versionPriority: 15

- apiVersion: apiregistration.k8s.io/v1beta1
kind: APIService
metadata:
name: v1.user.openshift.io
annotations:
service.alpha.openshift.io/inject-cabundle: "true"
spec:
group: user.openshift.io
version: v1
service:
namespace: openshift-apiserver
name: api
insecureSkipTLSVerify: true
groupPriorityMinimum: 9900
versionPriority: 15
26 changes: 26 additions & 0 deletions install/openshift-service-cert-signer-operator/install-rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: template.openshift.io/v1
kind: Template
parameters:
- name: IMAGE
value: openshift/origin-control-plane:latest
- name: OPENSHIFT_PULL_POLICY
value: Always
- name: NAMESPACE
value: openshift-core-operators
- name: LOGLEVEL
value: "0"

objects:

# When we have an orchestrating operator, it will do this
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: system:openshift:operator:service-cert-signer
roleRef:
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
namespace: ${NAMESPACE}
name: openshift-service-cert-signer-operator
105 changes: 105 additions & 0 deletions install/openshift-service-cert-signer-operator/install.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
apiVersion: template.openshift.io/v1
kind: Template
parameters:
- name: IMAGE
value: openshift/origin-service-serving-cert-signer:latest
- name: OPENSHIFT_PULL_POLICY
value: Always
- name: NAMESPACE
value: openshift-core-operators
- name: LOGLEVEL
value: "0"

objects:
- apiVersion: v1
kind: Namespace
metadata:
labels:
openshift.io/run-level: "1"
name: openshift-core-operators

- apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: servicecertsigneroperatorconfigs.servicecertsigner.config.openshift.io
spec:
scope: Cluster
group: servicecertsigner.config.openshift.io
version: v1alpha1
names:
kind: ServiceCertSignerOperatorConfig
plural: servicecertsigneroperatorconfigs
singular: servicecertsigneroperatorconfig
subresources:
status: {}

- apiVersion: v1
kind: ConfigMap
metadata:
namespace: ${NAMESPACE}
name: openshift-service-cert-signer-operator-config
data:
operator-config.yaml: |
apiVersion: operator.openshift.io/v1alpha1
kind: GenericOperatorConfig
- apiVersion: apps/v1
kind: Deployment
metadata:
namespace: ${NAMESPACE}
name: openshift-service-cert-signer-operator
labels:
app: openshift-service-cert-signer-operator
spec:
replicas: 1
selector:
matchLabels:
app: openshift-service-cert-signer-operator
template:
metadata:
name: openshift-service-cert-signer-operator
labels:
app: openshift-service-cert-signer-operator
spec:
serviceAccountName: openshift-service-cert-signer-operator
containers:
- name: operator
image: openshift/origin-service-serving-cert-signer:v3.11
imagePullPolicy: ${OPENSHIFT_PULL_POLICY}
command: ["service-serving-cert-signer", "operator"]
args:
- "--config=/var/run/configmaps/config/operator-config.yaml"
- "-v=4"
volumeMounts:
- mountPath: /var/run/configmaps/config
name: config
volumes:
- name: serving-cert
secret:
defaultMode: 400
secretName: openshift-service-cert-signer-operator-serving-cert
optional: true
- name: config
configMap:
defaultMode: 440
name: openshift-service-cert-signer-operator-config

- apiVersion: v1
kind: ServiceAccount
metadata:
namespace: ${NAMESPACE}
name: openshift-service-cert-signer-operator
labels:
app: openshift-service-cert-signer-operator

- apiVersion: servicecertsigner.config.openshift.io/v1alpha1
kind: ServiceCertSignerOperatorConfig
metadata:
name: instance
spec:
managementState: Managed
imagePullSpec: openshift/origin-service-serving-cert-signer:v3.11
version: 3.10.0
logging:
level: 4
replicas: 1
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ func MakeOpenShiftAPIServerConfig(existingMasterConfig string, routingSuffix, ba
// hardcode the route suffix to the old default. If anyone wants to change it, they can modify their config.
masterconfig.RoutingConfig.Subdomain = routingSuffix

// use the generated service serving cert
masterconfig.ServingInfo.ServerCert.CertFile = "/var/serving-cert/tls.crt"
masterconfig.ServingInfo.ServerCert.KeyFile = "/var/serving-cert/tls.key"

// default openshift image policy admission
if masterconfig.AdmissionConfig.PluginConfig == nil {
masterconfig.AdmissionConfig.PluginConfig = map[string]*configapi.AdmissionPluginConfig{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ func MakeOpenShiftControllerConfig(existingMasterConfig string, basedir string)
masterconfig := configObj.(*configapi.MasterConfig)
masterconfig.ServingInfo.BindAddress = "0.0.0.0:8444"

// disable the service serving cert signer because that runs in a separate pod now
masterconfig.ControllerConfig.Controllers = []string{
"*",
"-openshift.io/service-serving-cert",
}

configBytes, err := configapilatest.WriteYAML(masterconfig)
if err != nil {
return "", err
Expand Down
Loading

0 comments on commit 179c130

Please sign in to comment.