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
## Execute this commands over your working tree. | |
docker pull google/cloud-sdk:latest | |
docker run -ti google/cloud-sdk:latest gcloud version | |
docker run -ti --name gcloud-config google/cloud-sdk gcloud auth login | |
docker run --rm -ti --volumes-from gcloud-config google/cloud-sdk gcloud config set project <your_project_id_here> | |
docker run --rm -ti -v $(pwd):/src -v /var/run/docker.sock:/var/run/docker.sock:ro --volumes-from gcloud-config google/cloud-sdk bash | |
## Optional, set up your kubernetes credentials. | |
gcloud container clusters get-credentials <your_kubernetes_cluster> --zone <gcloud_cluster_zone> --project <your_project_id_here> |
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
#!/bin/bash | |
# You must be logged in both registries before. | |
SOURCE_REGISTRY_IMAGES=( | |
your.source.registry/namespace1/subnamespace1/image1:tag | |
your.source.registry/namespace1/subnamespace1/image2:tag | |
) | |
DESTINATION_REGISTRY_NAMESPACE="your.destination.registry/namespace/subnamespace" |
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
#!/usr/bin/env bash | |
package=$1 | |
output_dir=$2 | |
targets=$3 | |
if [[ -z "$package" || -z "$output_dir" || -z "$targets" ]]; then | |
echo "usage: $0 <package-name> <output_dir> <platform/arch/version|another_platform/arch/version>" | |
echo "example: ./go_multi_arch_build.sh github.com/someone/nice-package /absolute/binary/output/path 'windows/amd64|linux/amd64|linux/arm/5'" | |
exit 1 |
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
docker pull google/cloud-sdk:latest | |
docker run -ti google/cloud-sdk:latest gcloud version | |
docker run -ti --name gcloud-config google/cloud-sdk gcloud auth login | |
docker run --rm -ti --volumes-from gcloud-config google/cloud-sdk gcloud config set project <your-project-id> | |
docker run --rm -ti -v $(pwd):/src -v /var/run/docker.sock:/var/run/docker.sock:ro --volumes-from gcloud-config google/cloud-sdk bash | |
## kubernetes | |
gcloud container clusters get-credentials <your_cluster> --zone <your_zone> --project <your-project-id> |
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
openssl req -new -x509 -days 720 -extensions v3_ca -keyout my-ca.key -out my-ca.crt | |
openssl genrsa -out server.key | |
openssl req -out server.csr -key server.key -new | |
openssl x509 -req -in server.csr -CA my-ca.crt -CAkey my-ca.key -CAcreateserial -out server.crt -days 720 |
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
#!/bin/bash | |
NAMESPACE=$1 | |
kubectl proxy & | |
kubectl get namespace $NAMESPACE -o json |jq '.spec = {"finalizers":[]}' >temp.json | |
curl -k -H "Content-Type: application/json" -X PUT --data-binary @temp.json 127.0.0.1:8001/api/v1/namespaces/$NAMESPACE/finalize | |
rm temp.json |
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
#!/bin/bash | |
cat << EOF > /etc/systemd/system/node_exporter.service | |
[Unit] | |
After=network.target | |
[Service] | |
ExecStart=/usr/local/bin/node_exporter |
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
log: | |
level: INFO | |
entryPoints: | |
web: | |
address: ":80" | |
web-secure: | |
address: ":443" | |
metrics: | |
address: ":9090" |
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
#!/bin/bash | |
curl -fsSL https://get.docker.com | bash | |
DOCKER_CONFIG_OVERRIDE_DIR=/etc/systemd/system/docker.service.d | |
mkdir -p $DOCKER_CONFIG_OVERRIDE_DIR | |
cat <<EOF > $DOCKER_CONFIG_OVERRIDE_DIR/override.conf | |
[Service] | |
ExecStart= | |
ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2376 |
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
#!/bin/bash | |
curl -fsSl https://gist.githubusercontent.com/eloylp/7bd966d2b9895770dd0d47c199009b7f/raw/ad13d9636068b267ded1148c74ef8c782a0d955e/node_exporter_setup.sh | bash \ | |
&& curl -fsSL https://gist.githubusercontent.com/eloylp/f05b4de931cc0a0cdd1e713b015639ba/raw/2651a96ae5d4a266d52fe2caa63c0546c17e37d1/install_and_expose_dockerd.sh | bash |
OlderNewer