Skip to content

Commit

Permalink
Merge pull request #1531 from grycap/new_k8s
Browse files Browse the repository at this point in the history
Add cert-manager annotation
  • Loading branch information
micafer authored Feb 22, 2024
2 parents a02ad8c + 9ff2059 commit 42e1d62
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions IM/connectors/Kubernetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,13 @@ def _generate_ingress_data(self, namespace, name, dns, port):
if dns_url[2]:
path = dns_url[2]

# Add Let's Encrypt annotation asuming that the cluster has
# cert-manager installed and the issuer is letsencrypt-prod
if secure:
ingress_data["metadata"]["annotations"] = {
"cert-manager.io/cluster-issuer": "letsencrypt-prod"
}

ingress_data["spec"] = {
"rules": [
{
Expand Down
1 change: 1 addition & 0 deletions test/unit/connectors/Kubernetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ def test_20_launch(self, save_data, requests):
"labels": {"name": "test"},
"name": "test",
"namespace": "somenamespace",
"annotations": {"cert-manager.io/cluster-issuer": "letsencrypt-prod"},
},
"spec": {
"tls": [
Expand Down

0 comments on commit 42e1d62

Please sign in to comment.