Question

what is it with the --kubeconfig parameter

  • 17 February 2022
  • 1 reply
  • 1263 views

Userlevel 2
Badge +5
  • Do Gooder (Employee)
  • 12 replies

I have this folder structure:

ifsroot1

fsroot2

ifsroot3

for different installations. I do not fancy that part from the help file:

Place the config file to its default location

The default path for the kubeconfig file is c:\user\<YourUser>\.kube\config. Copy the file ifsroot\config\kube\config to c:\user\<YourUser>\.kube folder

 

since I need to do it every single time I decide to use ifsroot1, 2 or 3.

This part seems cleaner in my view as you don’t risk to have unintended config file:

Powershell

ps> $env:KUBECONFIG = "ifsroot\config\kube\config"  

Cmd

cmd> set KUBECONFIG=ifsroot\config\kube\config

 

But what about --kubeconfig directive?. It is simply not accepted by the installer despite of this info:

https://docs.ifs.com/techdocs/21r2/020_installation/200_installing_ifs_cloud/035_ifs_cloud_ifsinstaller/040_installer_directives/

So I run it like this:

PS C:\Temp\Cloud\ifsroot0\deliveries\build-home\ifsinstaller> .\installer.ps1 --values ..\..\..\config\ifscloud-values.yaml --values solutionset.yaml --set dbInstaller.sysPassword=xxxxx --kubeconfig ..\..\..\config\kube\config

 

[Thu Feb 17 12:31:49 GMT 2022] - INFO: Checking if helm is installed..
[Thu Feb 17 12:31:49 GMT 2022] - SEVERE: Helm not installed
[Thu Feb 17 12:31:49 GMT 2022] - SEVERE: 'helm' is not recognized as an internal or external command,
operable program or batch file.

