Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change patch to json and fix readme #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ or ZMS UI corresponding to the Identityd k8s service
### Usage
1. The application deployments that require Athenz identity certs need the SIA container
and the kubernetes bound service account JWT volume mount added to the pod template
using the sample [patch](k8s/patch/sia.yaml)
using the sample [patch](k8s/patch/sia.json)

```
kubectl patch deploy <app.yaml> -p k8s-athenz-identity/k8s/patch/sia.yaml
kubectl patch deploy <app.yaml> -p "$(k8s/patch/sia.json)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This command is also not working, I believe you need to remove the word deploy and add -f and also the "$(k8s/patch/sia.json)" is not a command?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should work:
kubectl patch -f app.yaml -p "$(cat k8s/patch/sia.json)"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This command actually also works with the yaml format as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

confirmed it is working with yaml as well.

```

The generated Athenz cert and key is stored under the `tls-certs` volume mount.
Expand Down
70 changes: 70 additions & 0 deletions k8s/patch/sia.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"spec": {
"template": {
"spec": {
"containers": [
{
"args": [
"--mode=refresh"
],
"image": "local/athenz-sia:latest",
"imagePullPolicy": "IfNotPresent",
"name": "sia",
"volumeMounts": [
{
"mountPath": "/var/run/athenz",
"name": "tls-certs"
},
{
"mountPath": "/var/run/secrets/kubernetes.io/bound-serviceaccount",
"name": "identityd-token",
"readOnly": true
}
]
}
],
"initContainers": [
{
"args": [
"--mode=init"
],
"image": "local/athenz-sia:latest",
"imagePullPolicy": "IfNotPresent",
"name": "sia-init",
"volumeMounts": [
{
"mountPath": "/var/run/athenz",
"name": "tls-certs"
},
{
"mountPath": "/var/run/secrets/kubernetes.io/bound-serviceaccount",
"name": "identityd-token",
"readOnly": true
}
]
}
],
"volumes": [
{
"emptyDir": {},
"name": "tls-certs"
},
{
"name": "identityd-token",
"projected": {
"sources": [
{
"serviceAccountToken": {
"audience": "athenz-identityd",
"expirationSeconds": 3600,
"path": "token"
}
}
]
}
}
]
}
}
}
}
37 changes: 0 additions & 37 deletions k8s/patch/sia.yaml

This file was deleted.