Skip to content
Snippets Groups Projects
Unverified Commit e12db14d authored by Stefan Prodan's avatar Stefan Prodan Committed by GitHub
Browse files

Merge pull request #1469 from stealthybox/integrations-fixes

Fix and Refactor integrations
parents 7265276c 296bf3cc
No related branches found
No related tags found
No related merge requests found
Showing
with 42 additions and 124 deletions
bases := $(shell dirname $(shell find | grep kustomization.yaml | sort))
all: $(bases)
permutations := $(bases) $(addsuffix /,$(bases))
.PHONY: $(permutations)
$(permutations):
@echo $@
@warnings=$$(kustomize build $@ -o /dev/null 2>&1); \
if [ "$$warnings" ]; then \
echo "$$warnings"; \
false; \
fi
...@@ -7,6 +7,9 @@ commonLabels: ...@@ -7,6 +7,9 @@ commonLabels:
resources: resources:
- sync.yaml - sync.yaml
patchesStrategicMerge:
- kubectl-patch.yaml
vars: vars:
- name: KUBE_SECRET - name: KUBE_SECRET
objref: objref:
...@@ -15,13 +18,6 @@ vars: ...@@ -15,13 +18,6 @@ vars:
apiVersion: v1 apiVersion: v1
fieldref: fieldref:
fieldpath: data.KUBE_SECRET fieldpath: data.KUBE_SECRET
- name: ADDRESS
objref:
kind: ConfigMap
name: credentials-sync-eventhub
apiVersion: v1
fieldref:
fieldpath: data.ADDRESS
configurations: configurations:
- kustomizeconfig.yaml - kustomizeconfig.yaml
...@@ -109,9 +109,9 @@ rules: ...@@ -109,9 +109,9 @@ rules:
- create - create
- update - update
- patch - patch
# # Lock this down to the specific Secret name (Optional) # Lock this down to the specific Secret name (Optional)
#resourceNames: resourceNames:
# - $(KUBE_SECRET) # templated from kustomize vars referencing ConfigMap, also see kustomizeconfig.yaml - $(KUBE_SECRET) # templated from kustomize vars referencing ConfigMap, also see kustomizeconfig.yaml
--- ---
kind: RoleBinding kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
......
apiVersion: batch/v1beta1 apiVersion: batch/v1beta1
kind: CronJob kind: CronJob
metadata: metadata:
name: credentials-sync name: credentials-sync-eventhub
namespace: flux-system namespace: flux-system
spec: spec:
jobTemplate: jobTemplate:
......
...@@ -7,6 +7,9 @@ commonLabels: ...@@ -7,6 +7,9 @@ commonLabels:
resources: resources:
- sync.yaml - sync.yaml
patchesStrategicMerge:
- kubectl-patch.yaml
vars: vars:
- name: KUBE_SECRET - name: KUBE_SECRET
objref: objref:
...@@ -15,13 +18,6 @@ vars: ...@@ -15,13 +18,6 @@ vars:
apiVersion: v1 apiVersion: v1
fieldref: fieldref:
fieldpath: data.KUBE_SECRET fieldpath: data.KUBE_SECRET
- name: ADDRESS
objref:
kind: ConfigMap
name: credentials-sync-eventhub
apiVersion: v1
fieldref:
fieldpath: data.ADDRESS
configurations: configurations:
- kustomizeconfig.yaml - kustomizeconfig.yaml
...@@ -85,9 +85,9 @@ rules: ...@@ -85,9 +85,9 @@ rules:
- create - create
- update - update
- patch - patch
# # Lock this down to the specific Secret name (Optional) # Lock this down to the specific Secret name (Optional)
#resourceNames: resourceNames:
# - $(KUBE_SECRET) # templated from kustomize vars referencing ConfigMap, also see kustomizeconfig.yaml - $(KUBE_SECRET) # templated from kustomize vars referencing ConfigMap, also see kustomizeconfig.yaml
--- ---
kind: RoleBinding kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
......
...@@ -12,5 +12,5 @@ metadata: ...@@ -12,5 +12,5 @@ metadata:
name: lab name: lab
namespace: flux-system namespace: flux-system
spec: spec:
azureIdentity: lab azureIdentity: $(AZ_IDENTITY_NAME) # match the AzureIdentity name
selector: lab selector: $(AZ_IDENTITY_NAME) # match the AzureIdentity name
...@@ -23,15 +23,6 @@ spec: ...@@ -23,15 +23,6 @@ spec:
clientID: 82d01fb0-7799-4d9d-92c7-21e7632c0000 clientID: 82d01fb0-7799-4d9d-92c7-21e7632c0000
resourceID: /subscriptions/82d01fb0-7799-4d9d-92c7-21e7632c0000/resourceGroups/stealthybox/providers/Microsoft.ManagedIdentity/userAssignedIdentities/eventhub-write resourceID: /subscriptions/82d01fb0-7799-4d9d-92c7-21e7632c0000/resourceGroups/stealthybox/providers/Microsoft.ManagedIdentity/userAssignedIdentities/eventhub-write
type: 0 type: 0
---
apiVersion: aadpodidentity.k8s.io/v1
kind: AzureIdentityBinding
metadata:
name: lab
namespace: flux-system
spec:
azureIdentity: jwt-lab
selector: jwt-lab
# Set the reconcile period + specify the pod-identity via the aadpodidbinding label # Set the reconcile period + specify the pod-identity via the aadpodidbinding label
--- ---
......
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: credentials-sync-eventhub
namespace: flux-system
spec:
jobTemplate:
spec:
template:
spec:
initContainers:
- image: bitnami/kubectl
securityContext:
privileged: false
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
name: copy-kubectl
# it's okay to do this because kubectl is a statically linked binary
command:
- sh
- -ceu
- cp $(which kubectl) /kbin/
resources: {}
volumeMounts:
- name: kbin
mountPath: /kbin
containers:
- name: sync
volumeMounts:
- name: kbin
mountPath: /kbin
volumes:
- name: kbin
emptyDir: {}
...@@ -14,7 +14,6 @@ resources: ...@@ -14,7 +14,6 @@ resources:
patchesStrategicMerge: patchesStrategicMerge:
- config-patches.yaml - config-patches.yaml
- kubectl-patch.yaml
- reconcile-patch.yaml - reconcile-patch.yaml
vars: vars:
......
varReference: varReference:
- path: spec/jobTemplate/spec/template/metadata/labels - path: spec/jobTemplate/spec/template/metadata/labels
kind: CronJob kind: CronJob
- path: spec/azureIdentity
kind: AzureIdentityBinding
- path: spec/selector
kind: AzureIdentityBinding
...@@ -3,7 +3,6 @@ apiVersion: v1 ...@@ -3,7 +3,6 @@ apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
name: credentials-sync-eventhub name: credentials-sync-eventhub
namespace: flux-system
data: data:
KUBE_SECRET: webhook-url # does not yet exist -- will be created in the same Namespace KUBE_SECRET: webhook-url # does not yet exist -- will be created in the same Namespace
ADDRESS: "fluxv2" # the Azure Event Hub name ADDRESS: "fluxv2" # the Azure Event Hub name
......
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: credentials-sync-eventhub
namespace: flux-system
spec:
jobTemplate:
spec:
template:
spec:
initContainers:
- image: bitnami/kubectl
securityContext:
privileged: false
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
name: copy-kubectl
# it's okay to do this because kubectl is a statically linked binary
command:
- sh
- -ceu
- cp $(which kubectl) /kbin/
resources: {}
volumeMounts:
- name: kbin
mountPath: /kbin
containers:
- name: sync
volumeMounts:
- name: kbin
mountPath: /kbin
volumes:
- name: kbin
emptyDir: {}
...@@ -14,8 +14,4 @@ resources: ...@@ -14,8 +14,4 @@ resources:
patchesStrategicMerge: patchesStrategicMerge:
- config-patches.yaml - config-patches.yaml
- kubectl-patch.yaml
- reconcile-patch.yaml - reconcile-patch.yaml
configurations:
- kustomizeconfig.yaml
varReference:
- path: spec/jobTemplate/spec/template/metadata/labels
kind: CronJob
...@@ -9,8 +9,8 @@ metadata: ...@@ -9,8 +9,8 @@ metadata:
apiVersion: aadpodidentity.k8s.io/v1 apiVersion: aadpodidentity.k8s.io/v1
kind: AzureIdentityBinding kind: AzureIdentityBinding
metadata: metadata:
name: lab name: lab # this can have a different name, but it's nice to keep them the same
namespace: flux-system namespace: flux-system
spec: spec:
azureIdentity: lab azureIdentity: $(AZ_IDENTITY_NAME) # match the AzureIdentity name
selector: lab selector: $(AZ_IDENTITY_NAME) # match the AzureIdentity name
...@@ -24,15 +24,6 @@ spec: ...@@ -24,15 +24,6 @@ spec:
clientID: 82d01fb0-7799-4d9d-92c7-21e7632c0000 clientID: 82d01fb0-7799-4d9d-92c7-21e7632c0000
resourceID: /subscriptions/82d01fb0-7799-4d9d-92c7-21e7632c0000/resourceGroups/stealthybox/providers/Microsoft.ManagedIdentity/userAssignedIdentities/eventhub-write resourceID: /subscriptions/82d01fb0-7799-4d9d-92c7-21e7632c0000/resourceGroups/stealthybox/providers/Microsoft.ManagedIdentity/userAssignedIdentities/eventhub-write
type: 0 type: 0
---
apiVersion: aadpodidentity.k8s.io/v1
kind: AzureIdentityBinding
metadata:
name: lab
namespace: flux-system
spec:
azureIdentity: jwt-lab
selector: jwt-lab
# Specify the pod-identity via the aadpodidbinding label # Specify the pod-identity via the aadpodidbinding label
--- ---
......
...@@ -14,7 +14,6 @@ resources: ...@@ -14,7 +14,6 @@ resources:
patchesStrategicMerge: patchesStrategicMerge:
- config-patches.yaml - config-patches.yaml
- kubectl-patch.yaml
- reconcile-patch.yaml - reconcile-patch.yaml
vars: vars:
......
varReference: varReference:
- path: spec/template/metadata/labels - path: spec/template/metadata/labels
kind: Deployment kind: Deployment
- path: spec/azureIdentity
kind: AzureIdentityBinding
- path: spec/selector
kind: AzureIdentityBinding
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment