Skip to content

Commit

Permalink
add scheduler extender certs
Browse files Browse the repository at this point in the history
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
  • Loading branch information
AleksZimin committed Aug 11, 2024
1 parent ac34ac4 commit c4894c8
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
42 changes: 42 additions & 0 deletions hooks/generate_scheduler_extender_certs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env python3
#
# Copyright 2023 Flant JSC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


from lib.hooks.internal_tls import GenerateCertificateHook, TlsSecret, default_sans
from lib.module import values as module_values
from deckhouse import hook
from typing import Callable
import common

def main():
hook = GenerateCertificateHook(
TlsSecret(
cn="sds-local-volume-scheduler-extender",
name="scheduler-extender-https-certs",
sansGenerator=default_sans([
"sds-local-volume-scheduler-extender",
f"sds-local-volume-scheduler-extender.{common.NAMESPACE}",
f"sds-local-volume-scheduler-extender.{common.NAMESPACE}.svc"]),
values_path_prefix=f"{common.MODULE_NAME}.internal.customSchedulerExtenderCert"
),
cn="sds-local-volume-scheduler-extender",
common_ca=True,
namespace=common.NAMESPACE)

hook.run()

if __name__ == "__main__":
main()
12 changes: 12 additions & 0 deletions templates/sds-local-volume-scheduler-extender/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
apiVersion: v1
kind: Secret
metadata:
name: scheduler-extender-https-certs
namespace: d8-{{ .Chart.Name }}
{{- include "helm_lib_module_labels" (list . (dict "app" "{{ .Chart.Name }}-scheduler-extender")) | nindent 2 }}
type: kubernetes.io/tls
data:
ca.crt: {{ .Values.sdsLocalVolume.internal.customSchedulerExtenderCert.ca }}
tls.crt: {{ .Values.sdsLocalVolume.internal.customSchedulerExtenderCert.crt }}
tls.key: {{ .Values.sdsLocalVolume.internal.customSchedulerExtenderCert.key }}

0 comments on commit c4894c8

Please sign in to comment.