Commit 631ab898 authored by Amit Rathi's avatar Amit Rathi

Use email on the account

parent 9d91d79c
......@@ -81,9 +81,6 @@ export default {
ingressInstalled() {
return this.applications.ingress.status === APPLICATION_STATUS.INSTALLED;
},
certManagerInstalled() {
return this.applications.cert_manager.status === APPLICATION_STATUS.INSTALLED;
},
ingressExternalIp() {
return this.applications.ingress.externalIp;
},
......
......@@ -33,10 +33,17 @@ module Clusters
rbac: cluster.platform_kubernetes_rbac?,
chart: chart,
files: files.merge!(cluster_issuer_file),
postinstall: post_install_script
postinstall: post_install_script,
application_flags: install_command_flags
)
end
def install_command_flags
['--set', 'ingressShim.defaultIssuerName=letsencrypt-prod'] +
['--set', 'ingressShim.defaultIssuerKind=ClusterIssuer'] +
['--set', 'rbac.create=false']
end
private
def post_install_script
......@@ -45,10 +52,16 @@ module Clusters
def cluster_issuer_file
{
'cluster_issuer.yaml': File.read(cluster_issuer_file_path)
'cluster_issuer.yaml': cluster_issuer_yaml_content
}
end
def cluster_issuer_yaml_content
data = YAML.load_file(cluster_issuer_file_path)
data["spec"]["acme"]["email"] = self.email
YAML.dump(data)
end
def cluster_issuer_file_path
"#{Rails.root}/vendor/cert_manager/cluster_issuer.yaml"
end
......
......@@ -5,7 +5,7 @@ metadata:
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: hello@amirathi.com
email: my-email@example.com
privateKeySecretRef:
name: letsencrypt-prod
http01: {}
\ No newline at end of file
http01: {}
......@@ -4,9 +4,9 @@ module Gitlab
class InstallCommand
include BaseCommand
attr_reader :name, :files, :chart, :version, :repository, :preinstall, :postinstall
attr_reader :name, :files, :chart, :version, :repository, :preinstall, :postinstall, :application_flags
def initialize(name:, chart:, files:, rbac:, version: nil, repository: nil, preinstall: nil, postinstall: nil)
def initialize(name:, chart:, files:, rbac:, version: nil, repository: nil, preinstall: nil, postinstall: nil, application_flags: [])
@name = name
@chart = chart
@version = version
......@@ -15,6 +15,7 @@ module Gitlab
@repository = repository
@preinstall = preinstall
@postinstall = postinstall
@application_flags = application_flags
end
def generate_script
......@@ -64,16 +65,14 @@ module Gitlab
name_flag = ['--name', name]
namespace_flag = ['--namespace', Gitlab::Kubernetes::Helm::NAMESPACE]
value_flag = ['-f', "/data/helm/#{name}/config/values.yaml"]
a = ['--set', 'ingressShim.defaultIssuerName=letsencrypt-prod']
b = ['--set', 'ingressShim.defaultIssuerKind=ClusterIssuer']
c = ['--set', 'rbac.create=false']
name_flag +
optional_tls_flags +
optional_version_flag +
optional_rbac_create_flag +
namespace_flag +
value_flag + a + b + c
value_flag +
application_flags
end
def optional_rbac_create_flag
......
......@@ -19,6 +19,6 @@ singleuser:
command: ["sh", "-c", "git clone https://gitlab.com/gitlab-org/nurtch-demo.git DevOps-Runbook-Demo || true"]
ingress:
enabled: true
annotations:
kubernetes.io/ingress.class: "nginx"
enabled: true
annotations:
kubernetes.io/ingress.class: "nginx"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment