
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
github.com/jkyau-dsc/timeline
In this chapter, we just go over a very basic example using k8s services.
We have a server written in Go that runs 2 different versions of an API.
Services rely upon the label and selector constructs
We also get familiar with 2 useful tools: kubectl port-forward
and kubectl get endpoints
.
By default, kubectl operates within the default namespace. This is fine for testing purposes but feel free to create a new namespace and work within that if you do so choose.
I highly recommend disconnecting from the VPN
Please ensure that kubectl is using the correct context
$ kubectl config current-context
minikube
If the above command doesn't return minikube, please walkthrough the minikube installation instructions one more time to make sure everything was set up properly or contact infra for assistance.
$ eval $(minikube docker-env)
Note that you will need to run the above command whenever you interact with a new shell for the changes to be applied
code/k8s-for-app-devs/workshops/session1 $ docker build -t coolapp .
code/k8s-for-app-devs/workshops/session1 $ kubectl apply -f k8s/coolappv1-deployment.yaml
code/k8s-for-app-devs/workshops/session1 $ kubectl apply -f k8s/coolappv2-deployment.yaml
code/k8s-for-app-devs/workshops/session1 $ kubectl apply -f k8s/service.yaml
You can inspect the various resources we have created using kubectl to find out more
$ kubectl get deployment coolapp-v1
$ kubectl get deployment coolapp-v2
$ kubectl get service coolapp
# can try using the following tricks to get more information about a resource (works with deployments, services, and more)
$ kubectl get deployment coolapp-v1 -o json # also supports yaml
$ kubectl describe deployment coolapp-v1
$ kubectl port-forward svc/coolapp 8080:8080
# can open up a new shell or a browser to test
$ curl localhost:8080
Stop the port-forwarding. It's time to modify the service so that we can start serving the superior version 2 of this application.
At the beginning of this workshop, the selector looks like
selector:
app: coolapp
version: v1
Now we want to change it to
selector:
app: coolapp
version: v2
We have 2 options to choose from to make this change.
Kubectl edit allows a user to modify a resource directly using a specified text editor. The change will be applied after saving and exiting the editor.
$ kubectl edit service coolapp
By default, this uses the vi text editor. This can be changed by reading the docs
You also have the option of modifying the service.yaml
and updating the selector in that file.
code/k8s-for-app-devs/workshops/session1 $ kubectl apply -f k8s/service.yaml
Endpoints are one of the lower level abstractions that support Kubernetes services. As you make changes to the service selector, I recommend running
kubectl get endpoints
in order to see how the changes manifests. Try the following
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.