Skip to content

Instantly share code, notes, and snippets.

🎧
Groovin'

Pat Migliaccio patmigliaccio

🎧
Groovin'
Block or report user

Report or block patmigliaccio

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@patmigliaccio
patmigliaccio / lessons-ml-gcp-18.sh
Created Oct 29, 2019
patmigliaccio.com/lessons-ml-gcp 10/29/19
View lessons-ml-gcp-18.sh
for node in $(kubectl get nodes -l cloud.google.com/gke-nodepool=default-pool -o=name); do
kubectl drain --force --ignore-daemonsets --delete-local-data --grace-period=10 "$node";
done
@patmigliaccio
patmigliaccio / lessons-ml-gcp-17.sh
Created Oct 29, 2019
patmigliaccio.com/lessons-ml-gcp 10/29/19
View lessons-ml-gcp-17.sh
for node in $(kubectl get nodes -l cloud.google.com/gke-nodepool=default-pool -o=name); do
kubectl cordon "$node";
done
@patmigliaccio
patmigliaccio / lessons-ml-gcp-16.sh
Created Oct 29, 2019
patmigliaccio.com/lessons-ml-gcp 10/29/19
View lessons-ml-gcp-16.sh
gcloud container node-pools create my-pool \
--cluster=my-cluster \
--machine-type=n1-highmem-2 \
--num-nodes 1 --enable-autoscaling
--min-nodes 1 --max-nodes 3
@patmigliaccio
patmigliaccio / lessons-ml-gcp-15.sh
Created Oct 29, 2019
patmigliaccio.com/lessons-ml-gcp 10/29/19
View lessons-ml-gcp-15.sh
kubectl create -f ingress-service.yml
# Verify exposed IP address is ready
kubectl get ingress
@patmigliaccio
patmigliaccio / lessons-ml-gcp-14.sh
Created Oct 29, 2019
patmigliaccio.com/lessons-ml-gcp 10/29/19
View lessons-ml-gcp-14.sh
# Adds the converted origin certficate
gcloud compute ssl-certificates create ingress-cert \
--certificate ./certs/<DOMAIN>.pem \
--private-key ./certs/<DOMAIN>.key
@patmigliaccio
patmigliaccio / lessons-ml-gcp-13.yaml
Created Oct 29, 2019
patmigliaccio.com/lessons-ml-gcp 10/29/19
View lessons-ml-gcp-13.yaml
# ingress-service.yaml
---
apiVersion: "extensions/v1beta1"
kind: "Ingress"
metadata:
name: "ingress"
annotations:
kubernetes.io/ingress.global-static-ip-name: "my-dev-ip"
ingress.gcp.kubernetes.io/pre-shared-cert: "ingress-cert"
spec:
@patmigliaccio
patmigliaccio / lessons-ml-gcp-12.sh
Created Oct 29, 2019
patmigliaccio.com/lessons-ml-gcp 10/29/19
View lessons-ml-gcp-12.sh
gcloud compute addresses create my-dev-ip --global
@patmigliaccio
patmigliaccio / lessons-ml-gcp-11.yaml
Created Oct 29, 2019
patmigliaccio.com/lessons-ml-gcp 10/29/19
View lessons-ml-gcp-11.yaml
# api-service.yaml
---
apiVersion: v1
kind: Service
metadata:
name: api
labels:
io.kompose.service: api
spec:
type: NodePort
@patmigliaccio
patmigliaccio / lessons-ml-gcp-10.sh
Created Oct 29, 2019
patmigliaccio.com/lessons-ml-gcp 10/29/19
View lessons-ml-gcp-10.sh
kubectl create -f api-service.yaml
@patmigliaccio
patmigliaccio / lessons-ml-gcp-9.sh
Created Oct 29, 2019
patmigliaccio.com/lessons-ml-gcp 10/29/19
View lessons-ml-gcp-9.sh
# Install `gsutil` and configure `gcloud` with the project
curl https://sdk.cloud.google.com | bash
exec -l $SHELL
gcloud init
<PROJECT_NAME>
# Create the path within the persistent volume to transfer the files to
mkdir -p $MODELS_PATH
gsutil rsync gs://$GCS_BUCKET $MODELS_PATH
You can’t perform that action at this time.