Skip to content

Commit

Permalink
Use LoadBalancer type on gitea service (if configured) to allow exter…
Browse files Browse the repository at this point in the history
…nal SSH (if supported by cloud provider)
  • Loading branch information
andykrohg authored and jharmison-redhat committed Feb 17, 2021
1 parent fd9d65e commit cc7d089
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions config/crd/bases/redhatgov.io_giteas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ spec:
description: Defines SSL/TLS state, if your IngressController/Router supports it
type: boolean
default: True
externalIp:
description: |
Defines whether the gitea service should request an external IP address.
Required for external SSH.
type: boolean
default: False
image:
description: Defines the ways in which the Gitea image should be sourced and managed
type: object
Expand Down
1 change: 1 addition & 0 deletions playbooks/gitea-operator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
_gitea_expose_method: "{{ gitea.expose.kind | default('Route') }}"
_gitea_expose_uri: "{{ gitea.expose.uri | default('') }}"
_gitea_ssl: "{{ gitea.expose.ssl | default(True) }}"
_gitea_external_ip: "{{ gitea.expose.external_ip | default(False) }}"

_gitea_image: "{{ gitea.image.src | default('quay.io/redhatgov/gitea') }}"
_gitea_image_tag: "{{ gitea.image.tag | default('latest') }}"
Expand Down
4 changes: 3 additions & 1 deletion roles/gitea-ocp/templates/service.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ spec:
protocol: TCP
targetPort: 2022
sessionAffinity: None
type: ClusterIP
{% if _gitea_external_ssh|bool %}
type: LoadBalancer
{% endif %}

0 comments on commit cc7d089

Please sign in to comment.