Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated GCP Credentials Addon Prototype #8682

Merged
merged 39 commits into from
Jul 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
652ebd6
metadata addon works
Jan 27, 2020
5cd023c
Add code for metadata server image and makefile rules
Jan 27, 2020
582ed25
remove log message
Jan 28, 2020
615b35f
update to work with v1.13.11
Jan 29, 2020
4c20014
update readme
Apr 20, 2020
d138d42
Merge branch 'metadata-addon' of github.com:priyawadhwa/minikube into…
sharifelgamal Jun 2, 2020
8a202f0
fix metadata addon stuff for newer codebase
sharifelgamal Jun 4, 2020
b0fc07a
buncha changes
sharifelgamal Jun 15, 2020
66d37c8
just so many changes
sharifelgamal Jun 30, 2020
b186746
Merge branch 'master' of github.com:kubernetes/minikube into metadata
sharifelgamal Jun 30, 2020
60e3d32
ch-ch-ch-ch-changes
sharifelgamal Jul 7, 2020
9ae5bc4
addon works
sharifelgamal Jul 8, 2020
7722419
update readme
sharifelgamal Jul 8, 2020
09478c9
Merge branch 'master' of github.com:kubernetes/minikube into metadata
sharifelgamal Jul 8, 2020
95c9ff9
boilerplate
sharifelgamal Jul 8, 2020
ec11746
revert unrelated change
sharifelgamal Jul 8, 2020
216462b
move server code to another repo
sharifelgamal Jul 8, 2020
a8abf43
switch addon name to gcp-auth
sharifelgamal Jul 8, 2020
488c625
metadata -> gcp-auth
sharifelgamal Jul 10, 2020
839e581
missed one
sharifelgamal Jul 10, 2020
f4fb523
Merge branch 'master' of github.com:kubernetes/minikube into metadata
sharifelgamal Jul 13, 2020
3046d00
Merge branch 'master' of github.com:kubernetes/minikube into metadata
sharifelgamal Jul 14, 2020
b5d9e3c
automate finding of credentials
sharifelgamal Jul 14, 2020
76d4dc3
remove unnecessary comment
sharifelgamal Jul 14, 2020
a34eca7
address comments
sharifelgamal Jul 14, 2020
3f86eff
Update README.md
sharifelgamal Jul 14, 2020
aabbbe0
Update README.md
sharifelgamal Jul 15, 2020
dde94b5
use mustload everywhere
sharifelgamal Jul 15, 2020
603040d
Merge branch 'metadata' of github.com:sharifelgamal/minikube into met…
sharifelgamal Jul 15, 2020
e651fab
swap selector condition
sharifelgamal Jul 15, 2020
dd89c1c
upgrade kube-webhook-certgen to 1.3
sharifelgamal Jul 15, 2020
142192b
move paths to constants
sharifelgamal Jul 15, 2020
3353198
Merge branch 'master' of github.com:kubernetes/minikube into metadata
sharifelgamal Jul 15, 2020
0a67568
add notice to user on addon enable
sharifelgamal Jul 15, 2020
0ee4b71
adding addon documentation
sharifelgamal Jul 16, 2020
2d136d1
Merge branch 'master' of github.com:kubernetes/minikube into metadata
sharifelgamal Jul 19, 2020
f6f5057
Merge branch 'master' of github.com:kubernetes/minikube into metadata
sharifelgamal Jul 21, 2020
ce0d41a
move addons documentation inside handbook
sharifelgamal Jul 21, 2020
f07dd49
remove old addons docs location
sharifelgamal Jul 21, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions deploy/addons/gcp-auth/gcp-auth-ns.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2017 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: v1
kind: Namespace
metadata:
name: gcp-auth
labels:
kubernetes.io/minikube-addons: gcp-auth
12 changes: 12 additions & 0 deletions deploy/addons/gcp-auth/gcp-auth-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: gcp-auth
namespace: gcp-auth
spec:
ports:
- port: 443
targetPort: 8443
protocol: TCP
selector:
app: gcp-auth
150 changes: 150 additions & 0 deletions deploy/addons/gcp-auth/gcp-auth-webhook.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: minikube-gcp-auth-certs
namespace: gcp-auth
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: minikube-gcp-auth-certs
rules:
- apiGroups:
- ''
resources:
- secrets
verbs:
- list
- get
- create
- apiGroups:
- admissionregistration.k8s.io
resources:
- mutatingwebhookconfigurations
verbs:
- get
- update

---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: minikube-gcp-auth-certs
namespace: metadata
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: minikube-gcp-auth-certs
subjects:
- kind: ServiceAccount
name: minikube-gcp-auth-certs
namespace: gcp-auth
---
apiVersion: batch/v1
kind: Job
metadata:
name: gcp-auth-certs-create
namespace: gcp-auth
spec:
template:
metadata:
name: gcp-auth-certs-create
spec:
serviceAccountName: minikube-gcp-auth-certs
containers:
- name: create
image: jettech/kube-webhook-certgen:v1.3.0
imagePullPolicy: IfNotPresent
args:
- create
- --host=gcp-auth,gcp-auth.gcp-auth,gcp-auth.gcp-auth.svc
- --namespace=gcp-auth
- --secret-name=gcp-auth-certs
restartPolicy: OnFailure
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: gcp-auth
namespace: gcp-auth
spec:
selector:
matchLabels:
app: gcp-auth
template:
metadata:
labels:
app: gcp-auth
kubernetes.io/minikube-addons: gcp-auth
spec:
containers:
- name: gcp-auth
image: gcr.io/k8s-minikube/gcp-auth-webhook:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8443
volumeMounts:
- name: webhook-certs
mountPath: /etc/webhook/certs
readOnly: true
- name: gcp-project
mountPath: /var/lib/minikube/google_cloud_project
readOnly: true
volumes:
- name: webhook-certs
secret:
secretName: gcp-auth-certs
- name: gcp-project
hostPath:
path: /var/lib/minikube/google_cloud_project
type: File
---
apiVersion: batch/v1
kind: Job
metadata:
name: gcp-auth-certs-patch
namespace: gcp-auth
spec:
template:
metadata:
name: gcp-auth-certs-patch
spec:
serviceAccountName: minikube-gcp-auth-certs
containers:
- name: patch
image: jettech/kube-webhook-certgen:v1.3.0
imagePullPolicy: IfNotPresent
args:
- patch
- --secret-name=gcp-auth-certs
- --namespace=gcp-auth
- --patch-validating=false
- --webhook-name=gcp-auth-webhook-cfg
restartPolicy: OnFailure
---
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
name: gcp-auth-webhook-cfg
labels:
app: gcp-auth
webhooks:
- name: gcp-auth-mutate.k8s.io
objectSelector:
matchExpressions:
- key: gcp-auth-skip-secret
operator: DoesNotExist
sideEffects: None
admissionReviewVersions: ["v1","v1beta1"]
clientConfig:
service:
name: gcp-auth
namespace: gcp-auth
path: "/mutate"
rules:
- operations: ["CREATE", "UPDATE"]
medyagh marked this conversation as resolved.
Show resolved Hide resolved
apiGroups: ["*"]
apiVersions: ["*"]
resources: ["pods"]
scope: "*"
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ require (
github.com/zchee/go-vmnet v0.0.0-20161021174912-97ebf9174097
golang.org/x/build v0.0.0-20190927031335-2835ba2e683f
golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a
golang.org/x/sys v0.0.0-20200523222454-059865788121
golang.org/x/text v0.3.2
Expand Down
Loading