Class: Kuby::CertManager::Plugin

Inherits:
Plugin
  • Object
show all
Defined in:
lib/kuby/cert-manager/plugin.rb

Defined Under Namespace

Classes: Config

Constant Summary collapse

NAMESPACE =
'cert-manager'.freeze
CERT_MANAGER_VERSION =
'1.7.2'.freeze
CERT_MANAGER_RESOURCES =
[
  "https://github.com/jetstack/cert-manager/releases/download/v#{CERT_MANAGER_VERSION}/cert-manager.yaml".freeze
]
DEFAULT_SERVER_URL =
'https://acme-v02.api.letsencrypt.org/directory'.freeze

Instance Method Summary collapse

Instance Method Details

#annotate_ingress(ingress) ⇒ Object



36
37
38
39
40
41
42
43
44
# File 'lib/kuby/cert-manager/plugin.rb', line 36

def annotate_ingress(ingress)
  context = self

  ingress. do
    annotations do
      add :'cert-manager.io/cluster-issuer', context.send(:issuer_name)
    end
  end
end

#configure(&block) ⇒ Object



24
25
26
# File 'lib/kuby/cert-manager/plugin.rb', line 24

def configure(&block)
  @config.instance_eval(&block) if block
end

#resourcesObject



32
33
34
# File 'lib/kuby/cert-manager/plugin.rb', line 32

def resources
  @resources ||= [cluster_issuer]
end

#setupObject



28
29
30
# File 'lib/kuby/cert-manager/plugin.rb', line 28

def setup
  install_cert_manager
end