Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
27ce6140
Commit
27ce6140
authored
Nov 13, 2018
by
Amit Rathi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cert manager migration, cluster_issuer etc.
parent
0e8e7558
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
120 additions
and
0 deletions
+120
-0
app/assets/images/cluster_app_logos/cert_manager.png
app/assets/images/cluster_app_logos/cert_manager.png
+0
-0
app/models/clusters/applications/cert_manager.rb
app/models/clusters/applications/cert_manager.rb
+76
-0
config/cert_manager/cluster_issuer.yaml
config/cert_manager/cluster_issuer.yaml
+11
-0
db/migrate/20181101191341_create_clusters_applications_cert_manager.rb
...181101191341_create_clusters_applications_cert_manager.rb
+22
-0
vendor/cert_manager/cluster_issuer.yaml
vendor/cert_manager/cluster_issuer.yaml
+11
-0
vendor/cert_manager/values.yaml
vendor/cert_manager/values.yaml
+0
-0
No files found.
app/assets/images/cluster_app_logos/cert_manager.png
0 → 100644
View file @
27ce6140
1.23 KB
app/models/clusters/applications/cert_manager.rb
0 → 100644
View file @
27ce6140
# frozen_string_literal: true
module
Clusters
module
Applications
class
CertManager
<
ActiveRecord
::
Base
VERSION
=
'v0.5.0'
.
freeze
self
.
table_name
=
'clusters_applications_cert_managers'
include
::
Clusters
::
Concerns
::
ApplicationCore
include
::
Clusters
::
Concerns
::
ApplicationStatus
include
::
Clusters
::
Concerns
::
ApplicationVersion
include
::
Clusters
::
Concerns
::
ApplicationData
default_value_for
:version
,
VERSION
def
ready_status
[
:installed
]
end
def
ready?
ready_status
.
include?
(
status_name
)
end
def
chart
'stable/cert-manager'
end
def
install_command
Gitlab
::
AppLogger
.
info
'----- INSTALLING CLUSTER ISSUER-v2 ----'
begin
Gitlab
::
Kubernetes
::
Helm
::
InstallCommand
.
new
(
name:
'certmanager'
,
version:
VERSION
,
rbac:
cluster
.
platform_kubernetes_rbac?
,
chart:
chart
,
files:
files
.
merge!
(
cluster_issuer_file
),
postinstall:
post_install_script
)
#res = YAML.load_file(Rails.root.join('config', 'cert_manager', 'cluster_issuer.yaml'))
#Gitlab::AppLogger.info(res)
#Gitlab::Kubernetes::ClusterIssuer(res).generate()
rescue
StandardError
=>
e
Gitlab
::
AppLogger
.
info
(
'install_command_eror------------------------------------------------'
)
Gitlab
::
AppLogger
.
error
(
e
)
Gitlab
::
AppLogger
.
error
(
e
.
backtrace
.
join
(
"
\n
"
))
rescue
Exception
=>
e
Gitlab
::
AppLogger
.
info
(
'install_command_exception--------------------------------------------------'
)
Gitlab
::
AppLogger
.
error
(
e
)
Gitlab
::
AppLogger
.
error
(
e
.
backtrace
.
join
(
"
\n
"
))
end
end
def
cluster_issuer_resource_definition
YAML
.
load_file
(
Rails
.
root
.
join
(
'config'
,
'cert_manager'
,
'cluster_issuer.yaml'
))
end
private
def
post_install_script
[
"/usr/bin/kubectl create -f /data/helm/certmanager/config/cluster_issuer.yaml"
]
end
def
cluster_issuer_file
{
'cluster_issuer.yaml'
:
File
.
read
(
cluster_issuer_file_path
)
}
end
def
cluster_issuer_file_path
"
#{
Rails
.
root
}
/vendor/cert_manager/cluster_issuer.yaml"
end
end
end
end
\ No newline at end of file
config/cert_manager/cluster_issuer.yaml
0 → 100644
View file @
27ce6140
apiVersion
:
certmanager.k8s.io/v1alpha1
kind
:
ClusterIssuer
metadata
:
name
:
letsencrypt-prod
spec
:
acme
:
server
:
https://acme-v02.api.letsencrypt.org/directory
email
:
hello@amirathi.com
privateKeySecretRef
:
name
:
letsencrypt-prod
http01
:
{}
\ No newline at end of file
db/migrate/20181101191341_create_clusters_applications_cert_manager.rb
0 → 100644
View file @
27ce6140
# frozen_string_literal: true
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class
CreateClustersApplicationsCertManager
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME
=
false
def
change
create_table
:clusters_applications_cert_managers
do
|
t
|
t
.
references
:cluster
,
null:
false
,
unique:
true
,
foreign_key:
{
on_delete: :cascade
}
t
.
integer
:status
,
null:
false
t
.
string
:version
,
null:
false
t
.
string
:email
,
null
:false
t
.
timestamps_with_timezone
null:
false
t
.
text
:status_reason
end
end
end
vendor/cert_manager/cluster_issuer.yaml
0 → 100644
View file @
27ce6140
apiVersion
:
certmanager.k8s.io/v1alpha1
kind
:
ClusterIssuer
metadata
:
name
:
letsencrypt-prod
spec
:
acme
:
server
:
https://acme-v02.api.letsencrypt.org/directory
email
:
my-email@example.com
privateKeySecretRef
:
name
:
letsencrypt-prod
http01
:
{}
\ No newline at end of file
vendor/cert_manager/values.yaml
0 → 100644
View file @
27ce6140
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment