_form.html.haml 2.6 KB
Newer Older
1
= form_for @user_cluster, url: create_user_clusters_path, as: :cluster do |field|
2
  = form_errors(@user_cluster)
3
  = hidden_clusterable_fields
4
  .form-group
5
    = field.label :name, s_('ClusterIntegration|Kubernetes cluster name'), class: 'label-bold'
6
    = field.text_field :name, class: 'form-control', placeholder: s_('ClusterIntegration|Kubernetes cluster name')
7
  - if has_multiple_clusters?
8
    .form-group
9
      = field.label :environment_scope, s_('ClusterIntegration|Environment scope'), class: 'label-bold'
10
      = field.text_field :environment_scope, class: 'form-control', placeholder: s_('ClusterIntegration|Environment scope')
11

12
  = field.fields_for :platform_kubernetes, @user_cluster.platform_kubernetes do |platform_kubernetes_field|
13
    .form-group
14
      = platform_kubernetes_field.label :api_url, s_('ClusterIntegration|API URL'), class: 'label-bold'
15 16 17
      = platform_kubernetes_field.text_field :api_url, class: 'form-control', placeholder: s_('ClusterIntegration|API URL')

    .form-group
18
      = platform_kubernetes_field.label :ca_cert, s_('ClusterIntegration|CA Certificate'), class: 'label-bold'
19 20 21
      = platform_kubernetes_field.text_area :ca_cert, class: 'form-control', placeholder: s_('ClusterIntegration|Certificate Authority bundle (PEM format)')

    .form-group
22
      = platform_kubernetes_field.label :token, s_('ClusterIntegration|Token'), class: 'label-bold'
23 24 25
      = platform_kubernetes_field.text_field :token, class: 'form-control', placeholder: s_('ClusterIntegration|Service token'), autocomplete: 'off'

    .form-group
26
      = platform_kubernetes_field.label :namespace, s_('ClusterIntegration|Project namespace (optional, unique)'), class: 'label-bold'
27 28
      = platform_kubernetes_field.text_field :namespace, class: 'form-control', placeholder: s_('ClusterIntegration|Project namespace')

T
Thong Kuah 已提交
29 30
    .form-group
      .form-check
31
        = platform_kubernetes_field.check_box :authorization_type, { class: 'form-check-input qa-rbac-checkbox' }, 'rbac', 'abac'
T
Thong Kuah 已提交
32 33 34 35
        = platform_kubernetes_field.label :authorization_type, s_('ClusterIntegration|RBAC-enabled cluster (experimental)'), class: 'form-check-label label-bold'
        .form-text.text-muted
          = s_('ClusterIntegration|Enable this setting if using role-based access control (RBAC).')
          = s_('ClusterIntegration|This option will allow you to install applications on RBAC clusters.')
T
Thong Kuah 已提交
36
          = link_to _('More information'), help_page_path('user/project/clusters/index.md', anchor: 'role-based-access-control-rbac-core-only'), target: '_blank'
37

38
    .form-group
39
      = field.submit s_('ClusterIntegration|Add Kubernetes cluster'), class: 'btn btn-success'