github.com/pluralsh/plural-cli@v0.9.5/pkg/test/lua/values.yaml.lua (about)

     1  output = {
     2      global={
     3          application={
     4              links={
     5                  {	description= "console web ui",
     6                       url=Var.Values.console_dns
     7                  }
     8              }
     9          }
    10      },
    11  
    12      enabled=true,
    13      replicaCount=2,
    14      provider=Var.Provider,
    15      license=Var.License,
    16      ingress={
    17              annotations={
    18                  ['kubernetes.io/tls-acme']='true',
    19              },
    20              console_dns=Var.Values.console_dns,
    21              ingressClass="nginx",
    22      },
    23      serviceAccount= {
    24              create=true,
    25              annotations={
    26                  ['eks.amazonaws.com/role-arn']="arn:aws:iam::" .. Var.Project .. ":role/" ..Var.Cluster .. "-console"
    27              },
    28  
    29      },
    30      secrets={
    31              jwt=dedupe(Var, "console.secrets.jwt", randAlphaNum(20)),
    32              admin_name=Var.Values.admin_name,
    33              admin_email=dedupe(Var, "console.secrets.admin_email", default("someone@example.com", Var.Config.Email)),
    34              admin_password=dedupe(Var, "console.secrets.admin_password", randAlphaNum(20)),
    35              cluster_name=Var.Cluster,
    36              erlang=dedupe(Var, "console.secrets.erlang", randAlphaNum(14)),
    37              id_rsa=ternary(Var.Values.private_key, dedupe(Var, "console.secrets.id_rsa", ""), hasKey (Var.Values, "private_key")),
    38              id_rsa_pub=ternary(Var.Values.public_key, dedupe(Var, "console.secrets.id_rsa_pub", ""), hasKey(Var.Values, "public_key")),
    39              ssh_passphrase=ternary(Var.Values.passphrase, dedupe(Var, "console.secrets.ssh_passphrase", ""), hasKey(Var.Values, "passphrase")),
    40              git_access_token=ternary(Var.Values.access_token, dedupe(Var, "console.secrets.git_access_token", ""), hasKey(Var.Values, "access_token")),
    41              git_user=default("console", Var.Values.git_user),
    42              git_email=default("console@plural.sh", Var.Values.git_email),
    43              git_url="",
    44              repo_root="",
    45              branch_name="",
    46              config="",
    47              key="",
    48      }
    49  }
    50  
    51  if Var.Provider == "kind" then
    52      output.ingress.annotations = {
    53          ['external-dns.alpha.kubernetes.io/target']='127.0.0.1'
    54      }
    55      output.replicaCount=1
    56  end
    57  
    58  if Var.Provider == "google" then
    59      output.serviceAccount.create = false
    60  end
    61  
    62  if Var.Provider == "azure" then
    63      output.podLabels={
    64          ["aadpodidbinding"]="console"
    65      }
    66      output.consoleIdentityId=importValue("Terraform", "console_msi_id")
    67      output.consoleIdentityClientId=importValue("Terraform", "console_msi_client_id")
    68  
    69      output.extraEnv={
    70          {
    71              name="ARM_USE_MSI",
    72              value = true
    73  
    74          },
    75          {
    76              name="ARM_SUBSCRIPTION_ID",
    77              value=Var.Context.SubscriptionId
    78          },
    79          {
    80              name="ARM_TENANT_ID",
    81              value= Var.Context.TenantId
    82          }
    83      }
    84  
    85  end
    86  
    87  if Var.OIDC ~= nil then
    88      output.secrets.plural_client_id=Var.OIDC.ClientId
    89      output.secrets.plural_client_secret=Var.OIDC.ClientSecret
    90  end
    91  
    92  if Var.Values.is_demo then
    93      output.secrets.is_demo=Var.Values.is_demo
    94  end
    95  
    96  if Var.Values.console_dns then
    97      local gitUrl=dig("console", "secrets", "git_url", "default", Var)
    98      local identity=pathJoin(repoRoot(), ".plural-crypt", "identity")
    99      if gitUrl == "default" or gitUrl == "" then
   100          output.secrets.git_url=repoUrl()
   101      else
   102          output.secrets.git_url=gitUrl
   103      end
   104  
   105      output.secrets.branch_name=branchName()
   106      output.secrets.config=readFile(pathJoin(homeDir(),".plural","config.yml"))
   107  
   108      if fileExists(identity) then
   109          output.secrets.identity=readFile(identity)
   110      elseif dig("console", "secrets", "identity", "default", Var) ~= "default" then
   111          output.secrets.identity= Var.console.secrets.identity
   112      end
   113      output.secrets.key=dedupe(Var, "console.secrets.key", readFile(pathJoin(homeDir(), ".plural", "key")))..'\n'
   114  end