Skip to content

Commit

Permalink
Merge pull request Azure#558 from Azure/add-integration-deploy
Browse files Browse the repository at this point in the history
Add Service Account and roles for integration
  • Loading branch information
janboll authored Sep 5, 2024
2 parents a9a8edb + 4015925 commit 38d3a09
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cluster-service/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ deploy:
-p IMAGE_REPOSITORY=app-sre/uhc-clusters-service \
-p IMAGE_TAG=2256c75 | oc apply -f -

deploy-integ:
oc process --local -f deploy/integration/cluster-service-namespace.yaml | oc apply -f -

# for local development
provision-shard:
@ZONE_RESOURCE_ID=$(shell az network dns zone list -g ${REGIONAL_RESOURCEGROUP} --query "[?zoneType=='Public'].id" -o tsv) && \
sed -e "s#ZONE_RESOURCE_ID#$${ZONE_RESOURCE_ID}#g" -e "s/REGION/${REGION}/g" -e "s/CONSUMER_NAME/${CONSUMER_NAME}/g" deploy/dev-provisioning-shards.yml

.PHONY: deploy
.PHONY: deploy deploy-integ provision-shard
50 changes: 50 additions & 0 deletions cluster-service/deploy/integration/cluster-service-namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
apiVersion: v1
kind: Template
metadata:
name: cluster-service-admin
objects:
- apiVersion: v1
kind: Namespace
metadata:
name: cluster-service-admin
- apiVersion: v1
kind: ServiceAccount
metadata:
name: cluster-service-mgmt
namespace: cluster-service-admin
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: namespace-admin
rules:
- apiGroups:
- ""
resources:
- namespace
verbs:
- "*"
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: cluster-service-admin
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: admin
subjects:
- kind: ServiceAccount
name: cluster-service-mgmt
namespace: cluster-service-admin
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: cluster-service-namespace-admin
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: namespace-admin
subjects:
- kind: ServiceAccount
name: cluster-service-mgmt
namespace: cluster-service-admin

0 comments on commit 38d3a09

Please sign in to comment.