Skip to content

Commit

Permalink
fix permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
bastjan committed Oct 23, 2024
1 parent cfeb497 commit dd47ccf
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 84 deletions.
4 changes: 2 additions & 2 deletions class/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ parameters:
provider:
registry: ghcr.io
image: appuio/machine-api-provider-cloudscale
tag: v0.2.0-dev
tag: v0.2.0-dev3
controller_deployer:
registry: ghcr.io
image: appuio/machine-api-provider-cloudscale
tag: v0.2.0-dev
tag: v0.2.0-dev3
kube_rbac_proxy:
registry: gcr.io
image: kubebuilder/kube-rbac-proxy
Expand Down
39 changes: 7 additions & 32 deletions component/main.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -15,39 +15,15 @@ local serviceAccount = kube.ServiceAccount('appuio-machine-api-provider-cloudsca
metadata+: { namespace: params.namespace },
};

local role = kube.Role('appuio-machine-api-provider-cloudscale') {
metadata+: { namespace: params.namespace },
rules: [
{
apiGroups: [ 'machine.openshift.io' ],
resources: [ '*' ],
verbs: [ '*' ],
},
{
apiGroups: [ 'machine.openshift.io' ],
resources: [ 'machines/status' ],
verbs: [ 'get', 'patch', 'update' ],
},
{
apiGroups: [ '' ],
resources: [ 'secrets' ],
verbs: [ 'get', 'list', 'watch' ],
},
{
apiGroups: [ '' ],
resources: [ 'configmaps', 'deployments' ],
verbs: [ 'get', 'list', 'watch', 'create', 'update', 'patch', 'delete' ],
},
],
};

local roleBinding = kube.RoleBinding('appuio-machine-api-provider-cloudscale') {
metadata+: { namespace: params.namespace },
local clusterRoleBinding = kube.ClusterRoleBinding('appuio-machine-api-provider-cloudscale') {
subjects_: [ serviceAccount ],
roleRef_: role,
roleRef: {
apiGroup: 'rbac.authorization.k8s.io',
kind: 'ClusterRole',
name: 'cluster-admin',
},
};


local kubeProxyContainer = function(upstreamPort, portName, exposePort) {
args: [
'--secure-listen-address=0.0.0.0:%s' % exposePort,
Expand Down Expand Up @@ -245,7 +221,6 @@ local deployment = kube._Object('apps/v1', 'Deployment', 'appuio-machine-api-pro
// Define outputs below
{
serviceAccount: serviceAccount,
role: role,
roleBinding: roleBinding,
clusterRoleBinding: clusterRoleBinding,
deployment: deployment,
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
kind: ClusterRoleBinding
metadata:
annotations: {}
labels:
name: appuio-machine-api-provider-cloudscale
name: appuio-machine-api-provider-cloudscale
namespace: openshift-machine-api
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: appuio-machine-api-provider-cloudscale
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: appuio-machine-api-provider-cloudscale
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ spec:
command:
- machine-api-provider-cloudscale
- -target=manager
image: ghcr.io/appuio/machine-api-provider-cloudscale:v0.2.0-dev
image: ghcr.io/appuio/machine-api-provider-cloudscale:v0.2.0-dev3
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
Expand Down Expand Up @@ -71,7 +71,7 @@ spec:
command:
- machine-api-provider-cloudscale
- -target=machine-api-controllers-manager
image: ghcr.io/appuio/machine-api-provider-cloudscale:v0.2.0-dev
image: ghcr.io/appuio/machine-api-provider-cloudscale:v0.2.0-dev3
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
Expand Down

This file was deleted.

0 comments on commit dd47ccf

Please sign in to comment.