Skip to content

Commit 7b009e8

Browse files
committed
Add section on kubectl apply -f
1 parent 2ea394f commit 7b009e8

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
kube-config
22
*.crt
33
*.key
4-
kubectl

kubectl-gh-actions.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
kubectl config set-context "remote-context" --cluster "minikube" --user "remote-dev"
3030
kubectl config use-context "remote-context"
3131
32-
# kubectl command steps ... #
32+
# kubectl command steps ... #
3333
```
3434

3535
3. Create the full workflow
@@ -47,7 +47,7 @@
4747
on:
4848
push:
4949
branches:
50-
- "1-github-runner-manages-remote"
50+
- "main"
5151
jobs:
5252
deploy:
5353
runs-on: ubuntu-latest
@@ -75,3 +75,14 @@
7575
- name: Run kubectl command against remote API
7676
run: kubectl get namespaces
7777
```
78+
79+
- With this, we have remote access to the API in according with the RBAC rules we created earlier
80+
- If you wanted to `kubectl apply -f` in this action, you could do so like below:
81+
82+
```yaml
83+
# previous setup steps #
84+
85+
- name: kubectl apply with a file
86+
run: |
87+
kubectl apply -f "${GITHUB_WORKSPACE}/manifests/nginx-test.yml"
88+
```

0 commit comments

Comments
 (0)