All Projects → rlancer → google-managed-certs-gke

rlancer / google-managed-certs-gke

Licence: other
DEPRECATED: How to use Google Managed SSL Certificates on GKE

Projects that are alternatives of or similar to google-managed-certs-gke

gke-managed-certificates-demo
GKE ingress with GCP managed certificates
Stars: ✭ 21 (+31.25%)
Mutual labels:  gcp, gke, ssl-certificates
gke-demo
Demonstration of complete, fully-featured CI/CD and cloud automation for microservices, done with GCP/GKE
Stars: ✭ 47 (+193.75%)
Mutual labels:  gcp, gke
k8s-digester
Add digests to container and init container images in Kubernetes pod and pod template specs. Use either as a mutating admission webhook, or as a client-side KRM function with kpt or kustomize.
Stars: ✭ 65 (+306.25%)
Mutual labels:  gcp, gke
gtoken
Securely access AWS services from GKE cluster
Stars: ✭ 43 (+168.75%)
Mutual labels:  gcp, gke
Networking-and-Kubernetes
This is the code repo for Networking and Kubernetes: A Layered Approach. https://learning.oreilly.com/library/view/networking-and-kubernetes/9781492081647/
Stars: ✭ 103 (+543.75%)
Mutual labels:  gcp, gke
gke-vault-demo
This demo builds two GKE Clusters and guides you through using secrets in Vault, using Kubernetes authentication from within a pod to login to Vault, and fetching short-lived Google Service Account credentials on-demand from Vault within a pod.
Stars: ✭ 63 (+293.75%)
Mutual labels:  gcp, gke
inspec-gke-cis-benchmark
GKE CIS 1.1.0 Benchmark InSpec Profile
Stars: ✭ 27 (+68.75%)
Mutual labels:  gcp, gke
gke-anthos-holistic-demo
This repository guides you through deploying a private GKE cluster and provides a base platform for hands-on exploration of several GKE related topics which leverage or integrate with that infrastructure. After completing the exercises in all topic areas, you will have a deeper understanding of several core components of GKE and GCP as configure…
Stars: ✭ 55 (+243.75%)
Mutual labels:  gcp, gke
gke-ip-address-management
An application to help with IP Address Management (IPAM) for Google Kubernetes Engine (GKE) clusters. Easily allows the calculation of the subnets required to spin up GKE clusters in VPC-native mode. See it at: https://googlecloudplatform.github.io/gke-ip-address-management/
Stars: ✭ 45 (+181.25%)
Mutual labels:  gcp, gke
metadata-one-liners
retrive metadata endpoint data with these one liners.
Stars: ✭ 38 (+137.5%)
Mutual labels:  gcp
terraform-google-terraform-enterprise
A Terraform module for deploying Terraform Enterprise on GCP.
Stars: ✭ 22 (+37.5%)
Mutual labels:  gcp
pontem
Open source tools for Google Cloud Storage and Databases.
Stars: ✭ 62 (+287.5%)
Mutual labels:  gcp
server-ip-addresses
Daily updated list of IP addresses / CIDR blocks used by data centers, cloud service providers, servers, etc.
Stars: ✭ 74 (+362.5%)
Mutual labels:  gcp
kubernetes-vault
Run Hashicorp Vault on top of Kubernetes (GKE). Includes instructions for automated backups (GCS) and day-to-day usage.
Stars: ✭ 15 (-6.25%)
Mutual labels:  gke
gke-rbac-demo
This project covers two use cases for RBAC within a Kubernetes Engine cluster. First, assigning different permissions to user personas. Second, granting limited API access to an application running within your cluster. Since RBAC's flexibility can occasionally result in complex rules, you will also perform common steps for troubleshooting RBAC a…
Stars: ✭ 138 (+762.5%)
Mutual labels:  gke
iris3
An upgraded and improved version of the Iris automatic GCP-labeling project
Stars: ✭ 38 (+137.5%)
Mutual labels:  gcp
abilitysheet
This app is ability sheet for beatmania iidx music of level 12.
Stars: ✭ 38 (+137.5%)
Mutual labels:  gcp
kane
Google Pub/Sub client for Elixir
Stars: ✭ 92 (+475%)
Mutual labels:  gcp
nr1-cloud-optimize
NR1 Cloud Optimize allows you to Identify right-sizing opportunities and potential savings of your AWS, GCP, and Azure instances across your cloud environment.
Stars: ✭ 38 (+137.5%)
Mutual labels:  gcp
cloudpods
A cloud-native open-source unified multi-cloud and hybrid-cloud platform. 开源、云原生的多云管理及混合云融合平台
Stars: ✭ 1,469 (+9081.25%)
Mutual labels:  gcp

UPDATE — This guide has been deprecated! Refer to:

https://cloud.google.com/kubernetes-engine/docs/how-to/managed-certs

How to use Google Managed SSL Certificates on GKE

Special thanks to @dannyzen from Google for helping Collaborizm move to GCP. He did help with this post but neither he nor Google endorse its methods.

Getting HTTPS working on GKE can be challenging

