Skip to content

Commit

Permalink
Merge pull request #14 from ashish493/master
Browse files Browse the repository at this point in the history
feat: Add support for all resources of k8s and for production server
  • Loading branch information
hsluoyz authored Jul 7, 2021
2 parents af051f5 + 75dc93d commit b3f1f84
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
16 changes: 16 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"debug": true,
"branches": [
"+([0-9])?(.{+([0-9]),x}).x",
"master",
{
"name": "beta",
"prerelease": true
}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/github"
]
}
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ Before proceeding, make sure to have the following-
```
kubectl apply -f deployment.yaml
```
- For a production server, we need to create a k8s `secret` to place the certificates for security purposes.
```
kubectl create secret generic casbin -n default \
--from-file=key.pem=certs/casbin-key.pem \
--from-file=cert.pem=certs/casbin-crt.pem
```
- Once, this part is done we need to change the directory of the certs in [main.go](https://github.com/ashish493/k8s-authz/blob/3560551427c0431a9d4594ad1206f084ede37c49/main.go#L26) and then in [manifests](https://github.com/ashish493/k8s-authz/blob/3560551427c0431a9d4594ad1206f084ede37c49/manifests/deployment.yaml#L22) with that of the `secret`.

Now the server should be running and ready to validate the requests for the operations on the pods.

## Documentation
Expand Down
4 changes: 2 additions & 2 deletions manifests/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ webhooks:
path: "/validate"
caBundle: "${CA_BUNDLE}"
rules:
- operations: ["CREATE","UPDATE","DELETE","CONNECT"]
- operations: ["*"]
apiGroups: [""]
apiVersions: ["v1"]
resources: ["pods"]
resources: ["*/*"]
failurePolicy: Fail

0 comments on commit b3f1f84

Please sign in to comment.