- OS: Ubuntu 20.04.2 LTS (GNU/Linux 5.8.0-59-generic x86_64)
- Network: 192.168.xxx.0/24
- Ubuntu multipass host machine IP: 192.168.xxx.yyy(static IP)
- NIC: enp2s0(bridge host NIC)
- Bridge NIC:br0
For RKE v0.1.x and Rancher v2.0.x/v2.1.x, see https://gist.github.com/superseb/3d8de6092ebc4b1581185197583f472a
This needs to be run on a node with the controlplane role, as it rewrites the server endpoint to https://127.0.0.1:6443, you can of course manually change this if necessary.
Applicable for:
- RKE v0.2.x
- Rancher v2.2.x
The easiest way to create and update a docker-registry secret in Rancher 2.x for an AWS ECR repo is to set up a CRON job that uses the AWS CLI and Kubectl.
- Log into the host machine where the cluster is running
- Install AWS CLI and configure it to use an IAM role that can read the ECR credentials.
- Test the CLI config using this command: aws ecr --region <your_ecr's_region> get-login-password
- Install kubectl and configure it with the yaml for the cluster in which you want to define the secret
- Create a shell script like this:
# Delete the secret if it already exists (there is no way to update it)
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | --- | |
| apiVersion: networking.istio.io/v1alpha3 | |
| kind: Gateway | |
| metadata: | |
| name: prometheus-server-0 | |
| namespace: monitoring | |
| spec: | |
| selector: | |
| istio: ingressgateway | |
| servers: | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # use the latest ubuntu environment (18.04) available on travis | |
| dist: xenial | |
| language: go | |
| # Force-enable Go modules. Also force go to use the code in vendor/ | |
| # These will both be unnecessary when Go 1.13 lands. | |
| env: | |
| - GO111MODULE=on | |
| - GOFLAGS='-mod vendor' | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | package main | |
| import ( | |
| "database/sql" | |
| "testing" | |
| "time" | |
| _ "github.com/lib/pq" | |
| ) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | package main | |
| import ( | |
| "net/http" | |
| "database/sql" | |
| "fmt" | |
| "log" | |
| "os" | |
| ) |