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

The service supports custom annotations. #3

Open
jugggao opened this issue Mar 29, 2024 · 3 comments
Open

The service supports custom annotations. #3

jugggao opened this issue Mar 29, 2024 · 3 comments
Labels
TransByAI Translated by AI/GPT.

Comments

@jugggao
Copy link

jugggao commented Mar 29, 2024

As the subject indicates.

TRANS_BY_GPT4

@winlinvip winlinvip changed the title service 支持自定义 annotations The service supports custom annotations. Mar 29, 2024
@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Mar 29, 2024
@jugggao
Copy link
Author

jugggao commented Mar 29, 2024

example:

apiVersion: v1
kind: Service
metadata:
  name: {{ include "srs.fullname" . }}
  labels:
    {{- include "srs.labels" . | nindent 4 }}
  {{- with .Values.service.annotations }}
  annotations:
    {{- toYaml . | nindent 4 }}
  {{- end }}
spec:
  {{- if (or (eq .Values.service.type "ClusterIP" "") (empty .Values.service.type)) }}
  type: {{ .Values.service.type }}
  {{- if not (empty .Values.service.clusterIP) }}
  clusterIP: {{ .Values.service.clusterIP }}
  {{- end }}
  {{- else if eq .Values.service.type "LoadBalancer" }}
  type: {{ .Values.service.type }}
  loadBalancerIP: {{ default "" .Values.service.loadBalancerIP }}
  {{- else }}
  type: {{ .Values.service.type }}
  {{- end }}

@jugggao
Copy link
Author

jugggao commented Mar 29, 2024

Ingress requires some modifications to function properly with the SRS player for WHEP playback.

ingress.yaml:

spec:
  {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
  ingressClassName: {{ .Values.ingress.className }}
  {{- end }}
  {{- if .Values.ingress.tls }}
  tls:
    {{- range .Values.ingress.tls }}
    - hosts:
        {{- range .hosts }}
        - {{ . | quote }}
        {{- end }}
      secretName: {{ .secretName }}
    {{- end }}
  {{- end }}
  rules:
    {{- range .Values.ingress.hosts }}
    - host: {{ .host | quote }}
      http:
        paths:
          {{- range .paths }}
          - path: {{ .path }}
            {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
            pathType: {{ .pathType }}
            {{- end }}
            backend:
              {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
              service:
                name: {{ $fullName }}
                port:
                  number: {{ .svcPort }}
              {{- else }}
              serviceName: {{ $fullName }}
              servicePort: {{ .svcPort }}
              {{- end }}
          {{- end }}
    {{- end }}
{{- end }}

values-custom.yaml:

ingress:
  enabled: true
  className: "nginx-common"
  annotations: {}
  hosts:
  - host: nonprod-srs.example.cn
    paths:
    - path: /
      pathType: ImplementationSpecific
      svcPort: 8080
    - path: /api
      pathType: ImplementationSpecific
      svcPort: 1985
    - path: /rtc
      pathType: ImplementationSpecific
      svcPort: 1985
  tls:
  - hosts:
    - nonprod-srs.example.cn
    secretName: example-tls

TRANS_BY_GPT4

@jugggao
Copy link
Author

jugggao commented Mar 29, 2024

I am just an operations staff member and not very clear about the software logic. The above is just a suggestion. Perhaps you have a better method to proxy the API and HTTP.

TRANS_BY_GPT4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TransByAI Translated by AI/GPT.
Projects
None yet
Development

No branches or pull requests

2 participants