Skip to content

Instantly share code, notes, and snippets.

@crumdev
Last active October 13, 2020 01:41
Show Gist options
  • Save crumdev/914a02345015c954cf826dd43210446a to your computer and use it in GitHub Desktop.
Save crumdev/914a02345015c954cf826dd43210446a to your computer and use it in GitHub Desktop.
Errors encountered when running a Calico Installation Script

Problems during Calico Install

Windows Specifications

  • Edition: Windows Server 2019 Standard
  • Version: 1809
  • OS Build: 17763.1457

Configuring the windows server

Here is the script I run so that Windows Server 2019 meets the requirements for the intsall

# Ensure TLS 1.2 is being used
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

# Download Calico installation scripts
Invoke-WebRequest "https://docs.projectcalico.org/scripts/install-calico-windows.ps1" `
    -OutFile "c:\install-calico-windows.ps1" 

# Enable Network Discovery for private & domain networks
Get-NetFirewallRule -DisplayGroup 'Network Discovery' | 
Set-NetFirewallRule -Profile 'Private, Domain' -Enabled true -PassThru | 
Select Name,DisplayName,Enabled,Profile|ft -a

# Enable file & printer sharing for private and domain networks
Get-NetFirewallRule -DisplayGroup 'File and Printer Sharing' | 
Set-NetFirewallRule -Profile 'Private, Domain' -Enabled true -PassThru | 
Select Name,DisplayName,Enabled,Profile|ft -a

# Set Network category to Private
Set-NetConnectionProfile -interfacealias ethernet -NetworkCategory Private

# Enable kubelet traffic on port 10250
New-NetFirewallRule -DisplayName "Kublet - Allow Ingress" `
    -Enabled true -Direction Inbound -Action Allow -Protocol UDP -LocalPort 10250
New-NetFirewallRule -DisplayName "Kublet - Allow Egress" `
    -Enabled true -Direction Outbound -Action Allow -Protocol UDP -LocalPort 10250

# Install Docker for Windows Server
Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
Install-Package -Name Docker -ProviderName DockerMsftProvider -Force
Restart-Computer -Force

Error while using the Calico Script

Below is the command and full output that came from running the script. Parts that encountered errors I added a ################### above and below the error to make it more readable.

Command ran:

& "c:\install-calico-windows.ps1" -DownloadOnly yes -KubeVersion 1.18.9

Output:

    Directory: C:\


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----       10/13/2020  12:49 AM                k
WARNING: The names of some imported commands from the module 'helper' include unapproved
verbs that might make them less discoverable. To find the commands with unapproved verbs,
run the Import-Module command again with the Verbose parameter. For a list of approved
verbs, type Get-Verb.

###################
Invoke-RestMethod : Unable to connect to the remote server
At C:\install-calico-windows.ps1:96 char:20
+ ... sNodeName = Invoke-RestMethod -uri http://169.254.169.254/latest/meta ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest)
    [Invoke-RestMethod], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.
   InvokeRestMethodCommand
###################

Downloading CNI binaries


    Directory: C:\k\cni


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----       10/13/2020  12:49 AM                config
Downloaded [https://github.com/Microsoft/SDN/raw/master/Kubernetes/flannel/l2bridge/cni/host
-local.exe] => [c:\k\cni\host-local.exe]
Downloading Windows Kubernetes scripts
Downloaded [https://github.com/Microsoft/SDN/raw/master/Kubernetes/windows/hns.psm1] => [c:\
k\hns.psm1]
Downloaded [https://github.com/Microsoft/SDN/raw/master/Kubernetes/windows/InstallImages.ps1
] => [c:\k\InstallImages.ps1]
Downloaded [https://github.com/Microsoft/SDN/raw/master/Kubernetes/windows/Dockerfile] => [c
:\k\Dockerfile]
Update dockerfile for 1809
WARNING: The names of some imported commands from the module 'hns' include unapproved verbs
 that might make them less discoverable. To find the commands with unapproved verbs, run
the Import-Module command again with the Verbose parameter. For a list of approved verbs,
type Get-Verb.

###################
No infrastructure container image found. Building kubeletwin/pause image
"docker tag" requires exactly 2 arguments.
See 'docker tag --help'.

Usage:  docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]
Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
###################

###################
"docker tag" requires exactly 2 arguments.
See 'docker tag --help'.

Usage:  docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]
Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
###################

Sending build context to Docker daemon  3.244MB
Step 1/2 : FROM mcr.microsoft.com/windows/nanoserver:1809
1809: Pulling from windows/nanoserver
ecf9bb62dc6e: Pull complete
Digest: sha256:e55f24fbbb1b1cd831977136169971bfacb34a6490a60c68f2eddf82659c099f
Status: Downloaded newer image for mcr.microsoft.com/windows/nanoserver:1809
 ---> 9e0259a60cc3
Step 2/2 : CMD cmd /c ping -t localhost
 ---> Running in cd6d58bbb433
Removing intermediate container cd6d58bbb433
 ---> ce88d0851063
Successfully built ce88d0851063
Successfully tagged kubeletwin/pause:latest
Downloaded [https://dl.k8s.io/v1.18.9/kubernetes-node-windows-amd64.tar.gz] => [C:\Users\vag
rant\AppData\Local\Temp\tmp8B07.tar.gz]
Download Calico for Windows release...
Downloaded [https://github.com/projectcalico/calico/releases/download/v3.16.3//calico-window
s-v3.16.3.zip] => [c:\calico-windows.zip]
Unzip Calico for Windows release...
Setup Calico for Windows...

###################
error: CreateFile c:\\k\\config: The system cannot find the file specified.
calico-node service account does not exist.
At C:\install-calico-windows.ps1:118 char:9
+         throw "$SecretName service account does not exist."
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (calico-node ser...does not exist.:String)
    [], RuntimeException
    + FullyQualifiedErrorId : calico-node service account does not exist.
###################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment