diff --git a/.woodpecker/build.yaml b/.woodpecker/build.yaml index ad51cc1..25475ee 100644 --- a/.woodpecker/build.yaml +++ b/.woodpecker/build.yaml @@ -21,3 +21,21 @@ steps: memory: 500Mi securityContext: privileged: true + - name: Push a helm chart + image: gitea.badhouseplants.net/badhouseplants/container-builder:latest + environment: + REGISTRY_TOKEN: + from_secret: GITEA_REGISTRY_TOKEN + privileged: true + commands: + - build-container + backend_options: + kubernetes: + resources: + requests: + memory: 500Mi + cpu: 200m + limits: + memory: 500Mi + securityContext: + privileged: true diff --git a/helm/softplayer-backend/templates/certificate.yaml b/helm/softplayer-backend/templates/certificate.yaml index fc912d1..b5f9cb6 100644 --- a/helm/softplayer-backend/templates/certificate.yaml +++ b/helm/softplayer-backend/templates/certificate.yaml @@ -7,9 +7,9 @@ metadata: {{- include "softplayer-backend.labels" . | nindent 4 }} spec: dnsNames: - - softplayer-backend.badhouseplants.net + - {{ .Values.ingressRoute.url }} issuerRef: group: cert-manager.io kind: ClusterIssuer - name: badhouseplants-issuer-http01 - secretName: softplayer-backend.badhouseplants.net + name: {{ .Values.ingressRoute.clusterIssuer }} + secretName: {{ .Values.ingressRoute.url }} diff --git a/helm/softplayer-backend/templates/ingressroute.yaml b/helm/softplayer-backend/templates/ingressroute.yaml index d708b44..b9c1d8f 100644 --- a/helm/softplayer-backend/templates/ingressroute.yaml +++ b/helm/softplayer-backend/templates/ingressroute.yaml @@ -3,13 +3,13 @@ kind: IngressRoute metadata: name: grpc-route annotations: - external-dns.alpha.kubernetes.io/target: 195.201.249.91 - kubernetes.io/ingress.class: traefik + external-dns.alpha.kubernetes.io/target: {{ .Values.ingressRoute.target }} + kubernetes.io/ingress.class: {{ .Values.ingressRoute.class }} spec: entryPoints: - websecure routes: - - match: Host(`softplayer-backend.badhouseplants.net`) + - match: Host(`{{ .Values.ingressRoute.url }}`) kind: Rule middlewares: - name: {{ include "softplayer-backend.fullname" . | replace "-" "" }} @@ -18,4 +18,4 @@ spec: port: 4020 scheme: h2c tls: - secretName: softplayer-backend.badhouseplants.net + secretName: {{ .Values.ingressRoute.url }} diff --git a/helm/softplayer-backend/values.yaml b/helm/softplayer-backend/values.yaml index 8e4165e..3e3eec1 100644 --- a/helm/softplayer-backend/values.yaml +++ b/helm/softplayer-backend/values.yaml @@ -1,45 +1,21 @@ -# Default values for softplayer-backend. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -# This will set the replicaset count more information can be found here: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/ replicaCount: 1 - -# This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/ image: repository: gitea.badhouseplants.net/softplayer/softplayer-backend - # This sets the pull policy for images. pullPolicy: Always - # Overrides the image tag whose default is the chart appVersion. - tag: latest - -# This is for the secrets for pulling an image from a private repository more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + tag: imagePullSecrets: [] -# This is to override the chart name. nameOverride: "" fullnameOverride: "" - -# This section builds out the service account more information can be found here: https://kubernetes.io/docs/concepts/security/service-accounts/ serviceAccount: - # Specifies whether a service account should be created. create: true - # Automatically mount a ServiceAccount's API credentials? automount: true - # Annotations to add to the service account. annotations: {} - # The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template. name: "" -# This is for setting Kubernetes Annotations to a Pod. -# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ podAnnotations: {} -# This is for setting Kubernetes Labels to a Pod. -# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ podLabels: {} podSecurityContext: {} - # fsGroup: 2000 securityContext: {} # capabilities: @@ -49,72 +25,15 @@ securityContext: {} # runAsNonRoot: true # runAsUser: 1000 -# This is for setting up a service more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/ service: - # This sets the service type more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types type: ClusterIP - # This sets the ports more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports port: 4020 -# This block is for setting up the ingress for more information can be found here: https://kubernetes.io/docs/concepts/services-networking/ingress/ -ingress: - enabled: true - className: "traefik" - annotations: - kubernetes.io/ingress.class: traefik - kubernetes.io/tls-acme: "true" - kubernetes.io/ingress.allow-http: "false" - kubernetes.io/ingress.global-static-ip-name: "" - cert-manager.io/cluster-issuer: badhouseplants-issuer-http01 - traefik.ingress.kubernetes.io/router.entrypoints: web,websecure - external-dns.alpha.kubernetes.io/ingress-hostname-source: defined-hosts-only - hosts: - - host: softplayer-backend.badhouseplants.net - paths: - - path: / - pathType: ImplementationSpecific - tls: - - secretName: softplayer-backend.badhouseplants.net - hosts: - - softplayer-backend.badhouseplants.net - -# -- Expose the service via gateway-api HTTPRoute -# Requires Gateway API resources and suitable controller installed within the cluster -# (see: https://gateway-api.sigs.k8s.io/guides/) -httpRoute: - # HTTPRoute enabled. - enabled: false - # HTTPRoute annotations. - annotations: {} - # Which Gateways this Route is attached to. - parentRefs: - - name: gateway - sectionName: http - # namespace: default - # Hostnames matching HTTP header. - hostnames: - - chart-example.local - # List of rules and filters applied. - rules: - - matches: - - path: - type: PathPrefix - value: /headers - # filters: - # - type: RequestHeaderModifier - # requestHeaderModifier: - # set: - # - name: My-Overwrite-Header - # value: this-is-the-only-value - # remove: - # - User-Agent - # - matches: - # - path: - # type: PathPrefix - # value: /echo - # headers: - # - name: version - # value: v2 +ingressRoute: + target: 195.201.249.91 + class: traefik + url: softplayer-dummy.badhouseplants.net + clusterIssuer: badhouseplants-issuer-http01 resources: {} # We usually recommend not to specify default resources and to leave this as a conscious