Currently there are two main options:

There is a third solution: Google Managed SSL Certs

  • They auto renew
  • Offload all SSL handling to Google's Load Balancer (which every GKE cluster uses)
  • Lower infrastructure costs

Downsides:

  • In beta and not covered by an SLA
  • Use with GKE not fully documented (hence this guide)

Proceed with caution!!!

This guide uses an undocumented GKE annotation.

Part 1 · Setup a Cluster

Create a new GKE project for this to not pollute anything you have in production.

Use gcloud init to create a configuration. If you have trouble taming your configurations check out my other repo, it's a small script to help switch configs based on a .gcloudrc file.

Clone this repo, we'll be using some YAML from it:

$ git clone [email protected]:rlancer/google-managed-certs-gke.git
$ cd gke-https

Create a Cluster, for this demo the cluster only needs one small node:

$ gcloud container clusters create https-demo-cluster --zone us-central1-c --machine-type g1-small --num-nodes 1

>>
NAME                LOCATION       MASTER_VERSION  MASTER_IP       MACHINE_TYPE   NODE_VERSION  NUM_NODES  STATUS
https-demo-cluster  us-central1-c  1.9.7-gke.6     35.226.141.220  n1-standard-1  1.9.7-gke.6   3          RUNNING

Connect Kubectl:

$ gcloud container clusters get-credentials https-demo-cluster --zone us-central1-c 

>> kubeconfig entry generated for https-demo-cluster.

Apply configs:

$ kubectl apply -f demo-app.yaml
$ kubectl apply -f demo-svc.yaml
$ kubectl apply -f demo-ing.yaml

Get the IP address of your Ingress Controller:

Within a few minutes for the IP address should appear

$ kubectl get ingress -w 

>>  
NAME       HOSTS    ADDRESS             PORTS       AGE
demo-ing   *                            80          9s
demo-ing   *        35.241.35.109       80          68s

Visit the IP address in your browser. Hit refresh if does not appear. It may as long as 10 minutes for the app to be fully available.

The app is simply outputting the name of the host it's running on.

host name app running on HTTP

Part 2 · Hook up the Google Managed Cert

Create the Google Managed Cert:

$ gcloud beta compute ssl-certificates create "demo-gmang-cert" --domains demo-gman.collaborizm.com

Get existing URL Maps:

There should only be one URL Map and you'll need the value under NAME when creating the target proxy in the next step

$ gcloud compute url-maps list

>>
NAME                                       DEFAULT_SERVICE
k8s-um-default-demo-ing--3287e1f664ff7581  backendServices/k8s-be-31012--3287e1f664ff7581

Create the HTTPS Target Proxy. Make sure to sub out --url-map with your value:

$ gcloud compute target-https-proxies create https-target --url-map=URL_MAP_VALUE_FROM_ABOVE --ssl-certificates=demo-gmang-cert

>> 
Created [https://www.googleapis.com/compute/v1/projects/kube-https-demo/global/targetHttpsProxies/https-target].

NAME          SSL_CERTIFICATES  URL_MAP
https-target  demo-gmang-cert   k8s-um-default-demo-ing--3287e1f664ff7581

Create a Global Static IP Address:

$ gcloud compute addresses create static-https-ip --global --ip-version IPV4

>> Created [https://www.googleapis.com/compute/v1/projects/kube-https-demo/global/addresses/static-https-ip].

Create a Global Forwarding Rule linking youre newly created IP Address:

$ gcloud compute forwarding-rules create https-global-forwarding-rule --global --ip-protocol=TCP --ports=443 --target-https-proxy=https-target --address static-https-ip 

Adjust the Service to include the Target Proxy, edit demo-svc.yaml to include the target-proxy Annotation. This is undocumented, could be a bad move...

apiVersion: v1
kind: Service
metadata:
  name: demo-svc
  # Add this annotation
  annotations:
    ingress.kubernetes.io/target-proxy: https-target
spec:
  type: NodePort
  selector:
    run: https-demo
  ports:
  - name: http
    protocol: TCP
    port: 333
    targetPort: 9376

Apply the new Service:

$ kubetl apply -f demo-svc.yaml

Get the IP Address assigned to the Target Proxy:

$ gcloud compute addresses list
 
>>
NAME             REGION  ADDRESS        STATUS
static-https-ip          35.227.227.95  IN_USE

Create an A Record with the IP Address (on CloudFlare we turned off proxying, hence the gray cloud)

dns entry CloudFlare

Watch to see if your Cert has been provisioned, this could take as long as half an hour:

$ watch gcloud beta compute ssl-certificates list

>>
demo-gmang-cert  MANAGED  2018-10-29T10:47:05.450-07:00  2019-01-27T09:48:20.000-08:00  ACTIVE
    demo-gman.collaborizm.com: ACTIVE

Next visit https://demo-gman.collaborizm.com in your browser and you should see your GKE app running with a Google Managed Cert.

successful

Interested in Google Cloud Platform?

Start or join a project on Collaborizm! Our partnership with GCP could net you a few grand in credits.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].