apiserver-template.yaml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. apiVersion: template.openshift.io/v1
  2. kind: Template
  3. metadata:
  4. name: template-service-broker-apiserver
  5. parameters:
  6. - name: IMAGE
  7. value: openshift/origin:latest
  8. - name: NAMESPACE
  9. value: openshift-template-service-broker
  10. - name: LOGLEVEL
  11. value: "0"
  12. - name: API_SERVER_CONFIG
  13. value: |
  14. kind: TemplateServiceBrokerConfig
  15. apiVersion: config.templateservicebroker.openshift.io/v1
  16. templateNamespaces:
  17. - openshift
  18. objects:
  19. # to create the tsb server
  20. - apiVersion: extensions/v1beta1
  21. kind: DaemonSet
  22. metadata:
  23. namespace: ${NAMESPACE}
  24. name: apiserver
  25. labels:
  26. apiserver: "true"
  27. spec:
  28. template:
  29. metadata:
  30. name: apiserver
  31. labels:
  32. apiserver: "true"
  33. spec:
  34. serviceAccountName: apiserver
  35. containers:
  36. - name: c
  37. image: ${IMAGE}
  38. imagePullPolicy: IfNotPresent
  39. command:
  40. - "/usr/bin/openshift"
  41. - "start"
  42. - "template-service-broker"
  43. - "--secure-port=8443"
  44. - "--audit-log-path=-"
  45. - "--tls-cert-file=/var/serving-cert/tls.crt"
  46. - "--tls-private-key-file=/var/serving-cert/tls.key"
  47. - "--loglevel=${LOGLEVEL}"
  48. - "--config=/var/apiserver-config/apiserver-config.yaml"
  49. ports:
  50. - containerPort: 8443
  51. volumeMounts:
  52. - mountPath: /var/serving-cert
  53. name: serving-cert
  54. - mountPath: /var/apiserver-config
  55. name: apiserver-config
  56. readinessProbe:
  57. httpGet:
  58. path: /healthz
  59. port: 8443
  60. scheme: HTTPS
  61. volumes:
  62. - name: serving-cert
  63. secret:
  64. defaultMode: 420
  65. secretName: apiserver-serving-cert
  66. - name: apiserver-config
  67. configMap:
  68. defaultMode: 420
  69. name: apiserver-config
  70. # to create the config for the TSB
  71. - apiVersion: v1
  72. kind: ConfigMap
  73. metadata:
  74. namespace: ${NAMESPACE}
  75. name: apiserver-config
  76. data:
  77. apiserver-config.yaml: ${API_SERVER_CONFIG}
  78. # to be able to assign powers to the process
  79. - apiVersion: v1
  80. kind: ServiceAccount
  81. metadata:
  82. namespace: ${NAMESPACE}
  83. name: apiserver
  84. # to be able to expose TSB inside the cluster
  85. - apiVersion: v1
  86. kind: Service
  87. metadata:
  88. namespace: ${NAMESPACE}
  89. name: apiserver
  90. annotations:
  91. service.alpha.openshift.io/serving-cert-secret-name: apiserver-serving-cert
  92. spec:
  93. selector:
  94. apiserver: "true"
  95. ports:
  96. - port: 443
  97. targetPort: 8443
  98. # This service account will be granted permission to call the TSB.
  99. # The token for this SA will be provided to the service catalog for
  100. # use when calling the TSB.
  101. - apiVersion: v1
  102. kind: ServiceAccount
  103. metadata:
  104. namespace: ${NAMESPACE}
  105. name: templateservicebroker-client
  106. # This secret will be populated with a copy of the templateservicebroker-client SA's
  107. # auth token. Since this secret has a static name, it can be referenced more
  108. # easily than the auto-generated secret for the service account.
  109. - apiVersion: v1
  110. kind: Secret
  111. metadata:
  112. namespace: ${NAMESPACE}
  113. name: templateservicebroker-client
  114. annotations:
  115. kubernetes.io/service-account.name: templateservicebroker-client
  116. type: kubernetes.io/service-account-token