[Thu Feb 17 12:31:49 GMT 2022] - INFO: Checking if kubectl is installed..
[Thu Feb 17 12:31:49 GMT 2022] - INFO: kubectl installed..
[Thu Feb 17 12:31:49 GMT 2022] - INFO: chartVersion not found in properties, using buildHomeVersion: 211.3.0
[Thu Feb 17 12:31:49 GMT 2022] - INFO: Using existing certificate
[Thu Feb 17 12:31:50 GMT 2022] - INFO: Generating symmetric-key. This will only be persisted if the secret, 'symmetric-key' does not exist.
[Thu Feb 17 12:31:50 GMT 2022] - INFO: Creating namespace
[Thu Feb 17 12:31:50 GMT 2022] - SEVERE: flags cannot be placed before plugin name: --kubeconfig ..\..\..\config\kube\config
[Thu Feb 17 12:31:50 GMT 2022] - SEVERE: flags cannot be placed before plugin name: --kubeconfig ..\..\..\config\kube\config
[Thu Feb 17 12:31:50 GMT 2022] - SEVERE: flags cannot be placed before plugin name: --kubeconfig ..\..\..\config\kube\config
[Thu Feb 17 12:31:50 GMT 2022] - SEVERE: flags cannot be placed before plugin name: --kubeconfig ..\..\..\config\kube\config
[Thu Feb 17 12:31:50 GMT 2022] - SEVERE: Failed to create namespace
[Thu Feb 17 12:31:50 GMT 2022] - SEVERE: Failed to install ifs-cloud. Collected logs from command:
DEBUG:    1+ if ($env:verbose) { Set-PSDebug -Trace 2; >>>> $DebugPreference = "Continue"}
DEBUG:     ! SET $DebugPreference = 'Continue'.
DEBUG:    2+  >>>> $arg=$args[0]
DEBUG:     ! SET $arg = 'dryrun'.
DEBUG:    4+ if ( >>>> "$env:namespace" -eq "") {
DEBUG:    9+ if ( >>>> "$arg" -eq "delete")  {
DEBUG:   17+  >>>> kubectl $env:kubeconfigFlag get namespace $env:namespace -o name *> $null
DEBUG:   18+ if ( >>>> !$?) {
DEBUG:   19+    >>>> write-host INFO: Creating namespace
INFO: Creating namespace
DEBUG:   20+    >>>> kubectl $env:kubeconfigFlag create namespace $env:namespace
Error: flags cannot be placed before plugin name: --kubeconfig ..\..\..\config\kube\config
DEBUG:   21+    >>>> kubectl $env:kubeconfigFlag label namespace $env:namespace app.kubernetes.io/managed-by=Helm
Error: flags cannot be placed before plugin name: --kubeconfig ..\..\..\config\kube\config
DEBUG:   22+    >>>> kubectl $env:kubeconfigFlag annotate namespace $env:namespace meta.helm.sh/release-name=ifs-cloud
Error: flags cannot be placed before plugin name: --kubeconfig ..\..\..\config\kube\config
DEBUG:   23+    >>>> kubectl $env:kubeconfigFlag annotate namespace $env:namespace
meta.helm.sh/release-namespace=$env:namespace
Error: flags cannot be placed before plugin name: --kubeconfig ..\..\..\config\kube\config
DEBUG:   24+   if ( >>>> !$?) {write-host SEVERE: Failed to create namespace;exit 1}
DEBUG:   24+   if (!$?) { >>>> write-host SEVERE: Failed to create namespace;exit 1}
SEVERE: Failed to create namespace
DEBUG:   24+   if (!$?) {write-host SEVERE: Failed to create namespace; >>>> exit 1}

[Thu Feb 17 12:31:50 GMT 2022] - SEVERE: Validation failed.

 

BTW, this is still R1.


This topic has been closed for comments

1 reply

Userlevel 2
Badge +5

Just to show, that helm is instaled:

PS C:\Temp\Cloud\ifsroot0\deliveries\build-home\ifsinstaller> .\installer.ps1 --values ..\..\..\config\ifscloud-values.yaml --values solutionset.yaml --set dbInstaller.sysPassword=xxxx --kubeconfig ..\..\..\config\kube\config
[Thu Feb 17 13:33:15 GMT 2022] - INFO: Checking if helm is installed..
[Thu Feb 17 13:33:19 GMT 2022] - INFO: Helm installed
[Thu Feb 17 13:33:19 GMT 2022] - INFO: Checking if kubectl is installed..
[Thu Feb 17 13:33:19 GMT 2022] - INFO: kubectl installed..
[Thu Feb 17 13:33:19 GMT 2022] - INFO: ======================
[Thu Feb 17 13:33:19 GMT 2022] - INFO: ACTIVE KUBECTL CONFIG
[Thu Feb 17 13:33:19 GMT 2022] - INFO: apiVersion: v1
[Thu Feb 17 13:33:19 GMT 2022] - INFO: clusters:
[Thu Feb 17 13:33:19 GMT 2022] - INFO: - cluster:
[Thu Feb 17 13:33:19 GMT 2022] - INFO:     certificate-authority-data: DATA+OMITTED
[Thu Feb 17 13:33:19 GMT 2022] - INFO:     server: https://10.24.5.151:16443
[Thu Feb 17 13:33:19 GMT 2022] - INFO:   name: microk8s-cluster
[Thu Feb 17 13:33:19 GMT 2022] - INFO: contexts:
[Thu Feb 17 13:33:19 GMT 2022] - INFO: - context:
[Thu Feb 17 13:33:19 GMT 2022] - INFO:     cluster: microk8s-cluster
[Thu Feb 17 13:33:19 GMT 2022] - INFO:     user: admin
[Thu Feb 17 13:33:19 GMT 2022] - INFO:   name: microk8s
[Thu Feb 17 13:33:19 GMT 2022] - INFO: current-context: microk8s
[Thu Feb 17 13:33:19 GMT 2022] - INFO: kind: Config
[Thu Feb 17 13:33:19 GMT 2022] - INFO: preferences: {}
[Thu Feb 17 13:33:19 GMT 2022] - INFO: users:
[Thu Feb 17 13:33:19 GMT 2022] - INFO: - name: admin
[Thu Feb 17 13:33:19 GMT 2022] - INFO:   user:
[Thu Feb 17 13:33:19 GMT 2022] - INFO:     password: c0g1TzBRcG1zemJzSHA4ejd2N3k4OXhxcXFzU3RmMUp4cVZDN3BiSko0QT0K
[Thu Feb 17 13:33:19 GMT 2022] - INFO:     username: admin
[Thu Feb 17 13:33:19 GMT 2022] - INFO: ======================
[Thu Feb 17 13:33:19 GMT 2022] - INFO: chartVersion not found in properties, using buildHomeVersion: 211.3.0
[Thu Feb 17 13:33:19 GMT 2022] - INFO: Using existing certificate
[Thu Feb 17 13:33:20 GMT 2022] - INFO: Generating symmetric-key. This will only be persisted if the secret, 'symmetric-key' does not exist.
[Thu Feb 17 13:33:20 GMT 2022] - INFO: Creating namespace
[Thu Feb 17 13:33:20 GMT 2022] - SEVERE: flags cannot be placed before plugin name: --kubeconfig ..\..\..\config\kube\config
[Thu Feb 17 13:33:20 GMT 2022] - SEVERE: flags cannot be placed before plugin name: --kubeconfig ..\..\..\config\kube\config
[Thu Feb 17 13:33:21 GMT 2022] - SEVERE: flags cannot be placed before plugin name: --kubeconfig ..\..\..\config\kube\config
[Thu Feb 17 13:33:21 GMT 2022] - SEVERE: flags cannot be placed before plugin name: --kubeconfig ..\..\..\config\kube\config
[Thu Feb 17 13:33:21 GMT 2022] - SEVERE: Failed to create namespace
[Thu Feb 17 13:33:21 GMT 2022] - SEVERE: Failed to install ifs-cloud. Collected logs from command:
DEBUG:    1+ if ($env:verbose) { Set-PSDebug -Trace 2; >>>> $DebugPreference = "Continue"}
DEBUG:     ! SET $DebugPreference = 'Continue'.
DEBUG:    2+  >>>> $arg=$args[0]
DEBUG:     ! SET $arg = 'dryrun'.
DEBUG:    4+ if ( >>>> "$env:namespace" -eq "") {
DEBUG:    9+ if ( >>>> "$arg" -eq "delete")  {
DEBUG:   17+  >>>> kubectl $env:kubeconfigFlag get namespace $env:namespace -o name *> $null
DEBUG:   18+ if ( >>>> !$?) {
DEBUG:   19+    >>>> write-host INFO: Creating namespace
INFO: Creating namespace
DEBUG:   20+    >>>> kubectl $env:kubeconfigFlag create namespace $env:namespace
Error: flags cannot be placed before plugin name: --kubeconfig ..\..\..\config\kube\config
DEBUG:   21+    >>>> kubectl $env:kubeconfigFlag label namespace $env:namespace app.kubernetes.io/managed-by=Helm
Error: flags cannot be placed before plugin name: --kubeconfig ..\..\..\config\kube\config
DEBUG:   22+    >>>> kubectl $env:kubeconfigFlag annotate namespace $env:namespace meta.helm.sh/release-name=ifs-cloud
Error: flags cannot be placed before plugin name: --kubeconfig ..\..\..\config\kube\config
DEBUG:   23+    >>>> kubectl $env:kubeconfigFlag annotate namespace $env:namespace
meta.helm.sh/release-namespace=$env:namespace
Error: flags cannot be placed before plugin name: --kubeconfig ..\..\..\config\kube\config
DEBUG:   24+   if ( >>>> !$?) {write-host SEVERE: Failed to create namespace;exit 1}
DEBUG:   24+   if (!$?) { >>>> write-host SEVERE: Failed to create namespace;exit 1}
SEVERE: Failed to create namespace
DEBUG:   24+   if (!$?) {write-host SEVERE: Failed to create namespace; >>>> exit 1}

[Thu Feb 17 13:33:21 GMT 2022] - SEVERE: Validation failed.
PS C:\Temp\Cloud\ifsroot0\deliveries\build-home\ifsinstaller>