You'll need a PAT with package write
permissions
Then:
# Add the following step to kick some helpful debugging about what's in your google cloud build container! | |
- id: "Read Values" | |
name: ubuntu | |
dir: '/workspace' | |
entrypoint: bash | |
args: | |
- -c | |
- | | |
# Read from "/workspace" | |
echo "Where am I " $(pwd) |
// | |
// Looks up a host using the resolver and returns an IP. | |
// Utility function for testing against K8s over VPN. | |
// Resolver should be the POD ip of kube-dns | |
// | |
func hostToIP(host string, resolver string) string { | |
fmt.Printf("Looking up %s using resolver %s\n", host, resolver) | |
r := &net.Resolver{ | |
PreferGo: true, | |
Dial: func(ctx context.Context, network, address string) (net.Conn, error) { |
curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - | |
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list | |
sudo apt update | |
sudo apt install elasticsearch |
import requests | |
import time | |
def contact_monitor(): | |
print("Calling the monitor...") | |
r= requests.get("https://heartbeat.uptimerobot.com/m11111111-11111111111111111111111111") | |
while 1==1: | |
time.sleep(30) | |
try: |
import ( | |
appsv1 "k8s.io/api/apps/v1" | |
) | |
// StatefulSetGetAll returns all STS for the managed cluster | |
func (mgr *manager) StatefulSetGetAll() *appsv1.StatefulSetList { | |
stslister, err := mgr.k8sclient.AppsV1().StatefulSets("").List(context.TODO(), metav1.ListOptions{}) | |
if err != nil { | |
fmt.Println("error getting StatefulSetGetAll: ", err) | |
} |
package main | |
import( | |
"log" | |
"net/url" | |
"net/http" | |
"net/http/httputil" | |
) | |
func main() { |
server { | |
listen 443 ssl; | |
server_name ~^kibanasub\.; | |
root /www/cluster; | |
ssl_certificate /etc/nginx/certificates/cert1.pem; | |
ssl_certificate_key /etc/nginx/certificates/privkey1.pem; | |
ssl_protocols TLSv1.2 TLSv1.3; | |
When using the GraphQL machinebox go library, you can tak control of logging as follows:
graphqlclient.Log = func(s string) { log.Printf("YO: %s",s) }
Issue: When pulling from github inside docker, it won't update the cached docker image.
You can force it to by using the git api to pull down the latest commit meta data and saving that to the image. This works and stays in synch with every new update to your repo, which you want to pull. No commits mean no new meta data so your docker will use the cached version. If you commits, this makes a new SHA which gets pulled in the API, invalidating cached
ADD https://$GIT_PAT@api.github.com/repos/some_org/some_repo/git/refs/heads cachebust
RUN git clone https://$GIT_PAT_IN@github.com/some_org/some-repo-git.git