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
// BucketSpec defines the desired state of Bucket | |
type BucketSpec struct { | |
// Cloud platform | |
// +kubebuilder:validation:Enum=gcp | |
// +kubebuilder:validation:Required | |
Cloud BucketCloud `json:"cloud"` | |
// FullName is the cloud storage bucket full name | |
// +kubebuilder:validation:Required | |
FullName string `json:"fullName"` |
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: admissionregistration.k8s.io/v1 | |
kind: MutatingWebhookConfiguration | |
metadata: | |
name: "hello-webhook.leclouddev.com" | |
webhooks: | |
- name: "hello-webhook.leclouddev.com" | |
objectSelector: | |
matchLabels: | |
hello: "true" | |
rules: |
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: v1 | |
kind: Service | |
metadata: | |
name: hello-webhook-service | |
spec: | |
type: ClusterIP | |
selector: | |
app: hello-webhook | |
ports: | |
- protocol: TCP |
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: apps/v1 | |
kind: Deployment | |
metadata: | |
name: hello-webhook-deployment | |
labels: | |
app: hello-webhook | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: |
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: batch/v1 | |
kind: Job | |
metadata: | |
name: webhook-cert-setup | |
spec: | |
template: | |
spec: | |
serviceAccountName: webhook-cert-sa | |
containers: | |
- name: webhook-cert-setup |
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: v1 | |
kind: ConfigMap | |
metadata: | |
name: hello-configmap | |
data: | |
hello.txt: "\n /$$$$$$$$ /$$ /$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$ | |
\ /$$ /$$$$$$ /$$$$$$ \n|__ $$__/| $$ | $$|_ $$_/ /$$__ $$ |_ $$_/ | |
/$$__ $$ | $$ /$$/ /$$__ $$ /$$__ $$\n | $$ | $$ | $$ | $$ | $$ | |
\ \\__/ | $$ | $$ \\__/ | $$ /$$/ | $$ \\ $$| $$ \\__/\n | $$ | |
\ | $$$$$$$$ | $$ | $$$$$$ | $$ | $$$$$$ | $$$$$/ | $$$$$$/| |
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
func (app *App) HandleMutate(w http.ResponseWriter, r *http.Request) { | |
admissionReview := &admissionv1.AdmissionReview{} | |
// read the AdmissionReview from the request json body | |
err := readJSON(r, admissionReview) | |
if err != nil { | |
app.HandleError(w, r, err) | |
return | |
} |
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
USERS_APP_VERSION=0.1.1 | |
USERS_APP_IMAGE=gcr.io/$(PROJECT_ID)/users:$(USERS_APP_VERSION) | |
LOCATIONS_APP_VERSION=0.1.1 | |
LOCATIONS_APP_IMAGE=gcr.io/$(PROJECT_ID)/locations:$(LOCATIONS_APP_VERSION) | |
gcp-enable-apis: | |
gcloud services enable cloudresourcemanager.googleapis.com --project $(PROJECT_ID) | |
gcloud services enable cloudbuild.googleapis.com --project $(PROJECT_ID) | |
gcloud services enable apigateway.googleapis.com --project $(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
// BuildRouter builds the router | |
func BuildRouter() (*chi.Mux, error) { | |
r := chi.NewRouter() | |
// the single route in our app (would need to be moved to a "handlers" package in a production app) | |
r.Get("/all", func(w http.ResponseWriter, r *http.Request) { | |
locations := []Location{ | |
Location{ | |
ID: 1, | |
Name: "London", |
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
swagger: '2.0' | |
info: | |
title: gateway-demo | |
description: API Gateway demo with 2 cloud run backends | |
version: 1.0.0 | |
schemes: | |
- https | |
produces: | |
- application/json | |
paths: |