-
Notifications
You must be signed in to change notification settings - Fork 34
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
solved #33
base: main
Are you sure you want to change the base?
solved #33
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: list-pods-sa | ||
namespace: todoapp | ||
|
||
--- | ||
|
||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: list-pods-role | ||
namespace: todoapp | ||
rules: | ||
- apiGroups: [""] | ||
resources: ["pods", "secrets"] | ||
verbs: ["get", "list"] | ||
|
||
--- | ||
|
||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: list-pods-rb | ||
namespace: todoapp | ||
subjects: | ||
- kind: ServiceAccount | ||
name: list-pods-sa | ||
namespace: todoapp | ||
roleRef: | ||
kind: Role | ||
name: list-pods-role | ||
apiGroup: rbac.authorization.k8s.io |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
In order to validate that the roles are applied correctly: | ||
|
||
kubectl exec -it <pod-name> -- /bin/sh | ||
|
||
TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token) | ||
NAMESPACE=$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace) | ||
|
||
curl -s -k \ | ||
-H "Authorization: Bearer $TOKEN" \ | ||
https://kubernetes.default.svc/api/v1/namespaces/$NAMESPACE/secrets | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
#!/bin/bash | ||
kubectl apply -f .infrastructure/mysql/ns.yml | ||
kubectl apply -f .infrastructure/mysql/configMap.yml | ||
kubectl apply -f .infrastructure/mysql/secret.yml | ||
kubectl apply -f .infrastructure/mysql/service.yml | ||
kubectl apply -f .infrastructure/mysql/statefulSet.yml | ||
# kubectl apply -f .infrastructure/mysql/ns.yml | ||
# kubectl apply -f .infrastructure/mysql/configMap.yml | ||
# kubectl apply -f .infrastructure/mysql/secret.yml | ||
# kubectl apply -f .infrastructure/mysql/service.yml | ||
# kubectl apply -f .infrastructure/mysql/statefulSet.yml | ||
|
||
kubectl apply -f .infrastructure/app/ns.yml | ||
# kubectl apply -f .infrastructure/app/ns.yml | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The namespace for the app is commented out. Make sure the namespace already exists or is created by another means before applying other resources. |
||
kubectl apply -f .infrastructure/app/pv.yml | ||
kubectl apply -f .infrastructure/app/pvc.yml | ||
kubectl apply -f .infrastructure/app/secret.yml | ||
kubectl apply -f .infrastructure/app/configMap.yml | ||
kubectl apply -f .infrastructure/app/clusterIp.yml | ||
kubectl apply -f .infrastructure/app/nodeport.yml | ||
# kubectl apply -f .infrastructure/app/nodeport.yml | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The NodePort service is commented out. If external access to the application is needed, ensure that this is configured appropriately elsewhere. |
||
kubectl apply -f .infrastructure/app/hpa.yml | ||
kubectl apply -f .infrastructure/app/deployment.yml | ||
kubectl apply -f .infrastructure/security/rbac.yml | ||
|
||
# Install Ingress Controller | ||
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml | ||
# kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml | ||
# kubectl apply -f .infrastructure/ingress/ingress.yml | ||
Comment on lines
+20
to
21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ingress-related commands are commented out. If you require ingress for your application, make sure to uncomment these lines or manage ingress separately. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines are commented out, which means the MySQL resources will not be applied. Ensure this is intentional and that MySQL is either not needed or is managed separately.