Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Remove dependency on azure.json #221

Merged
merged 4 commits into from
May 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion cmd/mic/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func main() {
flag.BoolVar(&forceNamespaced, "forceNamespaced", false, "Forces namespaced identities, binding, and assignment")
flag.Parse()
if cloudconfig == "" {
glog.Fatalf("Could not get the cloud config")
glog.Warningf("--cloudconfig not passed will use aadpodidentity-admin-secret")
}
if kubeconfig == "" {
glog.Warningf("--kubeconfig not passed will use InClusterConfig")
Expand Down
246 changes: 246 additions & 0 deletions deploy/infra/noazurejson/deployment-rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,246 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: aad-pod-id-nmi-service-account
namespace: default
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: azureassignedidentities.aadpodidentity.k8s.io
spec:
group: aadpodidentity.k8s.io
version: v1
names:
kind: AzureAssignedIdentity
plural: azureassignedidentities
scope: Namespaced
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: azureidentitybindings.aadpodidentity.k8s.io
spec:
group: aadpodidentity.k8s.io
version: v1
names:
kind: AzureIdentityBinding
plural: azureidentitybindings
scope: Namespaced
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: azureidentities.aadpodidentity.k8s.io
spec:
group: aadpodidentity.k8s.io
version: v1
names:
kind: AzureIdentity
singular: azureidentity
plural: azureidentities
scope: Namespaced
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: aad-pod-id-nmi-role
rules:
- apiGroups: ["apiextensions.k8s.io"]
resources: ["customresourcedefinitions"]
verbs: ["get", "list"]
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "list"]
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get"]
- apiGroups: ["aadpodidentity.k8s.io"]
resources: ["azureidentitybindings", "azureidentities"]
verbs: ["get", "list"]
- apiGroups: ["aadpodidentity.k8s.io"]
resources: ["azureassignedidentities"]
verbs: ["get", "list"]
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: aad-pod-id-nmi-binding
labels:
k8s-app: aad-pod-id-nmi-binding
subjects:
- kind: ServiceAccount
name: aad-pod-id-nmi-service-account
namespace: default
roleRef:
kind: ClusterRole
name: aad-pod-id-nmi-role
apiGroup: rbac.authorization.k8s.io
---
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
labels:
kubernetes.io/cluster-service: "true"
component: nmi
tier: node
k8s-app: aad-pod-id
name: nmi
namespace: default
spec:
template:
metadata:
labels:
component: nmi
tier: node
spec:
serviceAccountName: aad-pod-id-nmi-service-account
hostNetwork: true
volumes:
- hostPath:
path: /run/xtables.lock
type: FileOrCreate
name: iptableslock
containers:
- name: nmi
image: "mcr.microsoft.com/k8s/aad-pod-identity/nmi:1.4"
imagePullPolicy: Always
args:
- nmi
- "--host-ip=$(HOST_IP)"
- "--node=$(NODE_NAME)"
env:
- name: HOST_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
securityContext:
privileged: true
capabilities:
add:
- NET_ADMIN
volumeMounts:
- mountPath: /run/xtables.lock
name: iptableslock
nodeSelector:
beta.kubernetes.io/os: linux
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: aad-pod-id-mic-service-account
namespace: default
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: aad-pod-id-mic-role
rules:
- apiGroups: ["apiextensions.k8s.io"]
resources: ["customresourcedefinitions"]
verbs: ["*"]
- apiGroups: [""]
resources: ["pods", "nodes"]
verbs: [ "list", "watch" ]
- apiGroups: [""]
resources: ["events"]
verbs: ["create", "patch"]
- apiGroups: ["aadpodidentity.k8s.io"]
resources: ["azureidentitybindings", "azureidentities"]
verbs: ["get", "list", "watch", "post"]
- apiGroups: ["aadpodidentity.k8s.io"]
resources: ["azureassignedidentities"]
verbs: ["*"]
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: aad-pod-id-mic-binding
labels:
k8s-app: aad-pod-id-mic-binding
subjects:
- kind: ServiceAccount
name: aad-pod-id-mic-service-account
namespace: default
roleRef:
kind: ClusterRole
name: aad-pod-id-mic-role
apiGroup: rbac.authorization.k8s.io
---
apiVersion: v1
data:
Cloud: <base64-encoded-cloud>
SubscriptionID: <base64-encode-subscription-id>
ResourceGroup: <base64-encoded-resource-group>
VMType: <base64-encoded-vm-type>
TenantID: <base64-encoded-tenant-id>
ClientID: <base64-encoded-client-id>
ClientSecret: <base64-encoded-client-secret>
kind: Secret
metadata:
name: aadpodidentity-admin-secret
namespace: default
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
component: mic
k8s-app: aad-pod-id
name: mic
namespace: default
spec:
template:
metadata:
labels:
component: mic
spec:
serviceAccountName: aad-pod-id-mic-service-account
containers:
- name: mic
image: "mcr.microsoft.com/k8s/aad-pod-identity/mic:1.3"
imagePullPolicy: Always
args:
- "--logtostderr"
env:
- name: CLOUD
valueFrom:
secretKeyRef:
key: Cloud
name: aadpodidentity-admin-secret
- name: SUBSCRIPTION_ID
valueFrom:
secretKeyRef:
key: SubscriptionID
name: aadpodidentity-admin-secret
- name: RESOURCE_GROUP
valueFrom:
secretKeyRef:
key: ResourceGroup
name: aadpodidentity-admin-secret
- name: VM_TYPE
valueFrom:
secretKeyRef:
key: VMType
name: aadpodidentity-admin-secret
- name: TENANT_ID
valueFrom:
secretKeyRef:
key: TenantID
name: aadpodidentity-admin-secret
- name: CLIENT_ID
valueFrom:
secretKeyRef:
key: ClientID
name: aadpodidentity-admin-secret
- name: CLIENT_SECRET
valueFrom:
secretKeyRef:
key: ClientSecret
name: aadpodidentity-admin-secret
nodeSelector:
beta.kubernetes.io/os: linux
Loading